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

#include <Query.h>

Collaboration diagram for joda::query::Query:
[legend]

Public Member Functions

 Query ()
 
bool check (const RapidJsonDocument &json) const
 
const std::string & getLoad () const
 
void setLoad (const std::string &load)
 
const std::string & getDelete () const
 
void setDelete (const std::string &del)
 
void setPredicate (std::unique_ptr< Predicate > &&predicate)
 
std::unique_ptr< PredicategetPredicate () const
 
void addProjection (std::unique_ptr< IProjector > &&expr)
 
const std::vector< std::unique_ptr< IProjector > > & getProjectors () const
 
void addProjection (std::unique_ptr< ISetProjector > &&expr)
 
const std::vector< std::unique_ptr< ISetProjector > > & getSetProjectors () const
 
void addAggregator (std::unique_ptr< IAggregator > &&agg)
 
bool hasAggregators ()
 
const std::vector< std::unique_ptr< IAggregator > > & getAggregators () const
 
const std::vector< std::unique_ptr< docparsing::IImportSource > > & getImportSources () const
 
void addImportSource (std::unique_ptr< docparsing::IImportSource > &&source)
 
const std::shared_ptr< JoinManager > & getLoadJoinManager () const
 
void setLoadJoinManager (const std::shared_ptr< JoinManager > &loadJoinManager)
 
const std::shared_ptr< JoinManager > & getStoreJoinManager () const
 
void setStoreJoinManager (const std::shared_ptr< JoinManager > &storeJoinManager)
 
std::unique_ptr< IExportDestination > & getExportDestination ()
 
void setExportDestination (std::unique_ptr< IExportDestination > &&exportDestination)
 
bool isDefault () const
 
bool chooseIsConst (bool &val) const
 
bool canCreateView () const
 
std::string toString () const
 
std::vector< std::string > getAllUsedAttributes () const
 
std::vector< std::string > getChooseAttributes () const
 
std::vector< std::string > getASAttributes () const
 
std::vector< std::string > getAGGAttributes () const
 

Protected Attributes

std::vector< std::unique_ptr< docparsing::IImportSource > > importSources {}
 
std::string load {}
 
std::shared_ptr< JoinManagerloadJoinManager = nullptr
 
std::unique_ptr< Predicatepred = nullptr
 
std::vector< std::unique_ptr< IProjector > > projectors {}
 
std::vector< std::unique_ptr< ISetProjector > > setProjectors {}
 
std::vector< std::unique_ptr< IAggregator > > aggregators {}
 
std::unique_ptr< IExportDestinationexportDestination
 
std::shared_ptr< JoinManagerstoreJoinManager = nullptr
 
std::string store
 
std::string del
 

Detailed Description

This class represents the parsed representation of a JODA Query.

It contains all information required to execute a user query.

Constructor & Destructor Documentation

◆ Query()

joda::query::Query::Query ( )

The default constructor constructs an empty default query.

Member Function Documentation

◆ addAggregator()

void joda::query::Query::addAggregator ( std::unique_ptr< IAggregator > &&  agg)

Adds a Aggregator to the query

Parameters
aggThe aggregator to add

◆ addImportSource()

void joda::query::Query::addImportSource ( std::unique_ptr< docparsing::IImportSource > &&  source)

◆ addProjection() [1/2]

void joda::query::Query::addProjection ( std::unique_ptr< IProjector > &&  expr)

Adds a Projection expression to the query

Parameters
exprThe projection to add

◆ addProjection() [2/2]

void joda::query::Query::addProjection ( std::unique_ptr< ISetProjector > &&  expr)

Adds a SetProjection expression to the query

Parameters
exprThe setprojection to add

◆ canCreateView()

bool joda::query::Query::canCreateView ( ) const

Checks whether the AS transformations can be evaluated with views.

Returns

◆ check()

bool joda::query::Query::check ( const RapidJsonDocument json) const

This function checks if the given document fulfils the CHOOSE predicate of the query.

Parameters
docThe document to check
Returns
True if the document fulfils the predicate, else False
Here is the caller graph for this function:

◆ chooseIsConst()

bool joda::query::Query::chooseIsConst ( bool &  val) const

Checks whether the CHOOSE predicate can be evaluated without documents. If yes, the result of the predicate is written to val.

Parameters
valA variable which will contain the result of the const predicate.
Returns
True if the predicate is const, else False
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAGGAttributes()

std::vector< std::string > joda::query::Query::getAGGAttributes ( ) const

