Public Member Functions

hamcast::util::sink Struct Reference

Describes an abstract (binary) data sink. More...

#include <sink.hpp>

Inheritance diagram for hamcast::util::sink:
hamcast::util::closeable hamcast::ref_counted hamcast::util::buffered_sink< block_size, maximum_size > hamcast::util::write_buffer< block_size, maximum_size >

List of all members.

Public Member Functions

virtual void write (size_t buf_size, const void *buf)=0
virtual void flush ()=0
virtual int flush_hint () const

Detailed Description

Describes an abstract (binary) data sink.


Member Function Documentation

virtual void hamcast::util::sink::flush (  )  [pure virtual]

Force the data sink to flush any buffers.

Exceptions:
Any exception that might be thrown by write().

Implemented in hamcast::util::buffered_sink< block_size, maximum_size >, and hamcast::util::write_buffer< block_size, maximum_size >.

int hamcast::util::sink::flush_hint (  )  const [virtual]

Return the optimal block size for write operations.

Returns:
A value > 0 if this device has an optimal block size; otherwise (default implementation) 0 is returned.

Reimplemented in hamcast::util::buffered_sink< block_size, maximum_size >.

virtual void hamcast::util::sink::write ( size_t  buf_size,
const void *  buf 
) [pure virtual]

Writes buf_size bytes from buf to the sink.

Parameters:
buf_size The number of bytes that should be written from buf.
buf The buffer.
Exceptions:
ios_base::failure on errors (e.g. if the sink is closed)

Implemented in hamcast::util::buffered_sink< block_size, maximum_size >, and hamcast::util::write_buffer< block_size, maximum_size >.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator