Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

byte_consumer Class Reference

base class for output streams provides all the functionality except writing bytes into output stream More...

#include <storexml.h>

Inheritance diagram for byte_consumer:

memory_output_stream stream_output_file

List of all members.

Public Member Functions

 byte_consumer (mem_pool_t &small_pool, mem_pool_t &big_pool, size_t xml_size)
 constructor
virtual ~byte_consumer ()
 destructor
void push (const ub1_t *x, size_t len)
 inserts into tail of sequence
void push (ub1_t x)
 inserts one symbol
void push (const char *x)
 inserts string
size_t get_xml_size () const
 returns xml size
size_t get_buffer_pos () const
 returns buffer position
void flush ()
 flushes buffer to output stream

Protected Member Functions

virtual bool data_persist (const ub1_t *buf, size_t len)=0
 pure virtual function writes buffer to the output stream

Private Attributes

byte_allocator_depot_allocator
 depot allocator
mem_pool_t_small_pool
 small memory pool
mem_pool_t_big_pool
 big memory pool
const size_t _xml_size
 xml size
ub1_t_buffer
 internal buffer
size_t _buffer_pos
 internal buffer position


Detailed Description

base class for output streams provides all the functionality except writing bytes into output stream

Definition at line 246 of file storexml.h.


Constructor & Destructor Documentation

byte_consumer::byte_consumer ( mem_pool_t small_pool,
mem_pool_t big_pool,
size_t  xml_size 
)

constructor

Parameters:
small_pool  small memory pool
big_pool  big memory pool
xml_size  xml size - just a tip

Definition at line 1018 of file storexml.cpp.

References _big_pool, _buffer, _depot_allocator, _small_pool, _xml_size, byte_allocator::allocate(), pool< C >::loan_object(), and os_def_size.

byte_consumer::~byte_consumer (  )  [virtual]

destructor

Definition at line 1033 of file storexml.cpp.

References _big_pool, _depot_allocator, _small_pool, _xml_size, os_def_size, and pool< C >::return_object().


Member Function Documentation

void byte_consumer::push ( ub1_t  x  )  [inline]

inserts one symbol

Parameters:
x  symbol

Definition at line 165 of file storexml.hpp.

References push().

void byte_consumer::push ( const char *  x  )  [inline]

inserts string

Parameters:
x  string

Definition at line 172 of file storexml.hpp.

References push(), and str_template::strlen().

size_t byte_consumer::get_xml_size (  )  const [inline]

returns xml size

Definition at line 182 of file storexml.hpp.

References _xml_size.

size_t byte_consumer::get_buffer_pos (  )  const [inline]

returns buffer position

Definition at line 189 of file storexml.hpp.

References _buffer_pos.

void byte_consumer::flush (  ) 

flushes buffer to output stream

Definition at line 1066 of file storexml.cpp.

References _buffer, _buffer_pos, exception::_throw(), and data_persist().

Referenced by xml_persistor::persist().

virtual bool byte_consumer::data_persist ( const ub1_t buf,
size_t  len 
) [protected, pure virtual]

pure virtual function writes buffer to the output stream

Parameters:
buf  buffer
len  buffer length

Implemented in memory_output_stream, and stream_output_file.

Referenced by flush(), and push().


Member Data Documentation

depot allocator

Definition at line 294 of file storexml.h.

Referenced by byte_consumer(), and ~byte_consumer().

small memory pool

Definition at line 295 of file storexml.h.

Referenced by byte_consumer(), and ~byte_consumer().

big memory pool

Definition at line 296 of file storexml.h.

Referenced by byte_consumer(), and ~byte_consumer().

const size_t byte_consumer::_xml_size [private]

xml size

Definition at line 297 of file storexml.h.

Referenced by byte_consumer(), get_xml_size(), push(), and ~byte_consumer().

internal buffer

Definition at line 298 of file storexml.h.

Referenced by byte_consumer(), flush(), and push().

size_t byte_consumer::_buffer_pos [private]

internal buffer position

Definition at line 299 of file storexml.h.

Referenced by flush(), get_buffer_pos(), and push().


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


© Copyright Terimber 2003-.