ucommon  7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
  Fossies Dox: ucommon-7.0.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

ucommon::StreamBuffer Class Reference

#include <stream.h>

Inheritance diagram for ucommon::StreamBuffer:
Collaboration diagram for ucommon::StreamBuffer:

Public Member Functions

int sync (void)
bool is_open (void) const
 operator bool () const
bool operator! () const

Protected Member Functions

 StreamBuffer ()
int uflow () __OVERRIDE
void release (void)
void allocate (size_t size)

Protected Attributes

size_t bufsize
char * gbuf
char * pbuf

Private Member Functions

 __DELETE_COPY (StreamBuffer)

Detailed Description

Common stream buffer for std C++ i/o classes. This both binds the character protocol to iostream and offers a common base class for all other c++ stdlib based streaming classes.

David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 64 of file stream.h.

Constructor & Destructor Documentation

◆ StreamBuffer()

ucommon::StreamBuffer::StreamBuffer ( )

Definition at line 56 of file stream.cpp.

References bufsize, gbuf, and pbuf.

Member Function Documentation


ucommon::StreamBuffer::__DELETE_COPY ( StreamBuffer  )

◆ allocate()

void ucommon::StreamBuffer::allocate ( size_t  size)

Definition at line 76 of file stream.cpp.

References bufsize, ucommon::clear(), gbuf, and pbuf.

Referenced by ucommon::tcpstream::allocate().

◆ is_open()

bool ucommon::StreamBuffer::is_open ( void  ) const

Definition at line 96 of file stream.h.

Referenced by main(), ucommon::sstream::open(), and ucommon::sstream::sstream().

◆ operator bool()

ucommon::StreamBuffer::operator bool ( ) const

Definition at line 99 of file stream.h.

◆ operator!()

bool ucommon::StreamBuffer::operator! ( void  ) const

Definition at line 102 of file stream.h.

◆ release()

void ucommon::StreamBuffer::release ( void  )

◆ sync()

int ucommon::StreamBuffer::sync ( void  )

Flush the stream input and output buffers, writes pending output.

0 on success, or error code.

Definition at line 116 of file stream.cpp.

References bufsize, EOF, and gbuf.

Referenced by ucommon::tcpstream::close(), ucommon::pipestream::close(), ucommon::filestream::close(), ucommon::filestream::rewind(), ucommon::filestream::seek(), and ucommon::sstream::sync().

◆ uflow()

int ucommon::StreamBuffer::uflow ( void  )

This streambuf method is used for doing unbuffered reads through the establish tcp socket connection when in interactive mode. Also this method will handle proper use of buffers if not in interactive mode.

char from tcp socket connection, EOF if not connected.

Definition at line 63 of file stream.cpp.

References bufsize, EOF, and IS_EOF.

Member Data Documentation

◆ bufsize

◆ gbuf

◆ pbuf

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