Fawkes API
Fawkes Development Version
|
DomainFact representation for JSON transfer. More...
#include <DomainFact.h>
Public Member Functions | |
DomainFact () | |
Constructor. More... | |
DomainFact (const std::string &json) | |
Constructor from JSON. More... | |
DomainFact (const rapidjson::Value &v) | |
Constructor from JSON. More... | |
virtual | ~DomainFact () |
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::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... | |
Static Public Member Functions | |
static std::string | api_version () |
Get version of implemented API. More... | |
DomainFact representation for JSON transfer.
Definition at line 27 of file DomainFact.h.
DomainFact::DomainFact | ( | ) |
Constructor.
Definition at line 24 of file DomainFact.cpp.
DomainFact::DomainFact | ( | const std::string & | json | ) |
Constructor from JSON.
json | JSON string to initialize from |
Definition at line 28 of file DomainFact.cpp.
References from_json().
DomainFact::DomainFact | ( | const rapidjson::Value & | v | ) |
Constructor from JSON.
v | RapidJSON value object to initialize from. |
Definition at line 33 of file DomainFact.cpp.
References from_json_value().
|
virtual |
Destructor.
Definition at line 38 of file DomainFact.cpp.
|
inline |
Add element to param-values array.
param_values | new value |
Definition at line 160 of file DomainFact.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 170 of file DomainFact.h.
References param_values().
|
inlinestatic |
Get version of implemented API.
Definition at line 48 of file DomainFact.h.
|
inline |
Get apiVersion value.
Definition at line 109 of file DomainFact.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 95 of file DomainFact.cpp.
References from_json_value().
Referenced by DomainFact().
|
virtual |
Retrieve data from JSON string.
v | RapidJSON value suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 104 of file DomainFact.cpp.
Referenced by DomainFact(), and from_json().
|
inline |
Get kind value.
Definition at line 92 of file DomainFact.h.
Referenced by set_kind().
|
inline |
Get name value.
Definition at line 126 of file DomainFact.h.
Referenced by set_name().
|
inline |
Get param-values value.
Definition at line 143 of file DomainFact.h.
Referenced by addto_param_values(), and set_param_values().
|
inline |
Set apiVersion value.
apiVersion | new value |
Definition at line 118 of file DomainFact.h.
References apiVersion().
|
inline |
Set kind value.
kind | new value |
Definition at line 101 of file DomainFact.h.
References kind().
|
inline |
Set name value.
name | new value |
Definition at line 135 of file DomainFact.h.
References name().
|
inline |
Set param-values value.
param_values | new value |
Definition at line 152 of file DomainFact.h.
References param_values().
|
virtual |
Render object to JSON.
pretty | true to enable pretty printing (readable spacing) |
Definition at line 43 of file DomainFact.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 DomainFact.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 127 of file DomainFact.cpp.