Swarm-NG  1.1
binarystream.hpp File Reference

Defines I/O interface in binary form using boost data types. More...

#include <iostream>
#include <algorithm>
#include <vector>
#include "util.hpp"
#include <boost/type_traits.hpp>

Go to the source code of this file.

Classes

class  peyton::io::basic_obstream< _CharT, _Traits >
 forward declarations More...
 
class  peyton::io::basic_ibstream< _CharT, _Traits >
 Input stream. More...
 
class  peyton::io::basic_bstream< _CharT, _Traits >
 Input/output stream. More...
 
class  boost::is_pod< ::std::pair< First, Second > >
 Marks a std::pair of PODs as a POD. More...
 
struct  peyton::io::binary::datatype_info
 Type information structure for manifest. More...
 
class  peyton::io::basic_obstream< _CharT, _Traits >
 forward declarations More...
 
class  peyton::io::basic_ibstream< _CharT, _Traits >
 Input stream. More...
 
class  peyton::io::basic_bstream< _CharT, _Traits >
 Input/output stream. More...
 

Namespaces

 peyton
 Type traits utilities. Should be separated into it's own header.
 
 boost
 Automatically mark a std::pair of PODs as a POD.
 
 peyton::io::binary
 auxiliary/debug variables/methods are found here
 

Constant Groups

 peyton
 Type traits utilities. Should be separated into it's own header.
 
 boost
 Automatically mark a std::pair of PODs as a POD.
 
 peyton::io::binary
 auxiliary/debug variables/methods are found here
 

Macros

#define BLESS_POD(T)
 Use this to tell stream that your user defined type may be treated as a plain-old-datatype.
 
#define BOSTREAM2(T...)   peyton::io::obstream& operator<<(peyton::io::obstream &out, T)
 Operator declaration macros.
 
#define RETFAIL(x)   if(!(x)) return in;
 C and STL string specializations. Note that there's no operator >>(char *), because of possible buffer overflow issues.
 

Functions

bool peyton::io::binary::operator< (const datatype_info &a, const datatype_info &b)
 Define operators.
 
bool peyton::io::binary::operator== (const datatype_info &a, const datatype_info &b)
 Define operators.
 
std::ostream & peyton::io::binary::operator<< (std::ostream &out, const datatype_info &di)
 Define operators.
 
std::ostream & peyton::io::binary::operator<< (std::ostream &out, const manifest_t &manifest)
 Define operators.
 
template<typename T >
void peyton::io::binary::add_to_manifest ()
 Add typename information to manifest. More...
 
template<typename T >
 peyton::io::BOSTREAM2 (const T &v)
 Generic POD input/output operators.
 
template<>
 peyton::io::BOSTREAM2 (std::string const &v)
 String specializations.
 
template<>
 peyton::io::BISTREAM2 (std::string &v)
 String pointer specializations.
 
template<typename IT >
obstreampeyton::io::details::itwrite (obstream &out, unsigned int size, IT start, const ::boost::false_type &)
 unoptimized version
 
template<typename IT >
obstreampeyton::io::details::itwrite (obstream &out, unsigned int size, IT start, const ::boost::true_type &)
 optimized version, for POD arrays
 
template<typename IT >
obstreampeyton::io::itwrite (obstream &out, unsigned int size, IT start)
 Writing routines for containers. There are three versions, one optimized for containers linearly stored in memory, the generic one, and one optimized for maps (avoids the unnecessary temporaries of data_type)
 
template<typename C >
ibstreampeyton::io::itread (ibstream &in, C &a)
 Reading routines for containers.
 
template<typename C >
ibstreampeyton::io::itreadvec (ibstream &in, C &a)
 Reading routines for container vectors.
 
template<typename C >
ibstreampeyton::io::itreadmap (ibstream &in, C &a)
 Reading routines for containers.
 
template<typename First , typename Second >
 peyton::io::BOSTREAM2 (const std::pair< First, Second > &v)
 STL specializations.
 

Variables

manifest_t peyton::io::binary::manifest
 A map between T and sizeof(T)
 
bool peyton::io::binary::track_manifest = true
 If set to true , manifest will be populated.
 

Detailed Description

Defines I/O interface in binary form using boost data types.

Definition in file binarystream.hpp.