Seastar
High performance C++ framework for concurrent servers
Public Member Functions | Public Attributes | List of all members
seastar::json::json_base Struct Reference

Detailed Description

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>

Inheritance diagram for seastar::json::json_base:
seastar::json::jsonable seastar::httpd::api_doc seastar::httpd::api_docs seastar::httpd::json_exception

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
 
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
 

Member Function Documentation

◆ add()

virtual void seastar::json::json_base::add ( json_base_element element,
std::string  name,
bool  mandatory = false 
)
virtual

Register an element in an object

Parameters
elementthe element to be added
namethe element name
mandatoryis this element mandatory.

◆ is_verify()

virtual bool seastar::json::json_base::is_verify ( ) const
virtual

Check that all mandatory elements are set

Returns
true if all mandatory parameters are set

◆ to_json()

virtual std::string seastar::json::json_base::to_json ( ) const
virtual

create a foramted string of the object.

Returns
the object formated.

Implements seastar::json::jsonable.


The documentation for this struct was generated from the following file: