The Gaudi Framework  master (37c0b60a)
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
 
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; \
}

Definition at line 317 of file StreamBuffer.h.

◆ STREAM_ANALYSE

#define STREAM_ANALYSE (   data,
  len 
)

Definition at line 313 of file StreamBuffer.h.

Function Documentation

◆ operator<<() [1/2]

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

Definition at line 638 of file StreamBuffer.h.

638  {
639  s << l.size();
640  for ( const auto& i : l ) s << i;
641  return s;
642 }

◆ operator<<() [2/2]

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

Definition at line 616 of file StreamBuffer.h.

616  {
617  s << v.size();
618  for ( const auto& i : v ) s << i;
619  return s;
620 }

◆ operator>>() [1/2]

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

Definition at line 646 of file StreamBuffer.h.

646  {
647  long len;
648  s >> len;
649  l.clear();
650  for ( long i = 0; i < len; i++ ) {
651  T temp;
652  s >> temp;
653  l.push_back( temp );
654  }
655  return s;
656 }

◆ operator>>() [2/2]

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

Definition at line 624 of file StreamBuffer.h.

624  {
625  long i, len;
626  s >> len;
627  v.clear();
628  for ( i = 0; i < len; i++ ) {
629  T temp;
630  s >> temp;
631  v.push_back( temp );
632  }
633  return s;
634 }
gaudirun.s
string s
Definition: gaudirun.py:346
operator<<
StreamBuffer & operator<<(StreamBuffer &s, const std::vector< T > &v)
Definition: StreamBuffer.h:616
gaudirun.l
dictionary l
Definition: gaudirun.py:583
Properties.v
v
Definition: Properties.py:122
operator>>
StreamBuffer & operator>>(StreamBuffer &s, std::vector< T > &v)
Definition: StreamBuffer.h:624