5 #ifndef JODA_IAGGREGATOR_H
6 #define JODA_IAGGREGATOR_H
9 #include <rapidjson/allocators.h>
10 #include <rapidjson/fwd.h>
35 std::vector<std::unique_ptr<IValueProvider>> &&
params)
37 for (
auto ¶m : this->
params) {
77 virtual std::unique_ptr<IAggregator>
duplicate()
const = 0;
96 std::vector<std::string> ret;
97 for (
const auto ¶m :
params) {
98 param->getAttributes(ret);
104 std::vector<std::string> pars;
105 for (
auto &¶m :
params) {
106 pars.push_back(param->toString());
108 std::stringstream ss;
109 std::move(std::begin(pars), std::end(pars),
124 std::vector<std::unique_ptr<IValueProvider>>
params;
127 if (
params.size() != expected) {
133 if (
params.size() < expected) {
140 if (!(
params[i]->isAny() ||
params[i]->getReturnType() == expected)) {
149 if (!(
params[i]->isAny() ||
params[i]->getReturnType() == expected)) {
155 std::vector<std::unique_ptr<IValueProvider>> ret;
156 for (
auto &¶m :
params) {
157 ret.push_back(param->duplicate());
169 return std::make_unique<queue_t>();
171 static std::unique_ptr<queue_t>
getQueue(
size_t minCapacity,
172 size_t maxProducers) {
173 return std::make_unique<queue_t>(minCapacity, maxProducers);
rapidjson::MemoryPoolAllocator< RJBaseAlloc > RJMemoryPoolAlloc
Definition: RJFwd.h:26
rapidjson::GenericValue< RJChar, RJMemoryPoolAlloc > RJValue
Definition: RJFwd.h:29
Definition: RapidJsonDocument.h:22
Definition: infix_iterator.h:11
Definition: IAggregator.h:25
void checkParamType(unsigned int i, IValueType expected)
Definition: IAggregator.h:139
std::vector< std::unique_ptr< IValueProvider > > params
Definition: IAggregator.h:124
void checkMinParamSize(unsigned int expected)
Definition: IAggregator.h:132
IAggregator(IAggregator const &)=delete
virtual ~IAggregator()=default
virtual const std::string & getDestPointer() const
Definition: IAggregator.h:84
void operator=(IAggregator const &x)=delete
std::vector< std::unique_ptr< IValueProvider > > duplicateParameters() const
Definition: IAggregator.h:154
IAggregator(const std::string &toPointer, std::vector< std::unique_ptr< IValueProvider >> &¶ms)
Definition: IAggregator.h:34
std::string toPointer
Definition: IAggregator.h:120
void checkParamSize(unsigned int expected)
Definition: IAggregator.h:126
void checkOptionalParamType(unsigned int i, IValueType expected)
Definition: IAggregator.h:145
virtual std::vector< std::string > getAttributes() const
Definition: IAggregator.h:95
virtual std::unique_ptr< IAggregator > duplicate() const =0
virtual void merge(IAggregator *other)=0
virtual void accumulate(const RapidJsonDocument &json, RJMemoryPoolAlloc &alloc)=0
virtual RJValue terminate(RJMemoryPoolAlloc &alloc)=0
virtual std::string toString() const
Definition: IAggregator.h:117
virtual const std::string getName() const =0
std::string getParameterStringRepresentation() const
Definition: IAggregator.h:103
static void replaceConstSubexpressions(std::unique_ptr< IValueProvider > &val)
Definition: IValueProvider.cpp:11
Definition: IValueProvider.h:96
Definition: IValueProvider.h:60
Definition: AttributeStatAggregator.h:12
JODA_AGGREGATOR_QUEUE AggregatorQueue
Definition: IAggregator.h:177
IValueType
Definition: IValueProvider.h:33
Definition: IAggregator.h:164
static std::unique_ptr< queue_t > getQueue()
Definition: IAggregator.h:168
static std::unique_ptr< queue_t > getQueue(size_t minCapacity, size_t maxProducers)
Definition: IAggregator.h:171
std::unique_ptr< IAggregator > payload_t
Definition: IAggregator.h:165
JODA_SHARED_QUEUE< payload_t > queue_t
Definition: IAggregator.h:166