Fawkes API
Fawkes Development Version
|
Skill representation for JSON transfer. More...
#include <Skill.h>
Public Member Functions | |
Skill () | |
Constructor. More... | |
Skill (const std::string &json) | |
Constructor from JSON. More... | |
Skill (const rapidjson::Value &v) | |
Constructor from JSON. More... | |
virtual | ~Skill () |
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 > | graph () const |
Get graph value. More... | |
void | set_graph (const std::string &graph) |
Set graph value. More... | |
std::optional< std::string > | skill_string () const |
The skill string is given only for the active skill. More... | |
void | set_skill_string (const std::string &skill_string) |
Set skill-string value. More... | |
std::optional< std::string > | error () const |
An error is presented for the active skill if it has FAILED. More... | |
void | set_error (const std::string &error) |
Set error value. More... | |
std::optional< int64_t > | msg_id () const |
Get msg_id value. More... | |
void | set_msg_id (const int64_t &msg_id) |
Set msg_id value. More... | |
std::optional< int64_t > | exclusive_controller () const |
Get exclusive_controller value. More... | |
void | set_exclusive_controller (const int64_t &exclusive_controller) |
Set exclusive_controller value. More... | |
std::optional< std::string > | status () const |
Get status value. More... | |
void | set_status (const std::string &status) |
Set status value. More... | |
Static Public Member Functions | |
static std::string | api_version () |
Get version of implemented API. More... | |
Skill::Skill | ( | const std::string & | json | ) |
Constructor from JSON.
json | JSON string to initialize from |
Definition at line 28 of file Skill.cpp.
References from_json().
Skill::Skill | ( | const rapidjson::Value & | v | ) |
Constructor from JSON.
v | RapidJSON value object to initialize from. |
Definition at line 33 of file Skill.cpp.
References from_json_value().
|
inlinestatic |
|
inline |
Get apiVersion value.
Definition at line 109 of file Skill.h.
Referenced by set_apiVersion().
|
inline |
An error is presented for the active skill if it has FAILED.
Definition at line 179 of file Skill.h.
Referenced by set_error().
|
inline |
Get exclusive_controller value.
Definition at line 213 of file Skill.h.
Referenced by set_exclusive_controller().
|
virtual |
Retrieve data from JSON string.
json | JSON representation suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 117 of file Skill.cpp.
References from_json_value().
Referenced by Skill().
|
virtual |
Retrieve data from JSON string.
v | RapidJSON value suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 126 of file Skill.cpp.
Referenced by from_json(), and Skill().
|
inline |
Get graph value.
Definition at line 143 of file Skill.h.
Referenced by set_graph().
|
inline |
|
inline |
Get msg_id value.
Definition at line 196 of file Skill.h.
Referenced by set_msg_id().
|
inline |
|
inline |
Set apiVersion value.
apiVersion | new value |
Definition at line 118 of file Skill.h.
References apiVersion().
|
inline |
|
inline |
Set exclusive_controller value.
exclusive_controller | new value |
Definition at line 222 of file Skill.h.
References exclusive_controller().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set skill-string value.
skill_string | new value |
Definition at line 170 of file Skill.h.
References skill_string().
|
inline |
|
inline |
The skill string is given only for the active skill.
Definition at line 161 of file Skill.h.
Referenced by set_skill_string().
|
inline |
Get status value.
Definition at line 230 of file Skill.h.
Referenced by set_status().
|
virtual |
Render object to JSON.
pretty | true to enable pretty printing (readable spacing) |
Definition at line 43 of file Skill.cpp.
References to_json_value().
|
virtual |
|
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 |