All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
StreamBuffer.h File Reference
#include <list>
#include <vector>
#include <string>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <typeinfo>
#include "GaudiKernel/Kernel.h"
#include "GaudiKernel/swab.h"
Include dependency graph for StreamBuffer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  StreamBuffer
 The stream buffer is a small object collecting object data. More...
 
class  StreamBuffer::DataIO
 A small base class to handle generic data streaming. More...
 
class  StreamBuffer::Istream
 Reader for standard input streams. More...
 
class  StreamBuffer::Ostream
 Writer for standard output streams. More...
 
class  StreamBuffer::ContainedLink
 Definition of the contained link set. More...
 
class  StreamBuffer::IdentifiedLink
 Definition of the contained link set. More...
 

Macros

#define STREAM_ANALYSE(data, len)
 
#define IMPLEMENT_STREAMER(TYPE)
 

Functions

template<class T >
StreamBufferoperator<< (StreamBuffer &s, const std::vector< T > &v)
 
template<class T >
StreamBufferoperator>> (StreamBuffer &s, std::vector< T > &v)
 
template<class T >
StreamBufferoperator<< (StreamBuffer &s, const std::list< T > &l)
 
template<class T >
StreamBufferoperator>> (StreamBuffer &s, std::list< T > &l)
 

Macro Definition Documentation

#define IMPLEMENT_STREAMER (   TYPE)
Value:
/* Output Streamer */ \
StreamBuffer& operator<<(TYPE data) { \
swapToBuffer(&data, sizeof(data)); \
STREAM_ANALYSE(data, sizeof(data)); \
return *this; \
} \
/* Input Streamer */ \
StreamBuffer& operator>>(TYPE & data) { \
swapFromBuffer(&data, sizeof(data)); \
return *this; \
}
StreamBuffer & operator<<(StreamBuffer &s, const std::vector< T > &v)
Definition: StreamBuffer.h:645
StreamBuffer & operator>>(StreamBuffer &s, std::vector< T > &v)
Definition: StreamBuffer.h:655
#define STREAM_ANALYSE(data, len)
Definition: StreamBuffer.h:339

Definition at line 343 of file StreamBuffer.h.

#define STREAM_ANALYSE (   data,
  len 
)

Definition at line 339 of file StreamBuffer.h.

Function Documentation

template<class T >
StreamBuffer& operator<< ( StreamBuffer s,
const std::vector< T > &  v 
)
inline

Definition at line 645 of file StreamBuffer.h.

645  {
646  s << v.size();
647  for ( typename std::vector<T>::const_iterator i = v.begin(); i != v.end(); i++ ) {
648  s << (*i);
649  }
650  return s;
651 }
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
template<class T >
StreamBuffer& operator<< ( StreamBuffer s,
const std::list< T > &  l 
)
inline

Definition at line 669 of file StreamBuffer.h.

669  {
670  s << l.size();
671  for ( typename std::list<T>::const_iterator i = l.begin(); i != l.end(); i++ ) {
672  s << (*i);
673  }
674  return s;
675 }
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
template<class T >
StreamBuffer& operator>> ( StreamBuffer s,
std::vector< T > &  v 
)
inline

Definition at line 655 of file StreamBuffer.h.

655  {
656  long i, len;
657  s >> len;
658  v.clear();
659  for ( i = 0; i < len; i++ ) {
660  T temp;
661  s >> temp;
662  v.push_back(temp);
663  }
664  return s;
665 }
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
template<class T >
StreamBuffer& operator>> ( StreamBuffer s,
std::list< T > &  l 
)
inline

Definition at line 679 of file StreamBuffer.h.

679  {
680  long i, len;
681  s >> len;
682  l.clear();
683  for ( i = 0; i < len; i++ ) {
684  T temp;
685  s >> temp;
686  l.push_back(temp);
687  }
688  return s;
689 }
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128