JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
CollectAggregator.h
Go to the documentation of this file.
1 //
2 // Created by Nico on 18/03/2019.
3 //
4 
5 #ifndef JODA_COLLECTAGGREGATOR_H
6 #define JODA_COLLECTAGGREGATOR_H
8 
9 namespace joda::query {
11  public:
12  CollectAggregator(const std::string &toPointer,
13  std::vector<std::unique_ptr<IValueProvider>> &&params);
14 
15  void merge(IAggregator *other) override;
17  std::unique_ptr<IAggregator> duplicate() const override;
18  void accumulate(const RapidJsonDocument &json,
19  RJMemoryPoolAlloc &alloc) override;
20  const std::string getName() const override;
21 
22  static constexpr auto getName_() { return "COLLECT"; }
23 
24  protected:
25  std::unique_ptr<RJValue> list;
26  std::unique_ptr<RJMemoryPoolAlloc> alloc;
27 };
28 } // namespace joda::query
29 
30 #endif // JODA_COLLECTAGGREGATOR_H
rapidjson::MemoryPoolAllocator< RJBaseAlloc > RJMemoryPoolAlloc
Definition: RJFwd.h:26
rapidjson::GenericValue< RJChar, RJMemoryPoolAlloc > RJValue
Definition: RJFwd.h:29
Definition: RapidJsonDocument.h:22
Definition: CollectAggregator.h:10
std::unique_ptr< RJValue > list
Definition: CollectAggregator.h:25
CollectAggregator(const std::string &toPointer, std::vector< std::unique_ptr< IValueProvider >> &&params)
Definition: CollectAggregator.cpp:53
std::unique_ptr< IAggregator > duplicate() const override
Definition: CollectAggregator.cpp:35
void accumulate(const RapidJsonDocument &json, RJMemoryPoolAlloc &alloc) override
Definition: CollectAggregator.cpp:39
static constexpr auto getName_()
Definition: CollectAggregator.h:22
void merge(IAggregator *other) override
Definition: CollectAggregator.cpp:17
std::unique_ptr< RJMemoryPoolAlloc > alloc
Definition: CollectAggregator.h:26
const std::string getName() const override
Definition: CollectAggregator.cpp:13
RJValue terminate(RJMemoryPoolAlloc &alloc) override
Definition: CollectAggregator.cpp:29
Definition: IAggregator.h:25
std::vector< std::unique_ptr< IValueProvider > > params
Definition: IAggregator.h:124
std::string toPointer
Definition: IAggregator.h:120
Definition: AttributeStatAggregator.h:12