Public Member Functions

hamcast::util::serializer Class Reference

Serializes objects to a given sink. More...

#include <serializer.hpp>

List of all members.

Public Member Functions

 serializer ()
 serializer (const boost::intrusive_ptr< sink > &sink_ptr)
void reset (const boost::intrusive_ptr< sink > &new_sink)
void write (size_t buf_size, const void *buf)
void flush ()

Detailed Description

Serializes objects to a given sink.


Constructor & Destructor Documentation

hamcast::util::serializer::serializer (  ) 

Create a serializer with no data sink.

hamcast::util::serializer::serializer ( const boost::intrusive_ptr< sink > &  sink_ptr  )  [explicit]

Create a serializer that writes from sink_ptr.

Parameters:
sink_ptr The used data sink.
Precondition:
sink_ptr.get() != NULL.

Member Function Documentation

void hamcast::util::serializer::flush (  ) 

Flush all internal buffers of the used data sink.

void hamcast::util::serializer::reset ( const boost::intrusive_ptr< sink > &  new_sink  ) 

Change the used data sink.

Parameters:
new_sink The new data sink for this.
void hamcast::util::serializer::write ( size_t  buf_size,
const void *  buf 
)

Write buf_size bytes from buf to the sink.

Parameters:
buf_size Size of buf in bytes.
buf C-buffer that contains the outgoing bytes.
Precondition:
buf_size > 0 && buf != NULL.

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