Seastar
High performance C++ framework for concurrent servers
|
The base class for all json objects It holds a list of all the element in it, allowing it implement the to_json method.
It also allows iterating over the element in the object, even if not all the member are known in advance and in practice mimic reflection
#include <seastar/json/json_elements.hh>
Public Member Functions | |
json_base (const json_base &)=delete | |
json_base | operator= (const json_base &)=delete |
virtual std::string | to_json () const |
virtual future | write (output_stream< char > &) const |
write to an output stream More... | |
virtual bool | is_verify () const |
virtual void | add (json_base_element *element, std::string name, bool mandatory=false) |
Public Attributes | |
std::vector< json_base_element * > | _elements |
|
virtual |
Register an element in an object
element | the element to be added |
name | the element name |
mandatory | is this element mandatory. |
|
virtual |
Check that all mandatory elements are set
|
virtual |
create a formatted string of the object.
Implements seastar::json::jsonable.
|
virtual |
write to an output stream
Reimplemented from seastar::json::jsonable.