The Gaudi Framework  master (e68eea06)
Loading...
Searching...
No Matches
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
 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; \
}
std::ostream & operator<<(std::ostream &s, AlgsExecutionStates::State x)
Streaming of State values.
StreamBuffer & operator>>(StreamBuffer &s, std::vector< T > &v)
The stream buffer is a small object collecting object data.

Definition at line 316 of file StreamBuffer.h.

316#define IMPLEMENT_STREAMER( TYPE ) \
317 /* Output Streamer */ \
318 StreamBuffer& operator<<( TYPE data ) { \
319 swapToBuffer( &data, sizeof( data ) ); \
320 STREAM_ANALYSE( data, sizeof( data ) ); \
321 return *this; \
322 } \
323 /* Input Streamer */ \
324 StreamBuffer& operator>>( TYPE& data ) { \
325 swapFromBuffer( &data, sizeof( data ) ); \
326 return *this; \
327 }

◆ STREAM_ANALYSE

#define STREAM_ANALYSE ( data,
len )

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

635 {
636 s << l.size();
637 for ( const auto& i : l ) s << i;
638 return s;
639}
dict l
Definition gaudirun.py:583

◆ operator<<() [2/2]

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

Definition at line 613 of file StreamBuffer.h.

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

◆ operator>>() [1/2]

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

Definition at line 643 of file StreamBuffer.h.

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

◆ operator>>() [2/2]

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

Definition at line 621 of file StreamBuffer.h.

621 {
622 long i, len;
623 s >> len;
624 v.clear();
625 for ( i = 0; i < len; i++ ) {
626 T temp;
627 s >> temp;
628 v.push_back( temp );
629 }
630 return s;
631}