TPIE

2362a60
tpie::serializer Class Reference

Class providing binary serialization to a std::ostream. More...

#include <tpie/serialization.h>

Public Member Functions

 serializer (std::ostream &out, bool typesafe=false)
 Construct a serializer writing to out. More...
 
template<typename T >
serializerwrite (const T *data, size_t l)
 
template<typename T >
std::enable_if
< std::is_fundamental< T >
::value||std::is_enum< T >
::value, serializer & >::type 
operator<< (const T &x)
 
template<typename T1 , typename T2 >
serializeroperator<< (const std::pair< T1, T2 > &p)
 
template<typename T >
serializeroperator<< (const std::vector< T > &v)
 
serializeroperator<< (const char *data)
 
serializeroperator<< (const std::string &s)
 

Detailed Description

Class providing binary serialization to a std::ostream.

Data is serialized by using the << operators.

Definition at line 55 of file serialization.h.

Constructor & Destructor Documentation

tpie::serializer::serializer ( std::ostream &  out,
bool  typesafe = false 
)
inline

Construct a serializer writing to out.

Definition at line 60 of file serialization.h.

60  : m_out(out), m_typesafe(false) {
61  *this << "TPIE Serialization" //File header
62  << (uint16_t)1 //File version
63  << typesafe; //Do we serialize typeids before each actual item?
64  m_typesafe = typesafe;
65  }

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