hamcast  Version 0.7
Public Member Functions | List of all members
hamcast::util::sink Struct Referenceabstract

#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 >

Public Member Functions

virtual void write (size_t buf_size, const void *buf)=0
 
virtual void flush ()=0
 
virtual int flush_hint () const
 
- Public Member Functions inherited from hamcast::util::closeable
virtual void close ()=0
 
virtual bool closed () const =0
 
- Public Member Functions inherited from hamcast::ref_counted
long ref_count ()
 

Additional Inherited Members

- Static Public Member Functions inherited from hamcast::ref_counted
static void add_ref (ref_counted *rc)
 
static void release (ref_counted *rc)
 
- Protected Member Functions inherited from hamcast::ref_counted
 ref_counted ()
 
void ref ()
 
bool deref ()
 

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
Anyexception that might be thrown by write().

Implemented in hamcast::util::write_buffer< block_size, maximum_size >, and hamcast::util::buffered_sink< 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_sizeThe number of bytes that should be written from buf.
bufThe buffer.
Exceptions
ios_base::failureon errors (e.g. if the sink is closed)

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


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