Eile Mit Weile
Loading...
Searching...
No Matches
SerializableValue< T > Class Template Reference

A serializable value, used for writing values into json. More...

#include <serializable_value.hpp>

Inheritance diagram for SerializableValue< T >:
Serializable

Public Member Functions

 SerializableValue (T val)
 
T GetValue () const
 
void SetValue (T val)
 
void WriteIntoJson (rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const override
 
- Public Member Functions inherited from Serializable
virtual rapidjson::DocumentToJson () const
 

Static Public Member Functions

static SerializableValue< T > * FromJson (const rapidjson::Value &json)
 

Private Attributes

T value
 

Detailed Description

template<class T>
class SerializableValue< T >

A serializable value, used for writing values into json.

Template Parameters
TThe type of the value

Supported value types are:

  • bool
  • int
  • unsigned int
  • int64_t
  • uint64_t
  • float
  • double
  • string

Constructor & Destructor Documentation

◆ SerializableValue()

template<class T >
SerializableValue< T >::SerializableValue ( T  val)
inlineexplicit

Constructor: creates a SerializableValue with a value

Member Function Documentation

◆ FromJson()

template<class T >
static SerializableValue< T > * SerializableValue< T >::FromJson ( const rapidjson::Value json)
inlinestatic

< Deserializes a SerializableValue object from a json object.

◆ GetValue()

template<class T >
T SerializableValue< T >::GetValue ( ) const
inline

Getter for the value

◆ SetValue()

template<class T >
void SerializableValue< T >::SetValue ( T  val)
inline

< Setter for the value

◆ WriteIntoJson()

template<class T >
void SerializableValue< T >::WriteIntoJson ( rapidjson::Value json,
rapidjson::Document::AllocatorType &  allocator 
) const
inlineoverridevirtual

Serializes a serializable object into a json object.

< Serializes a SerializableValue object into a json object.

Implements Serializable.

Member Data Documentation

◆ value

template<class T >
T SerializableValue< T >::value
private

The value of the SerializableValue


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