Fawkes API Fawkes Development Version
|
PDDLPredicate representation for JSON transfer. More...
#include <PDDLPredicate.h>
Public Member Functions | |
PDDLPredicate () | |
Constructor. More... | |
PDDLPredicate (const std::string &json) | |
Constructor from JSON. More... | |
PDDLPredicate (const rapidjson::Value &v) | |
Constructor from JSON. More... | |
virtual | ~PDDLPredicate () |
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 > | id () const |
Get id value. More... | |
void | set_id (const std::string &id) |
Set id value. More... | |
std::optional< std::string > | part_of () const |
Get part-of value. More... | |
void | set_part_of (const std::string &part_of) |
Set part-of value. More... | |
std::optional< std::string > | predicate () const |
Get predicate value. More... | |
void | set_predicate (const std::string &predicate) |
Set predicate 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_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... | |
Static Public Member Functions | |
static std::string | api_version () |
Get version of implemented API. More... | |
PDDLPredicate representation for JSON transfer.
Definition at line 27 of file PDDLPredicate.h.
PDDLPredicate::PDDLPredicate | ( | ) |
Constructor.
Definition at line 24 of file PDDLPredicate.cpp.
PDDLPredicate::PDDLPredicate | ( | const std::string & | json | ) |
Constructor from JSON.
json | JSON string to initialize from |
Definition at line 28 of file PDDLPredicate.cpp.
References from_json().
PDDLPredicate::PDDLPredicate | ( | const rapidjson::Value & | v | ) |
Constructor from JSON.
v | RapidJSON value object to initialize from. |
Definition at line 33 of file PDDLPredicate.cpp.
References from_json_value().
|
virtual |
Destructor.
Definition at line 38 of file PDDLPredicate.cpp.
|
inline |
Add element to param-constants array.
param_constants | new value |
Definition at line 229 of file PDDLPredicate.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 239 of file PDDLPredicate.h.
References param_constants().
|
inline |
Add element to param-names array.
param_names | new value |
Definition at line 194 of file PDDLPredicate.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 204 of file PDDLPredicate.h.
References param_names().
|
inlinestatic |
Get version of implemented API.
Definition at line 48 of file PDDLPredicate.h.
|
inline |
Get apiVersion value.
Definition at line 109 of file PDDLPredicate.h.
Referenced by set_apiVersion().
|
virtual |
Retrieve data from JSON string.
json | JSON representation suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 113 of file PDDLPredicate.cpp.
References from_json_value().
Referenced by PDDLPredicate().
|
virtual |
Retrieve data from JSON string.
v | RapidJSON value suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 122 of file PDDLPredicate.cpp.
Referenced by from_json(), and PDDLPredicate().
|
inline |
Get id value.
Definition at line 126 of file PDDLPredicate.h.
Referenced by set_id().
|
inline |
Get kind value.
Definition at line 92 of file PDDLPredicate.h.
Referenced by set_kind().
|
inline |
Get param-constants value.
Definition at line 212 of file PDDLPredicate.h.
Referenced by addto_param_constants(), and set_param_constants().
|
inline |
Get param-names value.
Definition at line 177 of file PDDLPredicate.h.
Referenced by addto_param_names(), and set_param_names().
|
inline |
Get part-of value.
Definition at line 143 of file PDDLPredicate.h.
Referenced by set_part_of().
|
inline |
Get predicate value.
Definition at line 160 of file PDDLPredicate.h.
Referenced by set_predicate().
|
inline |
Set apiVersion value.
apiVersion | new value |
Definition at line 118 of file PDDLPredicate.h.
References apiVersion().
|
inline |
Set id value.
id | new value |
Definition at line 135 of file PDDLPredicate.h.
References id().
|
inline |
Set kind value.
kind | new value |
Definition at line 101 of file PDDLPredicate.h.
References kind().
|
inline |
Set param-constants value.
param_constants | new value |
Definition at line 221 of file PDDLPredicate.h.
References param_constants().
|
inline |
Set param-names value.
param_names | new value |
Definition at line 186 of file PDDLPredicate.h.
References param_names().
|
inline |
Set part-of value.
part_of | new value |
Definition at line 152 of file PDDLPredicate.h.
References part_of().
|
inline |
Set predicate value.
predicate | new value |
Definition at line 169 of file PDDLPredicate.h.
References predicate().
|
virtual |
Render object to JSON.
pretty | true to enable pretty printing (readable spacing) |
Definition at line 43 of file PDDLPredicate.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 PDDLPredicate.cpp.
Referenced by to_json().
|
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 160 of file PDDLPredicate.cpp.