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

#include <ComparePredicate.h>

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

Public Member Functions

 ComparePredicate (std::unique_ptr< IValueProvider > &&lhs, std::unique_ptr< IValueProvider > &&rhs, bool greater=true, bool include=true)
 
bool check (const RapidJsonDocument &val) override
 
bool isCompatible (Predicate *other) override
 
std::string getType () override
 
void accept (class PredicateVisitor &v) override
 
std::string toString ()
 
std::vector< std::string > getAttributes () const
 
std::unique_ptr< Predicateduplicate () const
 
bool isGreater () const
 
bool isInclude () const
 
std::unique_ptr< IValueProvider > & getLhs ()
 
std::unique_ptr< IValueProvider > & getRhs ()
 
- Public Member Functions inherited from joda::query::Predicate
virtual ~Predicate ()=default
 

Protected Attributes

std::unique_ptr< IValueProviderlhs
 
std::unique_ptr< IValueProviderrhs
 
bool greater = true
 
bool include = true
 

Additional Inherited Members

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

Detailed Description

Compares two values for larger/smaller (equals) relations

Constructor & Destructor Documentation

◆ ComparePredicate()

joda::query::ComparePredicate::ComparePredicate ( std::unique_ptr< IValueProvider > &&  lhs,
std::unique_ptr< IValueProvider > &&  rhs,
bool  greater = true,
bool  include = true 
)

Member Function Documentation

◆ accept()

void joda::query::ComparePredicate::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::ComparePredicate::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.

Here is the caller graph for this function:

◆ duplicate()

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

◆ getAttributes()

std::vector< std::string > joda::query::ComparePredicate::getAttributes ( ) const

◆ getLhs()

std::unique_ptr< joda::query::IValueProvider > & joda::query::ComparePredicate::getLhs ( )
Here is the caller graph for this function:

◆ getRhs()

std::unique_ptr< joda::query::IValueProvider > & joda::query::ComparePredicate::getRhs ( )
Here is the caller graph for this function:

◆ getType()

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

Returns the classname of the predicate.

Returns

Reimplemented from joda::query::Predicate.

◆ isCompatible()

bool joda::query::ComparePredicate::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:

◆ isGreater()

bool joda::query::ComparePredicate::isGreater ( ) const
Here is the caller graph for this function:

◆ isInclude()

bool joda::query::ComparePredicate::isInclude ( ) const
Here is the caller graph for this function:

◆ toString()

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

Field Documentation

◆ greater

bool joda::query::ComparePredicate::greater = true
protected

◆ include

bool joda::query::ComparePredicate::include = true
protected

◆ lhs

std::unique_ptr<IValueProvider> joda::query::ComparePredicate::lhs
protected

◆ rhs

std::unique_ptr<IValueProvider> joda::query::ComparePredicate::rhs
protected

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