hamcast  Version 0.7
Public Member Functions | List of all members
hamcast::util::serializer Class Reference

#include <serializer.hpp>

Inherits noncopyable.

Public Member Functions

 serializer ()
 
 serializer (const intrusive_ptr< sink > &sink_ptr)
 
void reset (const 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 intrusive_ptr< sink > &  sink_ptr)
explicit

Create a serializer that writes from sink_ptr.

Parameters
sink_ptrThe 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 intrusive_ptr< sink > &  new_sink)

Change the used data sink.

Parameters
new_sinkThe 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_sizeSize of buf in bytes.
bufC-buffer that contains the outgoing bytes.
Precondition
buf_size > 0 && buf != NULL.

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