6 #ifndef JODA_MEMBERCOUNTPROVIDER_H
7 #define JODA_MEMBERCOUNTPROVIDER_H
14 if (!firstObject)
return false;
18 constexpr
bool Bool(
bool b) {
19 if (!firstObject)
return false;
23 constexpr
bool Int(
int i) {
24 if (!firstObject)
return false;
28 constexpr
bool Uint(
unsigned i) {
29 if (!firstObject)
return false;
33 constexpr
bool Int64(int64_t i) {
34 if (!firstObject)
return false;
39 if (!firstObject)
return false;
44 if (!firstObject)
return false;
48 constexpr
bool RawNumber(
const Ch *str, rapidjson::SizeType length,
50 if (!firstObject)
return false;
54 constexpr
bool String(
const Ch *str, rapidjson::SizeType length,
bool copy) {
55 if (!firstObject)
return false;
60 if (stack == 0) firstObject =
true;
65 bool Key(
const Ch *str, rapidjson::SizeType length,
bool copy) {
66 if (stack == 1) count++;
76 if (!firstObject)
return false;
81 constexpr
bool EndArray(rapidjson::SizeType elementCount) {
97 bool firstObject =
false;
105 static constexpr
auto name =
"MEMCOUNT";
110 auto res = accepter.
Accept(json, alloc, handler);
116 if (ptr ==
nullptr || !ptr->IsObject())
return RJValue();
117 return RJValue(ptr->MemberCount());
121 if (vo ==
nullptr)
return RJValue();
rapidjson::MemoryPoolAllocator< RJBaseAlloc > RJMemoryPoolAlloc
Definition: RJFwd.h:26
rapidjson::GenericValue< RJChar, RJMemoryPoolAlloc > RJValue
Definition: RJFwd.h:29
Definition: RapidJsonDocument.h:22
Definition: VirtualObject.h:13
size_t size() const
Definition: VirtualObject.cpp:7
Definition: UnaryPointerAcceptProvider.h:25
Definition: ValueAccepter.h:16
bool Accept(const RapidJsonDocument &json, RJMemoryPoolAlloc &alloc, Handler &h) const
Definition: ValueAccepter.h:32
Definition: MemberCountProvider.h:100
static RJValue virtualObject(const VirtualObject *vo)
Definition: MemberCountProvider.h:120
static constexpr bool acceptAll
Definition: MemberCountProvider.h:104
static constexpr auto name
Definition: MemberCountProvider.h:105
static constexpr IValueType inType
Definition: MemberCountProvider.h:103
static constexpr IValueType retType
Definition: MemberCountProvider.h:102
static RJValue accept(const RapidJsonDocument &json, RJMemoryPoolAlloc &alloc, const ValueAccepter &accepter)
Definition: MemberCountProvider.h:107
static RJValue pointer(const RJValue *ptr)
Definition: MemberCountProvider.h:115
Definition: MemberCountProvider.h:9
constexpr bool String(const Ch *str, rapidjson::SizeType length, bool copy)
Definition: MemberCountProvider.h:54
constexpr bool Double(double d)
Definition: MemberCountProvider.h:43
bool EndObject(rapidjson::SizeType memberCount)
Definition: MemberCountProvider.h:70
constexpr bool RawNumber(const Ch *str, rapidjson::SizeType length, bool copy)
Definition: MemberCountProvider.h:48
size_t getCount() const
Definition: MemberCountProvider.h:86
bool Key(const Ch *str, rapidjson::SizeType length, bool copy)
Definition: MemberCountProvider.h:65
constexpr bool StartArray()
Definition: MemberCountProvider.h:75
constexpr bool Null()
Definition: MemberCountProvider.h:13
constexpr bool Uint64(uint64_t i)
Definition: MemberCountProvider.h:38
constexpr bool EndArray(rapidjson::SizeType elementCount)
Definition: MemberCountProvider.h:81
constexpr bool Int(int i)
Definition: MemberCountProvider.h:23
void reset()
Definition: MemberCountProvider.h:88
constexpr bool Bool(bool b)
Definition: MemberCountProvider.h:18
constexpr bool Uint(unsigned i)
Definition: MemberCountProvider.h:28
constexpr bool Int64(int64_t i)
Definition: MemberCountProvider.h:33
char Ch
Definition: MemberCountProvider.h:11
bool StartObject()
Definition: MemberCountProvider.h:59
Definition: MemberCountProvider.h:8
Definition: AttributeStatAggregator.h:12
UnaryPointerAcceptProvider< joda::query::providers::membercount::MemberCountCalculator > MemberCountProvider
Definition: MemberCountProvider.h:133
IValueType
Definition: IValueProvider.h:33
@ IV_Object
Definition: IValueProvider.h:37
@ IV_Number
Definition: IValueProvider.h:35