#include <PackableStream.h>

Inheritance diagram for PackableStreamBuf:
Collaboration diagram for PackableStreamBuf:

Public Member Functions

 PackableStreamBuf (Packable &p)
 
virtual ~PackableStreamBuf ()=default
 

Protected Member Functions

virtual int_type overflow (int_type aChar=traits_type::eof()) override
 
virtual int sync () override
 
virtual std::streamsize xsputn (const char *chars, std::streamsize number) override
 

Private Member Functions

void lowAppend (const char *s, const std::streamsize n)
 

Private Attributes

Packablebuf_
 

Detailed Description

Provides a streambuf interface for writing to Packable objects. Typical use is via a PackableStream rather than direct manipulation

Definition at line 20 of file PackableStream.h.

Constructor & Destructor Documentation

PackableStreamBuf::PackableStreamBuf ( Packable p)
inlineexplicit

Definition at line 23 of file PackableStream.h.

References buf_, and Packable::buffer().

virtual PackableStreamBuf::~PackableStreamBuf ( )
virtualdefault

Member Function Documentation

void PackableStreamBuf::lowAppend ( const char *  s,
const std::streamsize  n 
)
inlineprivate

Definition at line 62 of file PackableStream.h.

References Packable::append(), and buf_.

Referenced by overflow(), sync(), and xsputn().

virtual int_type PackableStreamBuf::overflow ( int_type  aChar = traits_type::eof())
inlineoverrideprotectedvirtual

flush the current buffer and the character that is overflowing to the Packable.

Definition at line 30 of file PackableStream.h.

References lowAppend(), and sync().

virtual int PackableStreamBuf::sync ( )
inlineoverrideprotectedvirtual

push the buffer to the Packable

Definition at line 46 of file PackableStream.h.

References buf_, Packable::flush(), and lowAppend().

Referenced by overflow().

virtual std::streamsize PackableStreamBuf::xsputn ( const char *  chars,
std::streamsize  number 
)
inlineoverrideprotectedvirtual

write multiple characters to the Packable

  • this is an optimisation method.

Definition at line 56 of file PackableStream.h.

References lowAppend().

Member Data Documentation

Packable& PackableStreamBuf::buf_
private

Definition at line 64 of file PackableStream.h.

Referenced by lowAppend(), PackableStreamBuf(), and sync().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors