Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Data Structures | Functions
omni::serialization Namespace Reference

Namespace for serialization functionality. More...

Namespaces

 exception
 
 traits
 

Data Structures

class  Interface
 Abstract interface for serialization Holds two member functions for serialization and deserialization. More...
 
class  PropertyMap
 Property map to store properties in a QBuffer with an id. More...
 
class  PropertyMapSerializer
 Interface for serializing data into a property map. More...
 

Functions

template<typename STREAM , typename F , typename... ARGS>
STREAM & deserializePtr (STREAM &_stream, F _f, ARGS &&..._args)
 Deserialize a pointer from stream. Functor f must return a pointer which is constructed from a factory with an id. If pointer is not null, it will be deserialized from stream. Otherwise, a serialization exception is thrown. More...
 
template<typename STREAM , typename T , typename... ARGS>
STREAM & deserialize (STREAM &_stream, T &_t, ARGS &&..._args)
 Deserialize object of type T from stream with optional additional arguments. More...
 
template<typename T , typename STREAM >
deserializeReturn (STREAM &_stream, T const _default=T())
 Deserialize object of type T and return its value. More...
 
template<typename STREAM , typename T >
STREAM & serialize (STREAM &_stream, T const &_t)
 Serialize object to stream. More...
 

Detailed Description

Namespace for serialization functionality.

Function Documentation

template<typename STREAM , typename T , typename... ARGS>
STREAM& omni::serialization::deserialize ( STREAM &  _stream,
T &  _t,
ARGS &&...  _args 
)

Deserialize object of type T from stream with optional additional arguments.

125  {
126  return traits::Read<T>(_args ...)(_stream, _t);
127  }
template<typename STREAM , typename F , typename... ARGS>
STREAM& omni::serialization::deserializePtr ( STREAM &  _stream,
_f,
ARGS &&...  _args 
)

Deserialize a pointer from stream. Functor f must return a pointer which is constructed from a factory with an id. If pointer is not null, it will be deserialized from stream. Otherwise, a serialization exception is thrown.

80  {
81  return traits::ReadPtr(_args ...)(_stream, _f);
82  }
template<typename T , typename STREAM >
T omni::serialization::deserializeReturn ( STREAM &  _stream,
T const  _default = T() 
)

Deserialize object of type T and return its value.

131  {
132  T _t = _default;
133 
134  deserialize(_stream, _t);
135  return _t;
136  }
STREAM & deserialize(STREAM &_stream, T &_t, ARGS &&..._args)
Deserialize object of type T from stream with optional additional arguments.
Definition: traits.h:125
template<typename STREAM , typename T >
STREAM& omni::serialization::serialize ( STREAM &  _stream,
T const &  _t 
)

Serialize object to stream.

140  {
141  return traits::Write<T>()(_stream, _t);
142  }