SUNphi  1.0
SUNphi::Serializable< T > Class Template Reference

Forward definition of serializable. More...

#include <Base.hpp>

Inheritance diagram for SUNphi::Serializable< T >:
SUNphi::SerializableDefaultValue< T, not isSerializableMap< T > > SUNphi::Binarizable< Serializable< T > >

Public Types

using Type = T
 Mapped type.
 

Public Member Functions

const T & operator() () const
 Access the value.
 
template<typename... Ts>
decltype(auto) operator() (Ts &&...ts)
 
template<typename... P>
 Serializable (const char *name, P &&...def)
 Creates a serializable with default value. More...
 
bool isDefault () const
 Check if the value is default or not.
 
YAML::Node serialize (YAML::Node &node, const bool &onlyNonDefault=false) const
 Returns a YAML node after serializing to it.
 
YAML::Node serialize (const bool &onlyNonDefault=false) const
 Returns a YAML node. More...
 
bool deSerialize (const YAML::Node &node)
 Convert from a YAML node. More...
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator+= (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator-= (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator*= (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator/= (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator+ (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator- (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator* (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator/ (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator== (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator!= (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator< (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator<= (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator> (const O &oth)
 
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) operator>= (const O &oth)
 
template<typename O >
decltype(auto) friend operator+= (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator-= (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator*= (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator/= (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator+ (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator- (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator* (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator/ (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator== (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator!= (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator< (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator<= (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator> (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) friend operator>= (O &first, const Serializable &second)
 
template<typename O >
decltype(auto) operator= (const O &oth)
 
Serializableoperator= (const Serializable &oth)
 Copy assignment operator.
 
 operator T & ()
 Cast to base value.
 
 operator const T & () const
 Cast to base value, const version.
 
Binarizerbinarize (B &&out={}) const
 Binarize a Serializable. More...
 
BinarizerdeBinarize (B &&rhs)
 DeBinarize a Serializable. More...
 

Public Attributes

const char * name
 Name used to refer.
 

Private Member Functions

T & operator~ ()
 
const T & operator~ () const
 

Private Attributes

value
 Stored variable.
 

Static Private Attributes

static constexpr bool isMap
 Detect if the value is a map. More...
 

Detailed Description

template<typename T>
class SUNphi::Serializable< T >

Forward definition of serializable.

Provides a class with serializability features via CRTP

The type can be only trivial, or a serializable class (map). A dedicated wrapper is in place for a sequence

Definition at line 25 of file Base.hpp.

Constructor & Destructor Documentation

template<typename T>
template<typename... P>
SUNphi::Serializable< T >::Serializable ( const char *  name,
P &&...  def 
)
inlineexplicit

Creates a serializable with default value.

Parameters
nameName to be used
defDefault, if passed

Definition at line 62 of file Serializable.hpp.

Member Function Documentation

Binarizer& SUNphi::Binarizable< Serializable< T > >::binarize ( B &&  out = {}) const
inlineinherited

Binarize a Serializable.

Parameters
outOutput

Definition at line 221 of file Binarize.hpp.

Binarizer& SUNphi::Binarizable< Serializable< T > >::deBinarize ( B &&  rhs)
inlineinherited

DeBinarize a Serializable.

Parameters
rhsInput

Definition at line 230 of file Binarize.hpp.

template<typename T>
bool SUNphi::Serializable< T >::deSerialize ( const YAML::Node &  node)
inline

Convert from a YAML node.

Parameters
nodeNode from which to convert

Definition at line 118 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator!= ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator!= ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename... Ts>
decltype(auto) SUNphi::Serializable< T >::operator() ( Ts &&...  ts)
inline

Overload the operator() const method passing all args

Parameters
tsArguments

Definition at line 55 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator* ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator* ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator*= ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator*= ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator+ ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator+ ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator+= ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator+= ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator- ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator- ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator-= ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator-= ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator/ ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator/ ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator/= ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator/= ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator< ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator< ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator<= ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator<= ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) SUNphi::Serializable< T >::operator= ( const O &  oth)
inline

Assignment operator

Need to stay on his own

Definition at line 161 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator== ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator== ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator> ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator> ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
template<typename O , TypeIf<(not isSame< O, Serializable >), void * > = nullptr>
decltype(auto) SUNphi::Serializable< T >::operator>= ( const O &  oth)
inline

Assignment operator

Definition at line 154 of file Serializable.hpp.

template<typename T>
template<typename O >
decltype(auto) friend SUNphi::Serializable< T >::operator>= ( O &  first,
const Serializable< T > &  second 
)
inline

Assignment operator

Definition at line 155 of file Serializable.hpp.

template<typename T>
const T& SUNphi::Serializable< T >::operator~ ( ) const
inlineprivate

Constant cast operator to class T

Definition at line 36 of file Serializable.hpp.

template<typename T>
T& SUNphi::Serializable< T >::operator~ ( )
inlineprivate

Cast operator to class T

Definition at line 36 of file Serializable.hpp.

template<typename T>
YAML::Node SUNphi::Serializable< T >::serialize ( const bool &  onlyNonDefault = false) const
inline

Returns a YAML node.

Returned value

Definition at line 107 of file Serializable.hpp.

Member Data Documentation

template<typename T>
constexpr bool SUNphi::Serializable< T >::isMap
staticprivate
Initial value:
=
isSerializableMap<T>

Detect if the value is a map.

Definition at line 33 of file Serializable.hpp.


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