| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 2010

# StreamBuffer.h File Reference

`#include <list>`
`#include <vector>`
`#include <string>`
`#include <iostream>`
`#include <cstring>`
`#include <cstdlib>`
`#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...
## Defines
#define | GAUDIKERNEL_STREAMBUFFER_H 1
#define | STREAM_ANALYSE(data, len)
#define | IMPLEMENT_STREAMER(TYPE)
## Functions
template<class T>
StreamBuffer & | operator<< (StreamBuffer &s, const std::vector< T > &v)
template<class T>
StreamBuffer & | operator>> (StreamBuffer &s, std::vector< T > &v)
template<class T>
StreamBuffer & | operator<< (StreamBuffer &s, const std::list< T > &l)
template<class T>
StreamBuffer & | operator>> (StreamBuffer &s, std::list< T > &l)

## Define Documentation

#define GAUDIKERNEL_STREAMBUFFER_H 1

Definition at line 3 of file StreamBuffer.h.

#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 342 of file StreamBuffer.h.

#define STREAM_ANALYSE | ( | data,
|  | len |  | ) |

Definition at line 338 of file StreamBuffer.h.

## Function Documentation

template<class T>

StreamBuffer& operator<< | ( | StreamBuffer & | s,
|  | const std::list< T > & | l |
| ) |  |  | `[inline]`

Definition at line 667 of file StreamBuffer.h.

    00667                                                                   {
    00668   s << l.size();
    00669   for ( typename std::list<T>::const_iterator i = l.begin(); i != l.end(); i++ )  {
    00670     s << (*i);
    00671   }
    00672   return s;
    00673 }

template<class T>

StreamBuffer& operator<< | ( | StreamBuffer & | s,
|  | const std::vector< T > & | v |
| ) |  |  | `[inline]`

Definition at line 643 of file StreamBuffer.h.

    00643                                                                     {
    00644   s << v.size();
    00645   for ( typename std::vector<T>::const_iterator i = v.begin(); i != v.end(); i++ )  {
    00646     s << (*i);
    00647   }
    00648   return s;
    00649 }

template<class T>

StreamBuffer& operator>> | ( | StreamBuffer & | s,
|  | std::list< T > & | l |
| ) |  |  | `[inline]`

Definition at line 677 of file StreamBuffer.h.

    00677                                                             {
    00678   long i, len;
    00679   s >> len;
    00680   l.clear();
    00681   for ( i = 0; i < len; i++ )  {
    00682     T    temp;
    00683     s >> temp;
    00684     l.push_back(temp);
    00685   }
    00686   return s;
    00687 }

template<class T>

StreamBuffer& operator>> | ( | StreamBuffer & | s,
|  | std::vector< T > & | v |
| ) |  |  | `[inline]`

Definition at line 653 of file StreamBuffer.h.

    00653                                                               {
    00654   long i, len;
    00655   s >> len;
    00656   v.clear();
    00657   for ( i = 0; i < len; i++ )  {
    00658     T    temp;
    00659     s >> temp;
    00660     v.push_back(temp);
    00661   }
    00662   return s;
    00663 }