The Gaudi Framework  v30r3 (a5ef0a68)
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

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

Definition at line 323 of file StreamBuffer.h.

#define STREAM_ANALYSE (   data,
  len 
)

Definition at line 319 of file StreamBuffer.h.

Function Documentation

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

Definition at line 660 of file StreamBuffer.h.

661 {
662  s << v.size();
663  for ( const auto& i : v ) s << i;
664  return s;
665 }
T size(T...args)
string s
Definition: gaudirun.py:253
template<class T >
StreamBuffer& operator<< ( StreamBuffer s,
const std::list< T > &  l 
)
inline

Definition at line 684 of file StreamBuffer.h.

685 {
686  s << l.size();
687  for ( const auto& i : l ) s << i;
688  return s;
689 }
T size(T...args)
string s
Definition: gaudirun.py:253
template<class T >
StreamBuffer& operator>> ( StreamBuffer s,
std::vector< T > &  v 
)
inline

Definition at line 669 of file StreamBuffer.h.

670 {
671  long i, len;
672  s >> len;
673  v.clear();
674  for ( i = 0; i < len; i++ ) {
675  T temp;
676  s >> temp;
677  v.push_back( temp );
678  }
679  return s;
680 }
T push_back(T...args)
T clear(T...args)
string s
Definition: gaudirun.py:253
template<class T >
StreamBuffer& operator>> ( StreamBuffer s,
std::list< T > &  l 
)
inline

Definition at line 693 of file StreamBuffer.h.

694 {
695  long len;
696  s >> len;
697  l.clear();
698  for ( long i = 0; i < len; i++ ) {
699  T temp;
700  s >> temp;
701  l.push_back( temp );
702  }
703  return s;
704 }
T push_back(T...args)
T clear(T...args)
string s
Definition: gaudirun.py:253