The Gaudi Framework  v33r2 (a6f0ec87)
StreamBuffer.h File Reference
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <string>
#include <typeinfo>
#include <vector>
#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

◆ IMPLEMENT_STREAMER

#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:615
StreamBuffer & operator>>(StreamBuffer &s, std::vector< T > &v)
Definition: StreamBuffer.h:623

Definition at line 313 of file StreamBuffer.h.

◆ STREAM_ANALYSE

#define STREAM_ANALYSE (   data,
  len 
)

Definition at line 309 of file StreamBuffer.h.

Function Documentation

◆ operator<<() [1/2]

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

Definition at line 615 of file StreamBuffer.h.

615  {
616  s << v.size();
617  for ( const auto& i : v ) s << i;
618  return s;
619 }
T size(T... args)
string s
Definition: gaudirun.py:328

◆ operator<<() [2/2]

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

Definition at line 637 of file StreamBuffer.h.

637  {
638  s << l.size();
639  for ( const auto& i : l ) s << i;
640  return s;
641 }
dictionary l
Definition: gaudirun.py:543
string s
Definition: gaudirun.py:328

◆ operator>>() [1/2]

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

Definition at line 623 of file StreamBuffer.h.

623  {
624  long i, len;
625  s >> len;
626  v.clear();
627  for ( i = 0; i < len; i++ ) {
628  T temp;
629  s >> temp;
630  v.push_back( temp );
631  }
632  return s;
633 }
T push_back(T... args)
T clear(T... args)
string s
Definition: gaudirun.py:328

◆ operator>>() [2/2]

template<class T >
StreamBuffer& operator>> ( StreamBuffer s,
std::list< T > &  l 
)
inline

Definition at line 645 of file StreamBuffer.h.

645  {
646  long len;
647  s >> len;
648  l.clear();
649  for ( long i = 0; i < len; i++ ) {
650  T temp;
651  s >> temp;
652  l.push_back( temp );
653  }
654  return s;
655 }
dictionary l
Definition: gaudirun.py:543
string s
Definition: gaudirun.py:328