The Gaudi Framework  master (d98a2936)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
StreamBuffer.h File Reference
#include <GaudiKernel/Kernel.h>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <string>
#include <typeinfo>
#include <unistd.h>
#include <vector>
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 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::list< T > &  l 
)
inline

Definition at line 631 of file StreamBuffer.h.

631  {
632  s << l.size();
633  for ( const auto& i : l ) s << i;
634  return s;
635 }

◆ operator<<() [2/2]

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

Definition at line 609 of file StreamBuffer.h.

609  {
610  s << v.size();
611  for ( const auto& i : v ) s << i;
612  return s;
613 }

◆ operator>>() [1/2]

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

Definition at line 639 of file StreamBuffer.h.

639  {
640  long len;
641  s >> len;
642  l.clear();
643  for ( long i = 0; i < len; i++ ) {
644  T temp;
645  s >> temp;
646  l.push_back( temp );
647  }
648  return s;
649 }

◆ operator>>() [2/2]

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

Definition at line 617 of file StreamBuffer.h.

617  {
618  long i, len;
619  s >> len;
620  v.clear();
621  for ( i = 0; i < len; i++ ) {
622  T temp;
623  s >> temp;
624  v.push_back( temp );
625  }
626  return s;
627 }
gaudirun.s
string s
Definition: gaudirun.py:346
operator<<
StreamBuffer & operator<<(StreamBuffer &s, const std::vector< T > &v)
Definition: StreamBuffer.h:609
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:617