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

#include <ValToPredicate.h>

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

Public Member Functions

 ValToPredicate (std::unique_ptr< IValueProvider > &&val)
 
 ValToPredicate (bool b)
 
bool check (const RapidJsonDocument &val) override
 
bool isCompatible (Predicate *other) override
 
std::string getType () override
 
void accept (class PredicateVisitor &v) override
 
std::unique_ptr< ValToPredicateduplicate () const
 
std::unique_ptr< IValueProviderduplicateIVal () const
 
std::string toString () const
 
bool isConstTrue () const
 
bool isConstFalse () const
 
void getAttributes (std::vector< std::string > &vec) const
 
- Public Member Functions inherited from joda::query::Predicate
virtual ~Predicate ()=default
 

Static Public Attributes

static const std::string type = "ValToPredicate"
 
- Static Public Attributes inherited from joda::query::Predicate
static const std::string type = "Predicate"
 

Protected Attributes

std::unique_ptr< IValueProviderval
 

Detailed Description

Predicate converting a IValueProvider value into a boolean value. If the value is boolean, the result is used directly Else, false is returned

Constructor & Destructor Documentation

◆ ValToPredicate() [1/2]

joda::query::ValToPredicate::ValToPredicate ( std::unique_ptr< IValueProvider > &&  val)
explicit
Here is the call graph for this function:

◆ ValToPredicate() [2/2]

joda::query::ValToPredicate::ValToPredicate ( bool  b)
explicit

Member Function Documentation

◆ accept()

void joda::query::ValToPredicate::accept ( class PredicateVisitor v)
overridevirtual

Uses the given PredicateVisitor to traverse the predicate tree with the visitor pattern.

Parameters
vthe visitor to use.

Implements joda::query::Predicate.

Here is the call graph for this function:

◆ check()

bool joda::query::ValToPredicate::check ( const RapidJsonDocument val)
overridevirtual

Checks if a given document fulfills the given predicate

Parameters
valthe document to check
Returns
true if the document fulfills the predicate, else false.

Implements joda::query::Predicate.

◆ duplicate()

std::unique_ptr< joda::query::ValToPredicate > joda::query::ValToPredicate::duplicate ( ) const
Here is the caller graph for this function:

◆ duplicateIVal()

std::unique_ptr< joda::query::IValueProvider > joda::query::ValToPredicate::duplicateIVal ( ) const
Here is the caller graph for this function:

◆ getAttributes()

void joda::query::ValToPredicate::getAttributes ( std::vector< std::string > &  vec) const

Fills the given vector with attributes used in the IValueProvider

Parameters
vecthe vector to fill
Here is the caller graph for this function:

◆ getType()

std::string joda::query::ValToPredicate::getType ( )
overridevirtual

Returns the classname of the predicate.

Returns

Reimplemented from joda::query::Predicate.

◆ isCompatible()

bool joda::query::ValToPredicate::isCompatible ( Predicate other)
overridevirtual

Checks if two predicates are semantically equivalent

Returns
true if they are equivalent, false if not

Reimplemented from joda::query::Predicate.

Here is the call graph for this function:

◆ isConstFalse()

bool joda::query::ValToPredicate::isConstFalse ( ) const

Checks if the value evaluates to a constant false value

Returns
true if yes, false else

◆ isConstTrue()

bool joda::query::ValToPredicate::isConstTrue ( ) const

Checks if the value evaluates to a constant true value

Returns
true if yes, false else
Here is the caller graph for this function:

◆ toString()

std::string joda::query::ValToPredicate::toString ( ) const
Here is the caller graph for this function:

Field Documentation

◆ type

const std::string joda::query::ValToPredicate::type = "ValToPredicate"
static

◆ val

std::unique_ptr<IValueProvider> joda::query::ValToPredicate::val
protected

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