| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Private Attributes | List of all members
StreamBuffer::Istream Class Reference

Reader for standard input streams. More...

`#include <GaudiKernel/StreamBuffer.h>`

Inheritance diagram for StreamBuffer::Istream:
[legend]
Collaboration diagram for StreamBuffer::Istream:
[legend]

## Public Member Functions
| Istream (std::istream &str)
| Constructor. More...
void | load (StreamBuffer &stream) override
| Data load method. More...
Public Member Functions inherited from StreamBuffer::DataIO
| DataIO ()=default
| Standard constructor. More...
virtual | ~DataIO ()=default
| Standard destructor. More...
void | badStreamMode ()
| Throw Exception. More...
virtual void | serialize (StreamBuffer &stream)
| Serialization method: loads/dumps streambuffer content. More...
virtual void | dump (StreamBuffer &)
| Template function to save stream data. More...

## Private Attributes
std::istream * | m_stream
| Reference to input stream. More...

## Detailed Description

Reader for standard input streams.

Definition at line 69 of file StreamBuffer.h.

## Constructor & Destructor Documentation

## ◆ Istream()

StreamBuffer::Istream::Istream | ( | std::istream & | str | ) |
| inline

Constructor.

Definition at line 75 of file StreamBuffer.h.

75 : m_stream( &str ) {}
StreamBuffer::Istream::m_stream
std::istream * m_stream
Reference to input stream.
Definition: StreamBuffer.h:71

## Member Function Documentation

## ◆ load()

void StreamBuffer::Istream::load | ( | StreamBuffer & | stream | ) |
| inline override virtual

Data load method.

Reimplemented from StreamBuffer::DataIO.

Definition at line 78 of file StreamBuffer.h.

78 {
79 // Generic implementation for istreams:
80 int len;
81 ( *m_stream ) >> len;
82 stream.erase();
83 stream.reserve( len );
84 m_stream->read( stream.data(), len );
85 }
StreamBuffer::Istream::m_stream
std::istream * m_stream
Reference to input stream.
Definition: StreamBuffer.h:71
StreamBuffer::reserve
void reserve(long len)
Reserve buffer space; Default: 16 k buffer size.
Definition: StreamBuffer.h:213
StreamBuffer::data
const char * data() const
Read access to data buffer.
Definition: StreamBuffer.h:197
std::istream::read
T read(T... args)
StreamBuffer::erase
void erase()
Reset the buffer.
Definition: StreamBuffer.h:201

## Member Data Documentation

## ◆ m_stream

std::istream* StreamBuffer::Istream::m_stream
| private

Reference to input stream.

Definition at line 71 of file StreamBuffer.h.

The documentation for this class was generated from the following file:

- GaudiKernel/GaudiKernel/StreamBuffer.h