JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
joda::query::IValueProvider Class Referenceabstract

#include <IValueProvider.h>

Inheritance diagram for joda::query::IValueProvider:
[legend]
Collaboration diagram for joda::query::IValueProvider:
[legend]

Public Member Functions

 IValueProvider (std::vector< std::unique_ptr< IValueProvider >> &&parameters)
 
 IValueProvider ()
 
virtual ~IValueProvider ()=default
 
virtual RJValue getAtomValue (const RapidJsonDocument &json, RJMemoryPoolAlloc &alloc) const =0
 
virtual RJValue const * getValue (const RapidJsonDocument &json, RJMemoryPoolAlloc &alloc) const =0
 
virtual std::unique_ptr< IValueProviderduplicate () const =0
 
virtual std::string toString () const
 
virtual std::string getName () const =0
 
virtual bool isConst () const =0
 
virtual IValueType getReturnType () const =0
 
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
 

Static Public Member Functions

static void replaceConstSubexpressions (std::unique_ptr< IValueProvider > &val)
 
static bool constBoolCheck (std::unique_ptr< IValueProvider > &val)
 

Protected Member Functions

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
 

Protected Attributes

std::vector< std::unique_ptr< IValueProvider > > params
 

Detailed Description

IValueProviders provide values to functions. They may be constant values or functions themselves

Constructor & Destructor Documentation

◆ IValueProvider() [1/2]

joda::query::IValueProvider::IValueProvider ( std::vector< std::unique_ptr< IValueProvider >> &&  parameters)
explicit

Creates a new IValueProvider with given parameters

Exceptions
WrongParameterExceptionif the parameters do not fit the expected (wrong count or type)
Parameters
parametersA vector of IValueProviders

◆ IValueProvider() [2/2]

joda::query::IValueProvider::IValueProvider ( )

Creates a new IValueProvider without parameters

Exceptions
WrongParameterExceptionIf parameters where expected

◆ ~IValueProvider()

virtual joda::query::IValueProvider::~IValueProvider ( )
virtualdefault

Member Function Documentation

◆ checkMinParamSize()

void joda::query::IValueProvider::checkMinParamSize ( unsigned int  expected)
protected

Checks wether the number of parameters is aat least expected

Parameters
expectedThe expected number of parameters
Exceptions
WrongParameterCountExceptionif number is less than expected

◆ checkOptionalParamType()

void joda::query::IValueProvider::checkOptionalParamType ( unsigned int  i,
IValueType  expected 
)
protected

Checks wether the parameter i is of type expected if it exists

Parameters
iThe index of the parameter to check
expectedThe expected type of the parameter
Exceptions
WrongParameterTypeExceptionif type not as expected

◆ checkParamSize()

void joda::query::IValueProvider::checkParamSize ( unsigned int  expected)
protected

Checks wether the number of parameters is exactly expected

Parameters
expectedThe expected number of parameters
Exceptions
WrongParameterCountExceptionif number not as expected
Here is the caller graph for this function:

◆ checkParamType()

void joda::query::IValueProvider::checkParamType ( unsigned int  i,
IValueType  expected 
)
protected

Checks wether the parameter i is of type expected

Parameters
iThe index of the parameter to check
expectedThe expected type of the parameter
Exceptions
WrongParameterTypeExceptionif type not as expected
Here is the caller graph for this function:

◆ comparable()

virtual bool joda::query::IValueProvider::comparable ( ) const
inlinevirtual
Returns
True if comparable by >=, >, <=, <. False otherwise

Reimplemented in joda::query::PointerProvider.

Here is the call graph for this function:

◆ constBoolCheck()

bool joda::query::IValueProvider::constBoolCheck ( std::unique_ptr< IValueProvider > &  val)
static
Here is the caller graph for this function:

◆ duplicate()

virtual std::unique_ptr<IValueProvider> joda::query::IValueProvider::duplicate ( ) const
pure virtual

◆ duplicateParameters()

std::vector< std::unique_ptr< joda::query::IValueProvider > > joda::query::IValueProvider::duplicateParameters ( ) const
protected
Here is the caller graph for this function:

◆ equal()

bool joda::query::IValueProvider::equal ( IValueProvider other,
const RapidJsonDocument json 
) const
inline

Checks if two IValueProviders values are equal

Parameters
otherother IValueProvider to compare with
jsonThe RapidJsonDocument to (potentially) retrieve values from
Returns
True if the values are equal, false otherwise
Here is the call graph for this function:

◆ equalizable()

virtual bool joda::query::IValueProvider::equalizable ( ) const
inlinevirtual
Returns
True if comparable by ==, !=. False otherwise

Reimplemented in joda::query::PointerProvider.

Here is the call graph for this function:

◆ getAtomValue()

virtual RJValue joda::query::IValueProvider::getAtomValue ( const RapidJsonDocument json,
RJMemoryPoolAlloc alloc 
) const
pure virtual

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