◆ getAggregators()

const std::vector< std::unique_ptr< joda::query::IAggregator > > & joda::query::Query::getAggregators ( ) const
Returns
The list of aggregators, default: []

◆ getAllUsedAttributes()

std::vector< std::string > joda::query::Query::getAllUsedAttributes ( ) const
Here is the call graph for this function:

◆ getASAttributes()

std::vector< std::string > joda::query::Query::getASAttributes ( ) const

◆ getChooseAttributes()

std::vector< std::string > joda::query::Query::getChooseAttributes ( ) const
Here is the call graph for this function:

◆ getDelete()

const std::string & joda::query::Query::getDelete ( ) const
Returns
the name of the collection which should be deleted after the query, or "" if none

◆ getExportDestination()

std::unique_ptr< IExportDestination > & joda::query::Query::getExportDestination ( )

◆ getImportSources()

const std::vector< std::unique_ptr< joda::docparsing::IImportSource > > & joda::query::Query::getImportSources ( ) const

◆ getLoad()

const std::string & joda::query::Query::getLoad ( ) const
Returns
the name of the collection on which this query is based.

◆ getLoadJoinManager()

const std::shared_ptr< JoinManager > & joda::query::Query::getLoadJoinManager ( ) const

◆ getPredicate()

std::unique_ptr< joda::query::Predicate > joda::query::Query::getPredicate ( ) const
Returns
a copy of the CHOOSE expression predicate, default: ValToPredicate(TrueValue)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getProjectors()

const std::vector< std::unique_ptr< joda::query::IProjector > > & joda::query::Query::getProjectors ( ) const
Returns
the list of projections

◆ getSetProjectors()

const std::vector< std::unique_ptr< joda::query::ISetProjector > > & joda::query::Query::getSetProjectors ( ) const
Returns
the list of setProjections

◆ getStoreJoinManager()

const std::shared_ptr< JoinManager > & joda::query::Query::getStoreJoinManager ( ) const

◆ hasAggregators()

bool joda::query::Query::hasAggregators ( )
Returns
True if the query contains an aggregation, else False

◆ isDefault()

bool joda::query::Query::isDefault ( ) const
Returns
True if this query is a NOOP query (does nothing except for displaying a collection), else False

◆ setDelete()

void joda::query::Query::setDelete ( const std::string &  del)
Parameters
delthe name of the collection which should be deleted after the query, or "" if none

◆ setExportDestination()

void joda::query::Query::setExportDestination ( std::unique_ptr< IExportDestination > &&  exportDestination)

◆ setLoad()

void joda::query::Query::setLoad ( const std::string &  load)
Parameters
loadthe name of the collection on which this query is based.

◆ setLoadJoinManager()

void joda::query::Query::setLoadJoinManager ( const std::shared_ptr< JoinManager > &  loadJoinManager)

◆ setPredicate()

void joda::query::Query::setPredicate ( std::unique_ptr< Predicate > &&  predicate)
Parameters
predicatethe predicate of the CHOOSE expression

◆ setStoreJoinManager()

void joda::query::Query::setStoreJoinManager ( const std::shared_ptr< JoinManager > &  storeJoinManager)

◆ toString()

std::string joda::query::Query::toString ( ) const
Returns
the string representation of the query.
Here is the call graph for this function:

Field Documentation

◆ aggregators

std::vector<std::unique_ptr<IAggregator> > joda::query::Query::aggregators {}
protected

◆ del

std::string joda::query::Query::del
protected

◆ exportDestination

std::unique_ptr<IExportDestination> joda::query::Query::exportDestination
protected

◆ importSources

std::vector<std::unique_ptr<docparsing::IImportSource> > joda::query::Query::importSources {}
protected

◆ load

std::string joda::query::Query::load {}
protected

◆ loadJoinManager

std::shared_ptr<JoinManager> joda::query::Query::loadJoinManager = nullptr
protected

◆ pred

std::unique_ptr<Predicate> joda::query::Query::pred = nullptr
protected

◆ projectors

std::vector<std::unique_ptr<IProjector> > joda::query::Query::projectors {}
protected

◆ setProjectors

std::vector<std::unique_ptr<ISetProjector> > joda::query::Query::setProjectors {}
protected

◆ store

std::string joda::query::Query::store
protected

◆ storeJoinManager

std::shared_ptr<JoinManager> joda::query::Query::storeJoinManager = nullptr
protected

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