1 #ifndef JODA_TEMPLATEPROVIDER_H
2 #define JODA_TEMPLATEPROVIDER_H
22 static constexpr
auto name =
"PLACEHOLDER";
29 const std::vector<std::unique_ptr<IValueProvider>> ¶meters){
34 const std::vector<std::unique_ptr<IValueProvider>> ¶meters,
47 std::vector<std::unique_ptr<IValueProvider>> &¶meters)
49 Calc::P0::check(
params, Calc::name);
50 Calc::P1::check(
params, Calc::name);
51 Calc::P2::check(
params, Calc::name);
52 Calc::P3::check(
params, Calc::name);
53 Calc::P4::check(
params, Calc::name);
61 std::string
getName()
const override {
return Calc::name; };
65 std::unique_ptr<IValueProvider>
duplicate()
const override {
71 for (
const auto ¶m :
params) {
72 c &= param->isConst();
88 DCHECK(!
isAtom()) <<
"Did not check for atom first";
92 bool isAtom()
const override {
return true; };
#define CREATE_FACTORY(FCLASS)
Definition: IValueProvider.h:20
rapidjson::MemoryPoolAllocator< RJBaseAlloc > RJMemoryPoolAlloc
Definition: RJFwd.h:26
rapidjson::GenericValue< RJChar, RJMemoryPoolAlloc > RJValue
Definition: RJFwd.h:29
Definition: RapidJsonDocument.h:22
Definition: IValueProvider.h:143
std::vector< std::unique_ptr< IValueProvider > > params
Definition: IValueProvider.h:373
std::vector< std::unique_ptr< IValueProvider > > duplicateParameters() const
Definition: IValueProvider.cpp:104
virtual std::string toString() const
Definition: IValueProvider.cpp:99
Definition: TemplateProvider.h:44
Calc::State state
Definition: TemplateProvider.h:92
std::unique_ptr< IValueProvider > duplicate() const override
Definition: TemplateProvider.h:65
TemplateProvider(std::vector< std::unique_ptr< IValueProvider >> &¶meters)
Definition: TemplateProvider.h:46
std::string getName() const override
Definition: TemplateProvider.h:61
std::string toString() const override
Definition: TemplateProvider.h:63
joda::query::IValueType getReturnType() const override
Definition: TemplateProvider.h:57
const RJValue * getValue(const RapidJsonDocument &json, RJMemoryPoolAlloc &alloc) const override
Definition: TemplateProvider.h:86
bool isAtom() const override
Definition: TemplateProvider.h:92
RJValue getAtomValue(const RapidJsonDocument &json, RJMemoryPoolAlloc &alloc) const override
Definition: TemplateProvider.h:77
bool isConst() const override
Definition: TemplateProvider.h:69
Definition: ParameterPack.h:8
Definition: AttributeStatAggregator.h:12
IValueType
Definition: IValueProvider.h:33
@ IV_Null
Definition: IValueProvider.h:40
Definition: TemplateProvider.h:11
values::NoParameter< 4 > P4
Definition: TemplateProvider.h:17
static void checkParameters(const std::vector< std::unique_ptr< IValueProvider >> ¶meters)
Definition: TemplateProvider.h:28
values::NoParameter< 2 > P2
Definition: TemplateProvider.h:15
values::NoParameter< 0 > P0
Definition: TemplateProvider.h:13
values::NoParameter< 1 > P1
Definition: TemplateProvider.h:14
values::NoParameter< 3 > P3
Definition: TemplateProvider.h:16
static constexpr IValueType retType
Definition: TemplateProvider.h:20
static RJValue calculate(const std::vector< std::unique_ptr< IValueProvider >> ¶meters, const RapidJsonDocument &json, RJMemoryPoolAlloc &alloc)
Definition: TemplateProvider.h:33
static constexpr auto name
Definition: TemplateProvider.h:22
Definition: ParameterPack.h:18