Implemented in joda::query::UnaryStringProvider< Calc >, joda::query::UnaryPointerAcceptProvider< Calc >, joda::query::UnaryNumberProvider< Calc >, joda::query::TypeProvider, joda::query::TemplateProvider< Calc >, joda::query::SubStringProvider, joda::query::SeqNumberProvider, joda::query::RegexReplaceProvider, joda::query::RegexProvider, joda::query::RegexExtractProvider, joda::query::PointerProvider, joda::query::NullProvider, joda::query::IsXBoolProvider< T >, joda::query::INListProvider, joda::query::IDProvider, joda::query::FilePosProvider< start >, joda::query::FileNameProvider, joda::query::BinaryStringProvider< Calc >, joda::query::BinaryNumberProvider< Calc >, joda::query::AtomProvider< T >, joda::query::AtomProvider< Calc::AtomType >, joda::query::ArraySizeProvider, joda::query::IsXBoolProvider< T >, joda::query::IsXBoolProvider< T >, joda::query::IsXBoolProvider< T >, joda::query::IsXBoolProvider< T >, joda::query::IsXBoolProvider< T >, joda::query::IsXBoolProvider< T >, joda::query::IsXBoolProvider< T >, joda::query::AtomProvider< T >, joda::query::AtomProvider< Calc::AtomType >, DummyNull, DummyArray, DummyObject, joda::query::AtomProvider< T >, joda::query::AtomProvider< Calc::AtomType >, joda::query::AtomProvider< T >, joda::query::AtomProvider< Calc::AtomType >, joda::query::AtomProvider< T >, joda::query::AtomProvider< Calc::AtomType >, joda::query::AtomProvider< T >, and joda::query::AtomProvider< Calc::AtomType >.

Here is the caller graph for this function:

◆ getAttributes() [1/2]

virtual std::vector<std::string> joda::query::IValueProvider::getAttributes ( ) const
inlinevirtual

Gets a list of all used document attributes

Returns
List of used document attributes

Reimplemented in joda::query::PointerProvider.

Here is the caller graph for this function:

◆ getAttributes() [2/2]

virtual void joda::query::IValueProvider::getAttributes ( std::vector< std::string > &  vec) const
inlinevirtual

Fills a list with all used document attributes

Parameters
veclist to fill

Reimplemented in joda::query::UnaryPointerAcceptProvider< Calc >, and joda::query::PointerProvider.

◆ getName()

virtual std::string joda::query::IValueProvider::getName ( ) const
pure virtual

◆ getParameterStringRepresentation()

std::string joda::query::IValueProvider::getParameterStringRepresentation ( ) const
protected

◆ getParamString()

bool joda::query::IValueProvider::getParamString ( std::string &  ret,
const std::unique_ptr< IValueProvider > &  val,
const RapidJsonDocument json 
) const
inlineprotected
Here is the caller graph for this function:

◆ getReturnType()

virtual IValueType joda::query::IValueProvider::getReturnType ( ) const
pure virtual

◆ getValue()

virtual RJValue const* joda::query::IValueProvider::getValue ( const RapidJsonDocument json,
RJMemoryPoolAlloc alloc 
) const
pure virtual

◆ isAny()

virtual bool joda::query::IValueProvider::isAny ( ) const
inlinevirtual

Reimplemented in joda::query::PointerProvider.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isArray()

virtual bool joda::query::IValueProvider::isArray ( ) const
inlinevirtual

Reimplemented in joda::query::PointerProvider.

Here is the call graph for this function:

◆ isAtom()

virtual bool joda::query::IValueProvider::isAtom ( ) const
inlinevirtual

Reimplemented in joda::query::UnaryPointerAcceptProvider< Calc >, joda::query::TemplateProvider< Calc >, joda::query::SubStringProvider, joda::query::RegexExtractProvider, and joda::query::NullProvider.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isBool()

virtual bool joda::query::IValueProvider::isBool ( ) const
inlinevirtual

Reimplemented in joda::query::PointerProvider.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isConst()

virtual bool joda::query::IValueProvider::isConst ( ) const
pure virtual

◆ isNull()

virtual bool joda::query::IValueProvider::isNull ( ) const
inlinevirtual
Here is the call graph for this function:

◆ isNumber()

virtual bool joda::query::IValueProvider::isNumber ( ) const
inlinevirtual

Reimplemented in joda::query::PointerProvider.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isObject()

virtual bool joda::query::IValueProvider::isObject ( ) const
inlinevirtual

Reimplemented in joda::query::PointerProvider.

Here is the call graph for this function:

◆ isString()

virtual bool joda::query::IValueProvider::isString ( ) const
inlinevirtual

Reimplemented in joda::query::PointerProvider.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ replaceConstSubexpressions()

void joda::query::IValueProvider::replaceConstSubexpressions ( std::unique_ptr< IValueProvider > &  val)
static
Here is the caller graph for this function:

◆ toString()

std::string joda::query::IValueProvider::toString ( ) const
virtual

Field Documentation

◆ params

std::vector<std::unique_ptr<IValueProvider> > joda::query::IValueProvider::params
protected

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