Fawkes API Fawkes Development Version
|
GroundedFormula representation for JSON transfer. More...
#include <GroundedFormula.h>
Public Member Functions | |
GroundedFormula () | |
Constructor. More... | |
GroundedFormula (const std::string &json) | |
Constructor from JSON. More... | |
GroundedFormula (const rapidjson::Value &v) | |
Constructor from JSON. More... | |
virtual | ~GroundedFormula () |
Destructor. More... | |
virtual std::string | to_json (bool pretty=false) const |
Render object to JSON. More... | |
virtual void | to_json_value (rapidjson::Document &d, rapidjson::Value &v) const |
Render object to JSON. More... | |
virtual void | from_json (const std::string &json) |
Retrieve data from JSON string. More... | |
virtual void | from_json_value (const rapidjson::Value &v) |
Retrieve data from JSON string. More... | |
virtual void | validate (bool subcall=false) const |
Validate if all required fields have been set. More... | |
std::optional< std::string > | kind () const |
Get kind value. More... | |
void | set_kind (const std::string &kind) |
Set kind value. More... | |
std::optional< std::string > | apiVersion () const |
Get apiVersion value. More... | |
void | set_apiVersion (const std::string &apiVersion) |
Set apiVersion value. More... | |
std::optional< std::string > | name () const |
Get name value. More... | |
void | set_name (const std::string &name) |
Set name value. More... | |
std::optional< std::string > | type () const |
Get type value. More... | |
void | set_type (const std::string &type) |
Set type value. More... | |
std::optional< bool > | is_satisfied () const |
Get is-satisfied value. More... | |
void | set_is_satisfied (const bool &is_satisfied) |
Set is-satisfied value. More... | |
std::vector< std::string > | param_names () const |
Get param-names value. More... | |
void | set_param_names (const std::vector< std::string > ¶m_names) |
Set param-names value. More... | |
void | addto_param_names (const std::string &¶m_names) |
Add element to param-names array. More... | |
void | addto_param_names (const std::string ¶m_names) |
Add element to param-names array. More... | |
std::vector< std::string > | param_values () const |
Get param-values value. More... | |
void | set_param_values (const std::vector< std::string > ¶m_values) |
Set param-values value. More... | |
void | addto_param_values (const std::string &¶m_values) |
Add element to param-values array. More... | |
void | addto_param_values (const std::string ¶m_values) |
Add element to param-values array. More... | |
std::vector< std::string > | param_constants () const |
Get param-constants value. More... | |
void | set_param_constants (const std::vector< std::string > ¶m_constants) |
Set param-constants value. More... | |
void | addto_param_constants (const std::string &¶m_constants) |
Add element to param-constants array. More... | |
void | addto_param_constants (const std::string ¶m_constants) |
Add element to param-constants array. More... | |
std::vector< std::shared_ptr< GroundedFormula > > | child () const |
Get child value. More... | |
void | set_child (const std::vector< std::shared_ptr< GroundedFormula > > &child) |
Set child value. More... | |
void | addto_child (const std::shared_ptr< GroundedFormula > &&child) |
Add element to child array. More... | |
void | addto_child (const std::shared_ptr< GroundedFormula > &child) |
Add element to child array. More... | |
void | addto_child (const GroundedFormula &&child) |
Add element to child array. More... | |
Static Public Member Functions | |
static std::string | api_version () |
Get version of implemented API. More... | |
GroundedFormula representation for JSON transfer.
Definition at line 28 of file GroundedFormula.h.
GroundedFormula::GroundedFormula | ( | ) |
GroundedFormula::GroundedFormula | ( | const std::string & | json | ) |
Constructor from JSON.
json | JSON string to initialize from |
Definition at line 28 of file GroundedFormula.cpp.
References from_json().
GroundedFormula::GroundedFormula | ( | const rapidjson::Value & | v | ) |
Constructor from JSON.
v | RapidJSON value object to initialize from. |
Definition at line 33 of file GroundedFormula.cpp.
References from_json_value().
|
virtual |
Destructor.
Definition at line 38 of file GroundedFormula.cpp.
|
inline |
Add element to child array.
child | new value |
Definition at line 318 of file GroundedFormula.h.
References child().
|
inline |
Add element to child array.
child | new value |
Definition at line 300 of file GroundedFormula.h.
References child().
|
inline |
Add element to child array.
The move-semantics version (std::move) should be preferred.
child | new value |
Definition at line 310 of file GroundedFormula.h.
References child().
|
inline |
Add element to param-constants array.
param_constants | new value |
Definition at line 265 of file GroundedFormula.h.
References param_constants().
|
inline |
Add element to param-constants array.
The move-semantics version (std::move) should be preferred.
param_constants | new value |
Definition at line 275 of file GroundedFormula.h.
References param_constants().
|
inline |
Add element to param-names array.
param_names | new value |
Definition at line 195 of file GroundedFormula.h.
References param_names().
|
inline |
Add element to param-names array.
The move-semantics version (std::move) should be preferred.
param_names | new value |
Definition at line 205 of file GroundedFormula.h.
References param_names().
|
inline |
Add element to param-values array.
param_values | new value |
Definition at line 230 of file GroundedFormula.h.
References param_values().
|
inline |
Add element to param-values array.
The move-semantics version (std::move) should be preferred.
param_values | new value |
Definition at line 240 of file GroundedFormula.h.
References param_values().
|
inlinestatic |
Get version of implemented API.
Definition at line 49 of file GroundedFormula.h.
|
inline |
Get apiVersion value.
Definition at line 110 of file GroundedFormula.h.
Referenced by set_apiVersion().
|
inline |
Get child value.
Definition at line 283 of file GroundedFormula.h.
Referenced by addto_child(), and set_child().
|
virtual |
Retrieve data from JSON string.
json | JSON representation suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 129 of file GroundedFormula.cpp.
References from_json_value().
Referenced by GroundedFormula().
|
virtual |
Retrieve data from JSON string.
v | RapidJSON value suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 138 of file GroundedFormula.cpp.
References GroundedFormula().
Referenced by from_json(), and GroundedFormula().
|
inline |
Get is-satisfied value.
Definition at line 161 of file GroundedFormula.h.
Referenced by set_is_satisfied().
|
inline |
Get kind value.
Definition at line 93 of file GroundedFormula.h.
Referenced by set_kind().
|
inline |
Get name value.
Definition at line 127 of file GroundedFormula.h.
Referenced by set_name().
|
inline |
Get param-constants value.
Definition at line 248 of file GroundedFormula.h.
Referenced by addto_param_constants(), and set_param_constants().
|
inline |
Get param-names value.
Definition at line 178 of file GroundedFormula.h.
Referenced by addto_param_names(), and set_param_names().
|
inline |
Get param-values value.
Definition at line 213 of file GroundedFormula.h.
Referenced by addto_param_values(), and set_param_values().
|
inline |
Set apiVersion value.
apiVersion | new value |
Definition at line 119 of file GroundedFormula.h.
References apiVersion().
|
inline |
Set child value.
child | new value |
Definition at line 292 of file GroundedFormula.h.
References child().
|
inline |
Set is-satisfied value.
is_satisfied | new value |
Definition at line 170 of file GroundedFormula.h.
References is_satisfied().
|
inline |
Set kind value.
kind | new value |
Definition at line 102 of file GroundedFormula.h.
References kind().
|
inline |
Set name value.
name | new value |
Definition at line 136 of file GroundedFormula.h.
References name().
|
inline |
Set param-constants value.
param_constants | new value |
Definition at line 257 of file GroundedFormula.h.
References param_constants().
|
inline |
Set param-names value.
param_names | new value |
Definition at line 187 of file GroundedFormula.h.
References param_names().
|
inline |
Set param-values value.
param_values | new value |
Definition at line 222 of file GroundedFormula.h.
References param_values().
|
inline |
Set type value.
type | new value |
Definition at line 153 of file GroundedFormula.h.
References type().
|
virtual |
Render object to JSON.
pretty | true to enable pretty printing (readable spacing) |
Definition at line 43 of file GroundedFormula.cpp.
References to_json_value().
|
virtual |
Render object to JSON.
d | RapidJSON document to retrieve allocator from |
v | RapidJSON value to add data to |
Definition at line 62 of file GroundedFormula.cpp.
Referenced by to_json().
|
inline |
Get type value.
Definition at line 144 of file GroundedFormula.h.
Referenced by set_type().
|
virtual |
Validate if all required fields have been set.
subcall | true if this is called from another class, e.g., a sub-class or array holder. Will modify the kind of exception thrown. |
std::vector<std::string> | thrown if required information is missing and subcall is set to true. Contains a list of missing fields. |
std::runtime_error | informative message describing the missing fields |
Definition at line 196 of file GroundedFormula.cpp.