knowrob
2.1.0
A Knowledge Base System for Cognition-enabled Robots
|
#include <GraphBuiltin.h>
Public Types | |
using | BuiltinPtr = std::shared_ptr< GraphBuiltin > |
using | BuiltinPtr = std::shared_ptr< GraphBuiltin > |
Public Member Functions | |
GraphBuiltin (GraphBuiltinType builtinType, const AtomPtr &functor, const std::vector< TermPtr > &arguments, VariablePtr bindVar=nullptr) | |
auto | builtinType () const |
auto | bindVar () const |
bool | apply (const std::shared_ptr< Bindings > &bindings) const |
bool | isOptional () const |
void | setOptional (bool isOptional) |
void | write (std::ostream &os) const override |
GraphBuiltin (GraphBuiltinType builtinType, const AtomPtr &functor, const std::vector< TermPtr > &arguments, VariablePtr bindVar=nullptr) | |
auto | builtinType () const |
auto | bindVar () const |
bool | apply (const std::shared_ptr< Bindings > &bindings) const |
bool | isOptional () const |
void | setOptional (bool isOptional) |
void | write (std::ostream &os) const override |
Public Member Functions inherited from knowrob::GraphTerm | |
virtual | ~GraphTerm ()=default |
bool | isPattern () const |
bool | isBuiltin () const |
auto | termType () const |
virtual | ~GraphTerm ()=default |
bool | isPattern () const |
bool | isBuiltin () const |
auto | termType () const |
Public Member Functions inherited from knowrob::Printable | |
virtual | ~Printable ()=default |
virtual std::string | format () const |
virtual | ~Printable ()=default |
virtual std::string | format () const |
Public Member Functions inherited from knowrob::Function | |
Function (AtomPtr functor, const std::vector< TermPtr > &arguments) | |
Function (std::string_view functor, const std::vector< TermPtr > &arguments) | |
bool | isSameFunction (const Function &other) const |
auto & | functor () const |
auto & | arguments () const |
auto | arity () const |
size_t | hashOfFunction () const |
const std::set< std::string_view > & | variables () const override |
Function (AtomPtr functor, const std::vector< TermPtr > &arguments) | |
Function (std::string_view functor, const std::vector< TermPtr > &arguments) | |
bool | isSameFunction (const Function &other) const |
auto & | functor () const |
auto & | arguments () const |
auto | arity () const |
size_t | hashOfFunction () const |
const std::set< std::string_view > & | variables () const override |
void | write (std::ostream &os) const override |
Public Member Functions inherited from knowrob::Term | |
Term (TermType termType) | |
~Term () override=default | |
bool | operator== (const Term &other) const |
bool | operator!= (const Term &other) const |
TermType | termType () const |
bool | isGround () const |
bool | isAtomic () const |
bool | isAtom () const |
bool | isVariable () const |
bool | isFunction () const |
bool | isNumeric () const |
bool | isString () const |
bool | isIRI () const |
bool | isBlank () const |
size_t | hash () const |
Term (TermType termType) | |
~Term () override=default | |
bool | operator== (const Term &other) const |
bool | operator!= (const Term &other) const |
TermType | termType () const |
bool | isGround () const |
bool | isAtomic () const |
bool | isAtom () const |
bool | isVariable () const |
bool | isFunction () const |
bool | isNumeric () const |
bool | isString () const |
bool | isIRI () const |
bool | isBlank () const |
size_t | hash () const |
Static Public Member Functions | |
static BuiltinPtr | bind (const VariablePtr &var, const TermPtr &val) |
static BuiltinPtr | min (const VariablePtr &var, const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | max (const VariablePtr &var, const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | less (const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | lessOrEqual (const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | greater (const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | greaterOrEqual (const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | equal (const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | notEqual (const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | bind (const VariablePtr &var, const TermPtr &val) |
static BuiltinPtr | min (const VariablePtr &var, const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | max (const VariablePtr &var, const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | less (const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | lessOrEqual (const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | greater (const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | greaterOrEqual (const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | equal (const TermPtr &a, const TermPtr &b) |
static BuiltinPtr | notEqual (const TermPtr &a, const TermPtr &b) |
Protected Attributes | |
GraphBuiltinType | builtinType_ |
VariablePtr | bindVar_ |
bool | isOptional_ |
Protected Attributes inherited from knowrob::GraphTerm | |
GraphTermType | termType_ |
Protected Attributes inherited from knowrob::Function | |
const std::shared_ptr< Atom > | functor_ |
const std::vector< TermPtr > | arguments_ |
const std::set< std::string_view > | variables_ |
Protected Attributes inherited from knowrob::Term | |
const TermType | termType_ |
bool | isBlank_ = false |
bool | isIRI_ = false |
Additional Inherited Members | |
Protected Member Functions inherited from knowrob::GraphTerm | |
GraphTerm (GraphTermType termType) | |
GraphTerm (GraphTermType termType) | |
Protected Member Functions inherited from knowrob::Function | |
std::set< std::string_view > | getVariables1 () const |
std::set< std::string_view > | getVariables1 () const |
Static Protected Attributes inherited from knowrob::Term | |
static const std::set< std::string_view > | noVariables_ = {} |
A builtin term that is part of a graph query.
Definition at line 84 of file GraphBuiltin.h.
using knowrob::GraphBuiltin::BuiltinPtr = std::shared_ptr<GraphBuiltin> |
Definition at line 86 of file GraphBuiltin.h.
using knowrob::GraphBuiltin::BuiltinPtr = std::shared_ptr<GraphBuiltin> |
Definition at line 86 of file GraphBuiltin.h.
|
inline |
Constructs a builtin term from a builtin type, a functor, a list of arguments, and an optional variable to bind.
builtinType | the builtin type. |
functor | the functor. |
arguments | the arguments. |
bindVar | the variable to bind or null if no binding is used by the builtin. |
Definition at line 95 of file GraphBuiltin.h.
|
inline |
Constructs a builtin term from a builtin type, a functor, a list of arguments, and an optional variable to bind.
builtinType | the builtin type. |
functor | the functor. |
arguments | the arguments. |
bindVar | the variable to bind or null if no binding is used by the builtin. |
Definition at line 95 of file GraphBuiltin.h.
bool GraphBuiltin::apply | ( | const std::shared_ptr< Bindings > & | bindings | ) | const |
Apply the builtin to the given bindings.
bindings | the bindings to apply the builtin to. |
Definition at line 30 of file GraphBuiltin.cpp.
bool knowrob::GraphBuiltin::apply | ( | const std::shared_ptr< Bindings > & | bindings | ) | const |
Apply the builtin to the given bindings.
bindings | the bindings to apply the builtin to. |
|
inlinestatic |
Bind a value to a variable in the query pipeline.
var | the variable to bind. |
val | the value to bind to the variable. |
Definition at line 127 of file GraphBuiltin.h.
|
inlinestatic |
Bind a value to a variable in the query pipeline.
var | the variable to bind. |
val | the value to bind to the variable. |
Definition at line 127 of file GraphBuiltin.h.
|
inline |
Definition at line 113 of file GraphBuiltin.h.
|
inline |
Definition at line 113 of file GraphBuiltin.h.
|
inline |
|
inline |
|
inlinestatic |
Create a new Builtin that checks if the first term is equal to the second term.
a | the first term. |
b | the second term. |
Definition at line 223 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that checks if the first term is equal to the second term.
a | the first term. |
b | the second term. |
Definition at line 223 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that checks if the first term is greater than the second term.
a | the first term. |
b | the second term. |
Definition at line 197 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that checks if the first term is greater than the second term.
a | the first term. |
b | the second term. |
Definition at line 197 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that checks if the first term is greater than or equal to the second term.
a | the first term. |
b | the second term. |
Definition at line 210 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that checks if the first term is greater than or equal to the second term.
a | the first term. |
b | the second term. |
Definition at line 210 of file GraphBuiltin.h.
|
inline |
Definition at line 246 of file GraphBuiltin.h.
|
inline |
Definition at line 246 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that checks if the first term is less than the second term.
a | the first term. |
b | the second term. |
Definition at line 171 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that checks if the first term is less than the second term.
a | the first term. |
b | the second term. |
Definition at line 171 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that checks if the first term is less than or equal to the second term.
a | the first term. |
b | the second term. |
Definition at line 184 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that checks if the first term is less than or equal to the second term.
a | the first term. |
b | the second term. |
Definition at line 184 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that calculates the maximum of two terms.
var | the variable to bind the result to. |
a | the first term. |
b | the second term. |
Definition at line 157 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that calculates the maximum of two terms.
var | the variable to bind the result to. |
a | the first term. |
b | the second term. |
Definition at line 157 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that calculates the minimum of two terms.
var | the variable to bind the result to. |
a | the first term. |
b | the second term. |
Definition at line 142 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that calculates the minimum of two terms.
var | the variable to bind the result to. |
a | the first term. |
b | the second term. |
Definition at line 142 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that checks if the first term is not equal to the second term.
a | the first term. |
b | the second term. |
Definition at line 236 of file GraphBuiltin.h.
|
inlinestatic |
Create a new Builtin that checks if the first term is not equal to the second term.
a | the first term. |
b | the second term. |
Definition at line 236 of file GraphBuiltin.h.
|
inline |
Set the optional flag of the builtin.
isOptional | the optional flag. |
Definition at line 252 of file GraphBuiltin.h.
|
inline |
Set the optional flag of the builtin.
isOptional | the optional flag. |
Definition at line 252 of file GraphBuiltin.h.
|
inlineoverridevirtual |
Print this object to a stream.
os | the stream to print to. |
Implements knowrob::GraphTerm.
Definition at line 255 of file GraphBuiltin.h.
|
inlineoverridevirtual |
Print this object to a stream.
os | the stream to print to. |
Implements knowrob::GraphTerm.
Definition at line 255 of file GraphBuiltin.h.
|
protected |
Definition at line 259 of file GraphBuiltin.h.
|
protected |
Definition at line 258 of file GraphBuiltin.h.
|
protected |
Definition at line 260 of file GraphBuiltin.h.