Fawkes API
Fawkes Development Version
|
DomainPrecondition representation for JSON transfer. More...
#include <DomainPrecondition.h>
Public Member Functions | |
DomainPrecondition () | |
Constructor. More... | |
DomainPrecondition (const std::string &json) | |
Constructor from JSON. More... | |
DomainPrecondition (const rapidjson::Value &v) | |
Constructor from JSON. More... | |
virtual | ~DomainPrecondition () |
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 > | grounded () const |
Get grounded value. More... | |
void | set_grounded (const bool &grounded) |
Set grounded 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... | |
Static Public Member Functions | |
static std::string | api_version () |
Get version of implemented API. More... | |
DomainPrecondition representation for JSON transfer.
Definition at line 25 of file DomainPrecondition.h.
DomainPrecondition::DomainPrecondition | ( | ) |
Constructor.
Definition at line 22 of file DomainPrecondition.cpp.
Referenced by DomainPreconditionCompound::from_json_value().
DomainPrecondition::DomainPrecondition | ( | const std::string & | json | ) |
Constructor from JSON.
json | JSON string to initialize from |
Definition at line 26 of file DomainPrecondition.cpp.
References from_json().
DomainPrecondition::DomainPrecondition | ( | const rapidjson::Value & | v | ) |
Constructor from JSON.
v | RapidJSON value object to initialize from. |
Definition at line 31 of file DomainPrecondition.cpp.
References from_json_value().
|
virtual |
Destructor.
Definition at line 36 of file DomainPrecondition.cpp.
|
inlinestatic |
Get version of implemented API.
Definition at line 47 of file DomainPrecondition.h.
|
inline |
Get apiVersion value.
Definition at line 108 of file DomainPrecondition.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. |
Reimplemented in DomainPreconditionAtom, and DomainPreconditionCompound.
Definition at line 100 of file DomainPrecondition.cpp.
References from_json_value().
Referenced by DomainPrecondition().
|
virtual |
Retrieve data from JSON string.
v | RapidJSON value suitable for this object. Will allow partial assignment and not validate automaticaly. |
Reimplemented in DomainPreconditionAtom, and DomainPreconditionCompound.
Definition at line 109 of file DomainPrecondition.cpp.
Referenced by DomainPrecondition(), from_json(), DomainPreconditionCompound::from_json_value(), DomainPreconditionAtom::from_json_value(), and PlanAction::from_json_value().
|
inline |
Get grounded value.
Definition at line 159 of file DomainPrecondition.h.
Referenced by set_grounded().
|
inline |
Get is-satisfied value.
Definition at line 176 of file DomainPrecondition.h.
Referenced by set_is_satisfied().
|
inline |
Get kind value.
Definition at line 91 of file DomainPrecondition.h.
Referenced by set_kind().
|
inline |
Get name value.
Definition at line 125 of file DomainPrecondition.h.
Referenced by set_name().
|
inline |
Set apiVersion value.
apiVersion | new value |
Definition at line 117 of file DomainPrecondition.h.
References apiVersion().
|
inline |
Set grounded value.
grounded | new value |
Definition at line 168 of file DomainPrecondition.h.
References grounded().
|
inline |
Set is-satisfied value.
is_satisfied | new value |
Definition at line 185 of file DomainPrecondition.h.
References is_satisfied().
|
inline |
Set kind value.
kind | new value |
Definition at line 100 of file DomainPrecondition.h.
References kind().
|
inline |
Set name value.
name | new value |
Definition at line 134 of file DomainPrecondition.h.
References name().
|
inline |
Set type value.
type | new value |
Definition at line 151 of file DomainPrecondition.h.
References type().
|
virtual |
Render object to JSON.
pretty | true to enable pretty printing (readable spacing) |
Reimplemented in DomainPreconditionAtom, and DomainPreconditionCompound.
Definition at line 41 of file DomainPrecondition.cpp.
References to_json_value().
|
virtual |
Render object to JSON.
d | RapidJSON document to retrieve allocator from |
v | RapidJSON value to add data to |
Reimplemented in DomainPreconditionAtom, and DomainPreconditionCompound.
Definition at line 60 of file DomainPrecondition.cpp.
Referenced by to_json(), DomainPreconditionCompound::to_json_value(), and DomainPreconditionAtom::to_json_value().
|
inline |
Get type value.
Definition at line 142 of file DomainPrecondition.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 |
Reimplemented in DomainPreconditionAtom, and DomainPreconditionCompound.
Definition at line 132 of file DomainPrecondition.cpp.
Referenced by DomainPreconditionAtom::validate(), and DomainPreconditionCompound::validate().