SPH
Public Member Functions | List of all members
ConfigValue< Type > Class Template Reference

Generic implementation of IConfigValue, using std::stringstream for the (de)serialization. More...

#include <Config.h>

Inheritance diagram for ConfigValue< Type >:
IConfigValue Polymorphic

Public Member Functions

 ConfigValue ()=default
 
 ConfigValue (const Type &value)
 
virtual std::string write () const override
 Writes the value into a string. More...
 
virtual void read (const std::string &source) override
 Reads the value from string and stores it internally. More...
 
Type get () const
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

template<typename Type>
class ConfigValue< Type >

Generic implementation of IConfigValue, using std::stringstream for the (de)serialization.

This is used for primitive types and for other types that define the stream operators. If a user-defined type does not have these operators, it is necessary to specialize this class and implement the functions read and write manually.

Definition at line 48 of file Config.h.

Constructor & Destructor Documentation

◆ ConfigValue() [1/2]

template<typename Type >
ConfigValue< Type >::ConfigValue ( )
default

◆ ConfigValue() [2/2]

template<typename Type >
ConfigValue< Type >::ConfigValue ( const Type &  value)
inline

Definition at line 55 of file Config.h.

Member Function Documentation

◆ get()

template<typename Type >
Type ConfigValue< Type >::get ( ) const
inline

Definition at line 73 of file Config.h.

◆ read()

template<typename Type >
virtual void ConfigValue< Type >::read ( const std::string &  source)
inlineoverridevirtual

Reads the value from string and stores it internally.

Exceptions
ConfigExceptionif the value cannot be deserialized.

Implements IConfigValue.

Definition at line 64 of file Config.h.

◆ write()

template<typename Type >
virtual std::string ConfigValue< Type >::write ( ) const
inlineoverridevirtual

Writes the value into a string.

Implements IConfigValue.

Definition at line 58 of file Config.h.


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