The Gaudi Framework  v37r0 (b608885e)
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 315 of file StreamBuffer.h.

◆ STREAM_ANALYSE

#define STREAM_ANALYSE (   data,
  len 
)

Definition at line 311 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 636 of file StreamBuffer.h.

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

◆ operator<<() [2/2]

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

Definition at line 614 of file StreamBuffer.h.

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

◆ operator>>() [1/2]

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

Definition at line 644 of file StreamBuffer.h.

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

◆ operator>>() [2/2]

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

Definition at line 622 of file StreamBuffer.h.

622  {
623  long i, len;
624  s >> len;
625  v.clear();
626  for ( i = 0; i < len; i++ ) {
627  T temp;
628  s >> temp;
629  v.push_back( temp );
630  }
631  return s;
632 }
gaudirun.s
string s
Definition: gaudirun.py:348
operator<<
StreamBuffer & operator<<(StreamBuffer &s, const std::vector< T > &v)
Definition: StreamBuffer.h:614
gaudirun.l
dictionary l
Definition: gaudirun.py:582
Properties.v
v
Definition: Properties.py:123
operator>>
StreamBuffer & operator>>(StreamBuffer &s, std::vector< T > &v)
Definition: StreamBuffer.h:622