Seastar
High performance C++ framework for concurrent servers
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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 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
 

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 formatted string of the object.

Returns
the object formatted.

Implements seastar::json::jsonable.

◆ write()

virtual future seastar::json::json_base::write ( output_stream< char > &  ) const
virtual

write to an output stream

Reimplemented from seastar::json::jsonable.


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