#include class Count : public ValueAggregate { public: Count(ScriptNodePtr s) : ValueAggregate(s), c(0) { } void reset() const { c = 0; } void pushValue(const VariableType & v, ExecContext *) const { if (!v.isNull()) { c += 1; } } VariableType resultValue() const { return c; } private: mutable int c; }; DECLARE_LOADER("count", Count);