Fawkes API
Fawkes Development Version
|
PlanAction representation for JSON transfer. More...
#include <PlanAction.h>
Public Member Functions | |
PlanAction () | |
Constructor. More... | |
PlanAction (const std::string &json) | |
Constructor from JSON. More... | |
PlanAction (const rapidjson::Value &v) | |
Constructor from JSON. More... | |
virtual | ~PlanAction () |
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< int64_t > | id () const |
Get id value. More... | |
void | set_id (const int64_t &id) |
Set id value. More... | |
std::optional< std::string > | operator_name () const |
Get operator-name value. More... | |
void | set_operator_name (const std::string &operator_name) |
Set operator-name value. 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::optional< float > | duration () const |
Get duration value. More... | |
void | set_duration (const float &duration) |
Set duration value. More... | |
std::optional< float > | dispatch_time () const |
Get dispatch-time value. More... | |
void | set_dispatch_time (const float &dispatch_time) |
Set dispatch-time value. More... | |
std::optional< std::string > | state () const |
Get state value. More... | |
void | set_state (const std::string &state) |
Set state value. More... | |
std::optional< bool > | executable () const |
Get executable value. More... | |
void | set_executable (const bool &executable) |
Set executable value. More... | |
std::shared_ptr< DomainOperator > | _operator () const |
Get operator value. More... | |
void | set__operator (const std::shared_ptr< DomainOperator > &_operator) |
Set operator value. More... | |
std::vector< std::shared_ptr< DomainPrecondition > > | preconditions () const |
Get preconditions value. More... | |
void | set_preconditions (const std::vector< std::shared_ptr< DomainPrecondition >> &preconditions) |
Set preconditions value. More... | |
void | addto_preconditions (const std::shared_ptr< DomainPrecondition > &&preconditions) |
Add element to preconditions array. More... | |
void | addto_preconditions (const std::shared_ptr< DomainPrecondition > &preconditions) |
Add element to preconditions array. More... | |
void | addto_preconditions (const DomainPrecondition &&preconditions) |
Add element to preconditions array. More... | |
std::vector< std::shared_ptr< DomainEffect > > | effects () const |
Get effects value. More... | |
void | set_effects (const std::vector< std::shared_ptr< DomainEffect >> &effects) |
Set effects value. More... | |
void | addto_effects (const std::shared_ptr< DomainEffect > &&effects) |
Add element to effects array. More... | |
void | addto_effects (const std::shared_ptr< DomainEffect > &effects) |
Add element to effects array. More... | |
void | addto_effects (const DomainEffect &&effects) |
Add element to effects array. More... | |
Static Public Member Functions | |
static std::string | api_version () |
Get version of implemented API. More... | |
PlanAction representation for JSON transfer.
Definition at line 30 of file PlanAction.h.
PlanAction::PlanAction | ( | ) |
Constructor.
Definition at line 23 of file PlanAction.cpp.
PlanAction::PlanAction | ( | const std::string & | json | ) |
Constructor from JSON.
json | JSON string to initialize from |
Definition at line 27 of file PlanAction.cpp.
References from_json().
PlanAction::PlanAction | ( | const rapidjson::Value & | v | ) |
Constructor from JSON.
v | RapidJSON value object to initialize from. |
Definition at line 32 of file PlanAction.cpp.
References from_json_value().
|
virtual |
Destructor.
Definition at line 37 of file PlanAction.cpp.
|
inline |
Get operator value.
Definition at line 267 of file PlanAction.h.
Referenced by set__operator().
|
inline |
Add element to effects array.
effects | new value |
Definition at line 362 of file PlanAction.h.
References effects().
|
inline |
Add element to effects array.
effects | new value |
Definition at line 344 of file PlanAction.h.
References effects().
|
inline |
Add element to effects array.
The move-semantics version (std::move) should be preferred.
effects | new value |
Definition at line 354 of file PlanAction.h.
References effects().
|
inline |
Add element to param-values array.
param_values | new value |
Definition at line 181 of file PlanAction.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 191 of file PlanAction.h.
References param_values().
|
inline |
Add element to preconditions array.
preconditions | new value |
Definition at line 319 of file PlanAction.h.
References preconditions().
|
inline |
Add element to preconditions array.
preconditions | new value |
Definition at line 301 of file PlanAction.h.
References preconditions().
|
inline |
Add element to preconditions array.
The move-semantics version (std::move) should be preferred.
preconditions | new value |
Definition at line 311 of file PlanAction.h.
References preconditions().
|
inlinestatic |
Get version of implemented API.
Definition at line 52 of file PlanAction.h.
|
inline |
Get apiVersion value.
Definition at line 113 of file PlanAction.h.
Referenced by set_apiVersion().
|
inline |
Get dispatch-time value.
Definition at line 216 of file PlanAction.h.
Referenced by set_dispatch_time().
|
inline |
Get duration value.
Definition at line 199 of file PlanAction.h.
Referenced by set_duration().
|
inline |
Get effects value.
Definition at line 327 of file PlanAction.h.
Referenced by addto_effects(), and set_effects().
|
inline |
Get executable value.
Definition at line 250 of file PlanAction.h.
Referenced by set_executable().
|
virtual |
Retrieve data from JSON string.
json | JSON representation suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 140 of file PlanAction.cpp.
References from_json_value().
Referenced by PlanAction().
|
virtual |
Retrieve data from JSON string.
v | RapidJSON value suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 149 of file PlanAction.cpp.
References DomainPrecondition::from_json_value(), and DomainEffect::from_json_value().
Referenced by from_json(), Plan::from_json_value(), and PlanAction().
|
inline |
|
inline |
Get kind value.
Definition at line 96 of file PlanAction.h.
Referenced by set_kind().
|
inline |
Get operator-name value.
Definition at line 147 of file PlanAction.h.
Referenced by set_operator_name().
|
inline |
Get param-values value.
Definition at line 164 of file PlanAction.h.
Referenced by addto_param_values(), and set_param_values().
|
inline |
Get preconditions value.
Definition at line 284 of file PlanAction.h.
Referenced by addto_preconditions(), and set_preconditions().
|
inline |
Set operator value.
_operator | new value |
Definition at line 276 of file PlanAction.h.
References _operator().
|
inline |
Set apiVersion value.
apiVersion | new value |
Definition at line 122 of file PlanAction.h.
References apiVersion().
|
inline |
Set dispatch-time value.
dispatch_time | new value |
Definition at line 225 of file PlanAction.h.
References dispatch_time().
|
inline |
Set duration value.
duration | new value |
Definition at line 208 of file PlanAction.h.
References duration().
|
inline |
Set effects value.
effects | new value |
Definition at line 336 of file PlanAction.h.
References effects().
|
inline |
Set executable value.
executable | new value |
Definition at line 259 of file PlanAction.h.
References executable().
|
inline |
|
inline |
Set kind value.
kind | new value |
Definition at line 105 of file PlanAction.h.
References kind().
|
inline |
Set operator-name value.
operator_name | new value |
Definition at line 156 of file PlanAction.h.
References operator_name().
|
inline |
Set param-values value.
param_values | new value |
Definition at line 173 of file PlanAction.h.
References param_values().
|
inline |
Set preconditions value.
preconditions | new value |
Definition at line 293 of file PlanAction.h.
References preconditions().
|
inline |
Set state value.
state | new value |
Definition at line 242 of file PlanAction.h.
References state().
|
inline |
Get state value.
Definition at line 233 of file PlanAction.h.
Referenced by set_state().
|
virtual |
Render object to JSON.
pretty | true to enable pretty printing (readable spacing) |
Definition at line 42 of file PlanAction.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 61 of file PlanAction.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 213 of file PlanAction.cpp.