knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::FormulaQuery Class Reference

#include <FormulaQuery.h>

Inheritance diagram for knowrob::FormulaQuery:
Collaboration diagram for knowrob::FormulaQuery:

Public Member Functions

 FormulaQuery (FormulaPtr formula, const QueryContextPtr &ctx)
 
const FormulaPtrformula () const
 
void write (std::ostream &os) const override
 
 FormulaQuery (FormulaPtr formula, const QueryContextPtr &ctx)
 
const FormulaPtrformula () const
 
void write (std::ostream &os) const override
 
- Public Member Functions inherited from knowrob::Query
 Query (QueryContextPtr ctx=DefaultQueryContext())
 
virtual ~Query ()=default
 
auto & ctx () const
 
void setContext (QueryContextPtr ctx)
 
 Query (QueryContextPtr ctx=DefaultQueryContext())
 
virtual ~Query ()=default
 
auto & ctx () const
 
void setContext (QueryContextPtr ctx)
 
- Public Member Functions inherited from knowrob::Printable
virtual ~Printable ()=default
 
virtual std::string format () const
 
virtual ~Printable ()=default
 
virtual std::string format () const
 

Protected Attributes

const std::shared_ptr< Formulaformula_
 
- Protected Attributes inherited from knowrob::Query
QueryContextPtr ctx_
 

Detailed Description

A query represented by a logical formula.

Definition at line 16 of file FormulaQuery.h.

Constructor & Destructor Documentation

◆ FormulaQuery() [1/2]

knowrob::FormulaQuery::FormulaQuery ( FormulaPtr  formula,
const QueryContextPtr ctx 
)
inline
Parameters
formulathe formula to query.
ctxthe query context.

Definition at line 22 of file FormulaQuery.h.

22 : Query(ctx), formula_(std::move(formula)) {}
const FormulaPtr & formula() const
Definition: FormulaQuery.h:25
const std::shared_ptr< Formula > formula_
Definition: FormulaQuery.h:31
auto & ctx() const
Definition: Query.h:41
Query(QueryContextPtr ctx=DefaultQueryContext())
Definition: Query.h:34

◆ FormulaQuery() [2/2]

knowrob::FormulaQuery::FormulaQuery ( FormulaPtr  formula,
const QueryContextPtr ctx 
)
inline
Parameters
formulathe formula to query.
ctxthe query context.

Definition at line 22 of file FormulaQuery.h.

22 : Query(ctx), formula_(std::move(formula)) {}

Member Function Documentation

◆ formula() [1/2]

const FormulaPtr& knowrob::FormulaQuery::formula ( ) const
inline

Definition at line 25 of file FormulaQuery.h.

25 { return formula_; }

◆ formula() [2/2]

const FormulaPtr& knowrob::FormulaQuery::formula ( ) const
inline

Definition at line 25 of file FormulaQuery.h.

25 { return formula_; }

◆ write() [1/2]

void knowrob::FormulaQuery::write ( std::ostream &  os) const
inlineoverridevirtual

Print this object to a stream.

Parameters
osthe stream to print to.

Implements knowrob::Printable.

Definition at line 28 of file FormulaQuery.h.

28 { os << *formula_; }

◆ write() [2/2]

void knowrob::FormulaQuery::write ( std::ostream &  os) const
inlineoverridevirtual

Print this object to a stream.

Parameters
osthe stream to print to.

Implements knowrob::Printable.

Definition at line 28 of file FormulaQuery.h.

28 { os << *formula_; }

Member Data Documentation

◆ formula_

const std::shared_ptr< Formula > knowrob::FormulaQuery::formula_
protected

Definition at line 31 of file FormulaQuery.h.


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