|
Fawkes API
Fawkes Development Version
|
InterfaceInfo representation for JSON transfer. More...
#include <InterfaceInfo.h>
Public Member Functions | |
| InterfaceInfo () | |
| Constructor. More... | |
| InterfaceInfo (const std::string &json) | |
| Constructor from JSON. More... | |
| InterfaceInfo (const rapidjson::Value &v) | |
| Constructor from JSON. More... | |
| virtual | ~InterfaceInfo () |
| 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 > | type () const |
| Get type value. More... | |
| void | set_type (const std::string &type) |
| Set type value. More... | |
| std::optional< std::string > | hash () const |
| Get hash value. More... | |
| void | set_hash (const std::string &hash) |
| Set hash value. More... | |
| std::optional< std::string > | writer () const |
| Get writer value. More... | |
| void | set_writer (const std::string &writer) |
| Set writer value. More... | |
| std::vector< std::string > | readers () const |
| Get readers value. More... | |
| void | set_readers (const std::vector< std::string > &readers) |
| Set readers value. More... | |
| void | addto_readers (const std::string &&readers) |
| Add element to readers array. More... | |
| void | addto_readers (const std::string &readers) |
| Add element to readers array. More... | |
| std::vector< std::shared_ptr< InterfaceFieldType > > | fields () const |
| Get fields value. More... | |
| void | set_fields (const std::vector< std::shared_ptr< InterfaceFieldType >> &fields) |
| Set fields value. More... | |
| void | addto_fields (const std::shared_ptr< InterfaceFieldType > &&fields) |
| Add element to fields array. More... | |
| void | addto_fields (const std::shared_ptr< InterfaceFieldType > &fields) |
| Add element to fields array. More... | |
| void | addto_fields (const InterfaceFieldType &&fields) |
| Add element to fields array. More... | |
| std::vector< std::shared_ptr< InterfaceMessageType > > | message_types () const |
| Get message_types value. More... | |
| void | set_message_types (const std::vector< std::shared_ptr< InterfaceMessageType >> &message_types) |
| Set message_types value. More... | |
| void | addto_message_types (const std::shared_ptr< InterfaceMessageType > &&message_types) |
| Add element to message_types array. More... | |
| void | addto_message_types (const std::shared_ptr< InterfaceMessageType > &message_types) |
| Add element to message_types array. More... | |
| void | addto_message_types (const InterfaceMessageType &&message_types) |
| Add element to message_types array. More... | |
Static Public Member Functions | |
| static std::string | api_version () |
| Get version of implemented API. More... | |
InterfaceInfo representation for JSON transfer.
Definition at line 29 of file InterfaceInfo.h.
| InterfaceInfo::InterfaceInfo | ( | ) |
Constructor.
Definition at line 23 of file InterfaceInfo.cpp.
| InterfaceInfo::InterfaceInfo | ( | const std::string & | json | ) |
Constructor from JSON.
| json | JSON string to initialize from |
Definition at line 27 of file InterfaceInfo.cpp.
References from_json().
| InterfaceInfo::InterfaceInfo | ( | const rapidjson::Value & | v | ) |
Constructor from JSON.
| v | RapidJSON value object to initialize from. |
Definition at line 32 of file InterfaceInfo.cpp.
References from_json_value().
|
virtual |
Destructor.
Definition at line 37 of file InterfaceInfo.cpp.
|
inline |
Add element to fields array.
| fields | new value |
Definition at line 267 of file InterfaceInfo.h.
References fields().
|
inline |
Add element to fields array.
| fields | new value |
Definition at line 249 of file InterfaceInfo.h.
References fields().
|
inline |
Add element to fields array.
The move-semantics version (std::move) should be preferred.
| fields | new value |
Definition at line 259 of file InterfaceInfo.h.
References fields().
|
inline |
Add element to message_types array.
| message_types | new value |
Definition at line 310 of file InterfaceInfo.h.
References message_types().
|
inline |
Add element to message_types array.
| message_types | new value |
Definition at line 292 of file InterfaceInfo.h.
References message_types().
|
inline |
Add element to message_types array.
The move-semantics version (std::move) should be preferred.
| message_types | new value |
Definition at line 302 of file InterfaceInfo.h.
References message_types().
|
inline |
Add element to readers array.
| readers | new value |
Definition at line 214 of file InterfaceInfo.h.
References readers().
|
inline |
Add element to readers array.
The move-semantics version (std::move) should be preferred.
| readers | new value |
Definition at line 224 of file InterfaceInfo.h.
References readers().
|
inlinestatic |
Get version of implemented API.
Definition at line 51 of file InterfaceInfo.h.
|
inline |
Get apiVersion value.
Definition at line 112 of file InterfaceInfo.h.
Referenced by set_apiVersion().
|
inline |
Get fields value.
Definition at line 232 of file InterfaceInfo.h.
Referenced by addto_fields(), and set_fields().
|
virtual |
Retrieve data from JSON string.
| json | JSON representation suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 125 of file InterfaceInfo.cpp.
References from_json_value().
Referenced by InterfaceInfo().
|
virtual |
Retrieve data from JSON string.
| v | RapidJSON value suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 134 of file InterfaceInfo.cpp.
References InterfaceFieldType::from_json_value(), and InterfaceMessageType::from_json_value().
Referenced by from_json(), and InterfaceInfo().
|
inline |
Get hash value.
Definition at line 163 of file InterfaceInfo.h.
Referenced by set_hash().
|
inline |
Get id value.
Definition at line 129 of file InterfaceInfo.h.
Referenced by set_id().
|
inline |
Get kind value.
Definition at line 95 of file InterfaceInfo.h.
Referenced by set_kind().
|
inline |
Get message_types value.
Definition at line 275 of file InterfaceInfo.h.
Referenced by addto_message_types(), and set_message_types().
|
inline |
Get readers value.
Definition at line 197 of file InterfaceInfo.h.
Referenced by addto_readers(), and set_readers().
|
inline |
Set apiVersion value.
| apiVersion | new value |
Definition at line 121 of file InterfaceInfo.h.
References apiVersion().
|
inline |
Set fields value.
| fields | new value |
Definition at line 241 of file InterfaceInfo.h.
References fields().
|
inline |
Set hash value.
| hash | new value |
Definition at line 172 of file InterfaceInfo.h.
References hash().
|
inline |
Set id value.
| id | new value |
Definition at line 138 of file InterfaceInfo.h.
References id().
|
inline |
Set kind value.
| kind | new value |
Definition at line 104 of file InterfaceInfo.h.
References kind().
|
inline |
Set message_types value.
| message_types | new value |
Definition at line 284 of file InterfaceInfo.h.
References message_types().
|
inline |
Set readers value.
| readers | new value |
Definition at line 206 of file InterfaceInfo.h.
References readers().
|
inline |
Set type value.
| type | new value |
Definition at line 155 of file InterfaceInfo.h.
References type().
|
inline |
Set writer value.
| writer | new value |
Definition at line 189 of file InterfaceInfo.h.
References writer().
|
virtual |
Render object to JSON.
| pretty | true to enable pretty printing (readable spacing) |
Definition at line 42 of file InterfaceInfo.cpp.
References to_json_value(), and writer().
|
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 InterfaceInfo.cpp.
Referenced by to_json().
|
inline |
Get type value.
Definition at line 146 of file InterfaceInfo.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 |
Definition at line 188 of file InterfaceInfo.cpp.
|
inline |
Get writer value.
Definition at line 180 of file InterfaceInfo.h.
Referenced by set_writer(), and to_json().