S3FC project page S3FC home page

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

s3_streamable Class Reference

#include <s3_streamable.h>

Inheritance diagram for s3_streamable:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual const char * get_magic_string () const=0
 Return the magic string. More...

virtual void pack (s3_pack_buffer &v) const=0
 Pack this instance into the supplied vector. More...

virtual void unpack (const s3_pack_buffer &v)=0
 Initialise this instance from the packed data in the supplied vector. More...


Static Public Methods

template<typename T> void pack (T const &t, s3_pack_buffer &b)
 Pack the supplied POD type into the supplied s3_pack_buffer. More...

template<typename T> void unpack (T const &t, const s3_pack_buffer &b)
 Unpack the supplied POD type from the supplied s3_pack_buffer into the supplied argument. More...

template<typename T> void pack_array (T *const &t, s3_pack_buffer &b, size_t n)
 Pack an array of the supplied POD type into the supplied s3_pack_buffer. More...

template<typename T> void unpack_array (T *const &t, const s3_pack_buffer &b, bool inplace)
 Unpack an array of the supplied POD type from the supplied s3_pack_buffer. More...

template<typename T> void pack_array (const T *const &t, s3_pack_buffer &b, size_t n)
 const T version of pack_array. More...

template<typename T> void unpack_array (const T *const &t, const s3_pack_buffer &b, bool inplace)
 const T version of unpack_array. More...


Static Private Methods

template<typename T> void pack (const T *t, s3_pack_buffer &b, size_t n)
template<typename T> void unpack (const T *&t, const s3_pack_buffer &b)
template<typename T> void unpack (T *&t, const s3_pack_buffer &b)
template<typename T> void unpack (T *const &t, const s3_pack_buffer &b)
template<typename T> void unpack (const T *const &t, const s3_pack_buffer &b)

Member Function Documentation

virtual const char* s3_streamable::get_magic_string   const [pure virtual]
 

Return the magic string.

template<typename T>
void s3_streamable::pack const T *    t,
s3_pack_buffer   b,
size_t    n
[static, private]
 

template<typename T>
void s3_streamable::pack T const &    t,
s3_pack_buffer   b
[static]
 

Pack the supplied POD type into the supplied s3_pack_buffer.

Parameters:
t  Instance to pack.
b  Buffer to pack into.

Definition at line 163 of file s3_streamable.tcc.

References s3_streamable_dispatcher::pack.

virtual void s3_streamable::pack s3_pack_buffer   v const [pure virtual]
 

Pack this instance into the supplied vector.

The vector is resized if it is unable to contain the packed data.

Implemented in s3_message.

Referenced by s3_txport_tcp_tx_task::main_loop, s3_streamable_helper_stl::pack, s3_message::pack, and s3_streamable_helper_other< std::string >::pack.

template<typename T>
void s3_streamable::pack_array const T *const &    t,
s3_pack_buffer   b,
size_t    n
[static]
 

const T version of pack_array.

Definition at line 193 of file s3_streamable.tcc.

References s3_streamable_dispatcher::pack_array.

template<typename T>
void s3_streamable::pack_array T *const &    t,
s3_pack_buffer   b,
size_t    n
[static]
 

Pack an array of the supplied POD type into the supplied s3_pack_buffer.

Parameters:
t  Pointer to array of T 's to pack.
b  Buffer to pack into.
n  Number of elements in array.

Definition at line 177 of file s3_streamable.tcc.

References s3_streamable_dispatcher::pack_array.

template<typename T>
void s3_streamable::unpack const T *const &    t,
const s3_pack_buffer   b
[static, private]
 

template<typename T>
void s3_streamable::unpack T *const &    t,
const s3_pack_buffer   b
[static, private]
 

template<typename T>
void s3_streamable::unpack T *&    t,
const s3_pack_buffer   b
[static, private]
 

template<typename T>
void s3_streamable::unpack const T *&    t,
const s3_pack_buffer   b
[static, private]
 

template<typename T>
void s3_streamable::unpack T const &    t,
const s3_pack_buffer   b
[static]
 

Unpack the supplied POD type from the supplied s3_pack_buffer into the supplied argument.

Parameters:
t  Instance to initialise from packed data.
b  Buffer containing packed data.

Definition at line 170 of file s3_streamable.tcc.

References s3_streamable_dispatcher::unpack.

virtual void s3_streamable::unpack const s3_pack_buffer   v [pure virtual]
 

Initialise this instance from the packed data in the supplied vector.

Implemented in s3_message.

Referenced by s3_txport_tcp_rx_task::main_loop, s3_streamable_helper_other< std::string >::unpack, s3_streamable_helper_stl::unpack, and s3_message::unpack.

template<typename T>
void s3_streamable::unpack_array const T *const &    t,
const s3_pack_buffer   b,
bool    inplace
[static]
 

const T version of unpack_array.

Definition at line 200 of file s3_streamable.tcc.

References s3_streamable_dispatcher::unpack_array.

template<typename T>
void s3_streamable::unpack_array T *const &    t,
const s3_pack_buffer   b,
bool    inplace
[static]
 

Unpack an array of the supplied POD type from the supplied s3_pack_buffer.

This call either operates inplace, on an existing (allocated) buffer, or allocates the required storage, using operator new[]. In either case, the caller owns the storage, and is therefore responsible for deallocation (via delete[]). No deallocation function is ever called called by this function.

In the case of inplace operation , caller should ensure that the supplied pointer points to a buffer of sufficient size to contain the unpacked data. The pointer argument remains untouched.

During non-inplace operation, the supplied pointer is set to point to the newly allocated block of memory and the value that the pointer held upon entry is discarded.

Parameters:
t  Pointer to data buffer. This points to the start of an unpacked array upon return of this call. If the inplace flag is set to false, the value of this pointer is modified.
b  Buffer containing packed data.
inplace  The inplace flag:
  • true t points to a valid allocated buffer that should simply be initialised.
  • false t should be assigned to the start of a newly-allocated buffer.

Definition at line 184 of file s3_streamable.tcc.

References s3_streamable_dispatcher::unpack_array.


The documentation for this class was generated from the following files:
Send comments to: s3fc@stonethree.com SourceForge Logo