JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Public Member Functions | Protected Member Functions
joda::query::UnaryNumberProvider< Calc > Class Template Reference

#include <UnaryNumberProvider.h>

Inheritance diagram for joda::query::UnaryNumberProvider< Calc >:
[legend]
Collaboration diagram for joda::query::UnaryNumberProvider< Calc >:
[legend]

Public Member Functions

 UnaryNumberProvider (std::vector< std::unique_ptr< IValueProvider >> &&parameters)
 
joda::query::IValueType getReturnType () const override
 
std::string getName () const override
 
std::string toString () const override
 
std::unique_ptr< joda::query::IValueProviderduplicate () const override
 
bool isConst () const override
 
RJValue getAtomValue (const RapidJsonDocument &json, RJMemoryPoolAlloc &alloc) const override
 
const RJValuegetValue (const RapidJsonDocument &json, RJMemoryPoolAlloc &alloc) const override
 
- Public Member Functions inherited from joda::query::IValueProvider
 IValueProvider (std::vector< std::unique_ptr< IValueProvider >> &&parameters)
 
 IValueProvider ()
 
virtual ~IValueProvider ()=default
 
virtual bool isString () const
 
virtual bool isNumber () const
 
virtual bool isBool () const
 
virtual bool isObject () const
 
virtual bool isArray () const
 
virtual bool isNull () const
 
virtual bool isAny () const
 
virtual bool isAtom () const
 
virtual std::vector< std::string > getAttributes () const
 
virtual void getAttributes (std::vector< std::string > &vec) const
 
bool equal (IValueProvider *other, const RapidJsonDocument &json) const
 
virtual bool comparable () const
 
virtual bool equalizable () const
 

Protected Member Functions

void checkAllParamTypes ()
 
- Protected Member Functions inherited from joda::query::IValueProvider
bool getParamString (std::string &ret, const std::unique_ptr< IValueProvider > &val, const RapidJsonDocument &json) const
 
void checkParamSize (unsigned int expected)
 
void checkMinParamSize (unsigned int expected)
 
void checkParamType (unsigned int i, IValueType expected)
 
void checkOptionalParamType (unsigned int i, IValueType expected)
 
std::vector< std::unique_ptr< IValueProvider > > duplicateParameters () const
 
std::string getParameterStringRepresentation () const
 

Additional Inherited Members

- Static Public Member Functions inherited from joda::query::IValueProvider
static void replaceConstSubexpressions (std::unique_ptr< IValueProvider > &val)
 
static bool constBoolCheck (std::unique_ptr< IValueProvider > &val)
 
- Protected Attributes inherited from joda::query::IValueProvider
std::vector< std::unique_ptr< IValueProvider > > params
 

Detailed Description

template<class Calc>
class joda::query::UnaryNumberProvider< Calc >

Template class used for all unary mathamatical functions. The template argument has to be a struct with the following attributes/functions.

struct <StructName> {
static constexpr auto name = "<Name>";
static constexpr IValueType retType = <IValueType returntype>;
inline static RJValue calculate(double val, RJMemoryPoolAlloc &alloc) {
return <result>; }; inline static RJValue calculate(u_int64_t val,
RJMemoryPoolAlloc &alloc) { return <result>; }; inline static RJValue
calculate(int64_t val, RJMemoryPoolAlloc &alloc) { return <result>; };
};
rapidjson::MemoryPoolAllocator< RJBaseAlloc > RJMemoryPoolAlloc
Definition: RJFwd.h:26
rapidjson::GenericValue< RJChar, RJMemoryPoolAlloc > RJValue
Definition: RJFwd.h:29
IValueType
Definition: IValueProvider.h:33

Constructor & Destructor Documentation

◆ UnaryNumberProvider()

template<class Calc >
joda::query::UnaryNumberProvider< Calc >::UnaryNumberProvider ( std::vector< std::unique_ptr< IValueProvider >> &&  parameters)
inlineexplicit
Here is the call graph for this function:

Member Function Documentation

◆ checkAllParamTypes()

template<class Calc >
void joda::query::UnaryNumberProvider< Calc >::checkAllParamTypes ( )
inlineprotected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ duplicate()

template<class Calc >
std::unique_ptr<joda::query::IValueProvider> joda::query::UnaryNumberProvider< Calc >::duplicate ( ) const
inlineoverridevirtual
Returns
a pointer to a duplicate of the IValueProvider

Implements joda::query::IValueProvider.

Here is the call graph for this function:

◆ getAtomValue()

template<class Calc >
RJValue joda::query::UnaryNumberProvider< Calc >::getAtomValue ( const RapidJsonDocument json,
RJMemoryPoolAlloc alloc 
) const
inlineoverridevirtual

Gets an atomic value

Attention
isAtom() has to return true. If not this will result in undefined behavior
Parameters
jsonThe Rapidjsondocument to retrieve values from. (Or an empty RapidJsonDocument for const values)
allocA MemoryPoolAllocator to create the values with
Returns
a value containing the result

Implements joda::query::IValueProvider.

Here is the call graph for this function:

◆ getName()

template<class Calc >
std::string joda::query::UnaryNumberProvider< Calc >::getName ( ) const
inlineoverridevirtual
Returns
The function name

Implements joda::query::IValueProvider.

◆ getReturnType()

template<class Calc >
joda::query::IValueType joda::query::UnaryNumberProvider< Calc >::getReturnType ( ) const
inlineoverridevirtual
Returns
The type returned by the function

Implements joda::query::IValueProvider.

◆ getValue()

template<class Calc >
const RJValue* joda::query::UnaryNumberProvider< Calc >::getValue ( const RapidJsonDocument json,
RJMemoryPoolAlloc alloc 
) const
inlineoverridevirtual

Gets an value

Attention
isAtom() has to return false. If not this will result in undefined behavior
Parameters
jsonThe Rapidjsondocument to retrieve values from. (Or an empty RapidJsonDocument for const values)
allocA MemoryPoolAllocator to create the values with
Returns
a value-pointer containing the result

Implements joda::query::IValueProvider.

Here is the call graph for this function:

◆ isConst()

template<class Calc >
bool joda::query::UnaryNumberProvider< Calc >::isConst ( ) const
inlineoverridevirtual
Returns
True if the Provider is const, false else

Implements joda::query::IValueProvider.

◆ toString()

template<class Calc >
std::string joda::query::UnaryNumberProvider< Calc >::toString ( ) const
inlineoverridevirtual
Returns
A textual representation of the IValueProvider

Reimplemented from joda::query::IValueProvider.

Here is the call graph for this function:

The documentation for this class was generated from the following file: