|
Fawkes API
Fawkes Development Version
|
ImageInfo representation for JSON transfer. More...
#include <ImageInfo.h>
Public Member Functions | |
| ImageInfo () | |
| Constructor. More... | |
| ImageInfo (const std::string &json) | |
| Constructor from JSON. More... | |
| ImageInfo (const rapidjson::Value &v) | |
| Constructor from JSON. More... | |
| virtual | ~ImageInfo () |
| 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 > | colorspace () const |
| Get colorspace value. More... | |
| void | set_colorspace (const std::string &colorspace) |
| Set colorspace value. More... | |
| std::optional< std::string > | frame () const |
| Get frame value. More... | |
| void | set_frame (const std::string &frame) |
| Set frame value. More... | |
| std::optional< int64_t > | width () const |
| Get width value. More... | |
| void | set_width (const int64_t &width) |
| Set width value. More... | |
| std::optional< int64_t > | height () const |
| Get height value. More... | |
| void | set_height (const int64_t &height) |
| Set height value. More... | |
| std::optional< int64_t > | mem_size () const |
| Get mem_size value. More... | |
| void | set_mem_size (const int64_t &mem_size) |
| Set mem_size value. More... | |
Static Public Member Functions | |
| static std::string | api_version () |
| Get version of implemented API. More... | |
ImageInfo representation for JSON transfer.
Definition at line 26 of file ImageInfo.h.
| ImageInfo::ImageInfo | ( | ) |
Constructor.
Definition at line 23 of file ImageInfo.cpp.
| ImageInfo::ImageInfo | ( | const std::string & | json | ) |
Constructor from JSON.
| json | JSON string to initialize from |
Definition at line 27 of file ImageInfo.cpp.
References from_json().
| ImageInfo::ImageInfo | ( | const rapidjson::Value & | v | ) |
Constructor from JSON.
| v | RapidJSON value object to initialize from. |
Definition at line 32 of file ImageInfo.cpp.
References from_json_value().
|
virtual |
Destructor.
Definition at line 37 of file ImageInfo.cpp.
|
inlinestatic |
Get version of implemented API.
Definition at line 48 of file ImageInfo.h.
|
inline |
Get apiVersion value.
Definition at line 109 of file ImageInfo.h.
Referenced by set_apiVersion().
|
inline |
Get colorspace value.
Definition at line 143 of file ImageInfo.h.
Referenced by MongoLogImagesThread::loop(), and set_colorspace().
|
inline |
Get frame value.
Definition at line 160 of file ImageInfo.h.
Referenced by set_frame().
|
virtual |
Retrieve data from JSON string.
| json | JSON representation suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 111 of file ImageInfo.cpp.
References from_json_value().
Referenced by ImageInfo().
|
virtual |
Retrieve data from JSON string.
| v | RapidJSON value suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 120 of file ImageInfo.cpp.
Referenced by from_json(), and ImageInfo().
|
inline |
Get height value.
Definition at line 194 of file ImageInfo.h.
Referenced by MongoLogImagesThread::loop(), and set_height().
|
inline |
|
inline |
Get kind value.
Definition at line 92 of file ImageInfo.h.
Referenced by set_kind().
|
inline |
Get mem_size value.
Definition at line 211 of file ImageInfo.h.
Referenced by set_mem_size().
|
inline |
Set apiVersion value.
| apiVersion | new value |
Definition at line 118 of file ImageInfo.h.
References apiVersion().
|
inline |
Set colorspace value.
| colorspace | new value |
Definition at line 152 of file ImageInfo.h.
References colorspace().
|
inline |
Set frame value.
| frame | new value |
Definition at line 169 of file ImageInfo.h.
References frame().
|
inline |
Set height value.
| height | new value |
Definition at line 203 of file ImageInfo.h.
References height().
|
inline |
|
inline |
Set kind value.
| kind | new value |
Definition at line 101 of file ImageInfo.h.
References kind().
|
inline |
Set mem_size value.
| mem_size | new value |
Definition at line 220 of file ImageInfo.h.
References mem_size().
|
inline |
Set width value.
| width | new value |
Definition at line 186 of file ImageInfo.h.
References width().
|
virtual |
Render object to JSON.
| pretty | true to enable pretty printing (readable spacing) |
Definition at line 42 of file ImageInfo.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 ImageInfo.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 149 of file ImageInfo.cpp.
|
inline |
Get width value.
Definition at line 177 of file ImageInfo.h.
Referenced by MongoLogImagesThread::loop(), and set_width().