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_element< T > Class Template Reference

Detailed Description

template<class T>
class seastar::json::json_element< T >

Basic json element instantiate the json_element template. it adds a value to the base definition and the to_string implementation using the formatter

#include <seastar/json/json_elements.hh>

Inheritance diagram for seastar::json::json_element< T >:
seastar::json::json_base_element

Public Member Functions

json_elementoperator= (const T &new_value)
 
template<class C >
json_elementoperator= (const C &new_value)
 
const T & operator() () const noexcept
 
virtual std::string to_string () override
 
virtual future write (output_stream< char > &s) const override
 
virtual bool is_verify () noexcept
 

Public Attributes

std::string _name
 
bool _mandatory
 
bool _set
 

Member Function Documentation

◆ is_verify()

virtual bool seastar::json::json_base_element::is_verify ( )
inlinevirtualnoexceptinherited

Check if it's a mandatory parameter and if it's set.

Returns
true if this is not a mandatory parameter or if it is and it's value is set

◆ operator()()

template<class T >
const T & seastar::json::json_element< T >::operator() ( ) const
inlinenoexcept

The brackets operator

Returns
the value

◆ operator=() [1/2]

template<class T >
template<class C >
json_element & seastar::json::json_element< T >::operator= ( const C &  new_value)
inline

the assignment operator also set the set value to true.

Parameters
new_valuethe new value
Returns
the value itself

◆ operator=() [2/2]

template<class T >
json_element & seastar::json::json_element< T >::operator= ( const T &  new_value)
inline

the assignment operator also set the set value to true.

Parameters
new_valuethe new value
Returns
the value itself

◆ to_string()

template<class T >
virtual std::string seastar::json::json_element< T >::to_string ( )
inlineoverridevirtual

The to_string return the value formated as a json value

Returns
the value formatted for json

Implements seastar::json::json_base_element.

◆ write()

template<class T >
virtual future seastar::json::json_element< T >::write ( output_stream< char > &  s) const
inlineoverridevirtual

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