5 #ifndef JODA_GROUPAGGREGATOR_H
6 #define JODA_GROUPAGGREGATOR_H
8 #include <unordered_map>
16 std::unique_ptr<IValueProvider> &&
groupBy,
17 std::unique_ptr<IAggregator> &&agg, std::string
groupAs =
"");
22 std::unique_ptr<IAggregator>
duplicate()
const override;
24 static constexpr
auto getName_() {
return "GROUP"; }
26 const std::string
getName()
const override;
27 std::string
toString()
const override;
37 const std::unique_ptr<IValueProvider>
groupBy;
43 typedef std::unordered_map<std::string, std::unique_ptr<IAggregator>>
46 typedef std::unordered_map<double, std::unique_ptr<IAggregator>>
49 std::unique_ptr<IAggregator>
trueAgg =
nullptr;
50 std::unique_ptr<IAggregator>
falseAgg =
nullptr;
rapidjson::MemoryPoolAllocator< RJBaseAlloc > RJMemoryPoolAlloc
Definition: RJFwd.h:26
rapidjson::GenericValue< RJChar, RJMemoryPoolAlloc > RJValue
Definition: RJFwd.h:29
Definition: RapidJsonDocument.h:22
Definition: GroupAggregator.h:13
const std::unique_ptr< IAggregator > protoAgg
Definition: GroupAggregator.h:38
StringAggregators stringGroups
Definition: GroupAggregator.h:45
std::string groupAs
Definition: GroupAggregator.h:54
const std::unique_ptr< IValueProvider > groupBy
Definition: GroupAggregator.h:37
const std::string getName() const override
Definition: GroupAggregator.cpp:62
~GroupAggregator() override=default
GroupAggregator(const std::string &toPointer, std::unique_ptr< IValueProvider > &&groupBy, std::unique_ptr< IAggregator > &&agg, std::string groupAs="")
Definition: GroupAggregator.cpp:9
static constexpr auto getName_()
Definition: GroupAggregator.h:24
void merge(IAggregator *other) override
Definition: GroupAggregator.cpp:17
std::unique_ptr< IAggregator > trueAgg
Definition: GroupAggregator.h:49
std::unique_ptr< IAggregator > duplicate() const override
Definition: GroupAggregator.cpp:57
std::string toString() const override
Definition: GroupAggregator.cpp:66
const std::string getGroupName() const
Definition: GroupAggregator.cpp:76
RJValue terminate(RJMemoryPoolAlloc &alloc) override
Definition: GroupAggregator.cpp:88
std::unique_ptr< IAggregator > falseAgg
Definition: GroupAggregator.h:50
void accumulate(const RapidJsonDocument &json, RJMemoryPoolAlloc &alloc) override
Definition: GroupAggregator.cpp:123
void setGroupAs(const std::string &groupAs)
Definition: GroupAggregator.cpp:175
std::vector< std::string > getAttributes() const override
Definition: GroupAggregator.cpp:179
const std::string getValueName() const
Definition: GroupAggregator.cpp:84
std::unordered_map< double, std::unique_ptr< IAggregator > > NumAggregators
Definition: GroupAggregator.h:47
NumAggregators numGroups
Definition: GroupAggregator.h:48
std::unordered_map< std::string, std::unique_ptr< IAggregator > > StringAggregators
Definition: GroupAggregator.h:44
Definition: IAggregator.h:25
std::string toPointer
Definition: IAggregator.h:120
Definition: AttributeStatAggregator.h:12