basic_membuf< _CharT, _Traits > Class Template Reference
[Shared memory buffering]

Memory STL stream buffer. More...

#include <memstream.hh>

List of all members.

Public Types

typedef _CharT char_type
 Character data type.
typedef _Traits traits_type
 Trait data type.
typedef traits_type::int_type int_type
 Integer type.
typedef traits_type::pos_type pos_type
 Position type.
typedef traits_type::off_type off_type
 Offset type.
typedef std::basic_streambuf
< char_type, traits_type
_streambuf_type
 Stream buffer type.

Public Member Functions

 basic_membuf (std::ios_base::openmode __mode=std::ios_base::out)
 Default constructor.
 basic_membuf (char_type *buf, int_type len, std::ios_base::openmode __mode=std::ios_base::out)
 Open constructor.
virtual ~basic_membuf (void)
 Destructor.

Protected Member Functions

virtual int_type underflow (void)
 Buffer underflow handler.
virtual int_type overflow (void)
 Buffer overflow handler.
virtual int_type pbackfail (int_type c)
 Put-back failure handler.
virtual pos_type seekoff (off_type off, std::ios_base::seekdir way, std::ios_base::openmode mode)
 Seek a specified offset.
virtual pos_type seekpos (pos_type sp, std::ios_base::openmode mode)
 Seek a specified position.
virtual basic_membuf< _CharT,
_Traits > * 
setbuf (char_type *buf, int_type len)
 Set the buffer pointer.
virtual int sync (void)
 STL streambuf::sync.


Detailed Description

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
class basic_membuf< _CharT, _Traits >

Memory STL stream buffer.

An STL stream buffer to read/write data to/from a memory buffer

Author:
John Zweizig
Version:
1.0; Last Modified Marc 3, 2008

Constructor & Destructor Documentation

template<typename _CharT, typename _Traits>
basic_membuf< _CharT, _Traits >::basic_membuf ( std::ios_base::openmode  __mode = std::ios_base::out  )  [inline]

Default constructor.

Construct a closed membuf stream.

Parameters:
__mode Input/output mode.

template<typename _CharT, typename _Traits>
basic_membuf< _CharT, _Traits >::basic_membuf ( char_type buf,
int_type  len,
std::ios_base::openmode  __mode = std::ios_base::out 
) [inline]

Open constructor.

Construct a membuf stream and open it on a specified buffer.

Parameters:
__mode Input/output mode.
buf Buffer pointer.
len Buffer data length.

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
virtual basic_membuf< _CharT, _Traits >::~basic_membuf ( void   )  [inline, virtual]

Destructor.

Destroy the stream buffer.


Member Function Documentation

template<typename _CharT, typename _Traits>
basic_membuf< _CharT, _Traits >::int_type basic_membuf< _CharT, _Traits >::underflow ( void   )  [inline, protected, virtual]

Buffer underflow handler.

Handle a buffer underflow.

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
virtual int_type basic_membuf< _CharT, _Traits >::overflow ( void   )  [inline, protected, virtual]

Buffer overflow handler.

Handle a buffer overflow.

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
virtual int_type basic_membuf< _CharT, _Traits >::pbackfail ( int_type  c  )  [inline, protected, virtual]

Put-back failure handler.

Handle put-back failure.

template<typename _CharT, typename _Traits>
basic_membuf< _CharT, _Traits >::pos_type basic_membuf< _CharT, _Traits >::seekoff ( off_type  off,
std::ios_base::seekdir  way,
std::ios_base::openmode  mode 
) [inline, protected, virtual]

Seek a specified offset.

Position read/write pointers to the specified offset.

template<typename _CharT, typename _Traits>
basic_membuf< _CharT, _Traits >::pos_type basic_membuf< _CharT, _Traits >::seekpos ( pos_type  sp,
std::ios_base::openmode  mode 
) [inline, protected, virtual]

Seek a specified position.

Position read/write pointers to the specified position.

template<typename _CharT, typename _Traits>
basic_membuf< _CharT, _Traits > * basic_membuf< _CharT, _Traits >::setbuf ( char_type buf,
int_type  len 
) [inline, protected, virtual]

Set the buffer pointer.

Set the buffer pointer and length.

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
virtual int basic_membuf< _CharT, _Traits >::sync ( void   )  [inline, protected, virtual]

STL streambuf::sync.

The synch method is supposed to synchronize the memory buffers to an external file. Since there are no external files in this case, the sync command is a no-operation.


The documentation for this class was generated from the following file:
Generated on Sun Mar 8 19:21:04 2009 for dmt by  doxygen 1.5.4