S3FC project page S3FC home page

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

s3_streamable_helper_pod Struct Template Reference

Note: Never call any function in this class directly - these should only be called from s3_streamable_dispatcher<T, s3_typegroup_pod>. More...

#include <s3_streamable.h>

List of all members.

Static Public Methods

void pack (const T &t, s3_pack_buffer &b)
 Pack the memory footprint of t into b, at the current position. More...

void unpack (T &t, const s3_pack_buffer &b)
 Unpack a new instance of T, from the current position of b. More...

void pack_array (const T *const &t, s3_pack_buffer &b, const size_t &n)
 Pack an array of POD types into b at the current position. More...

void unpack_array (T *&t, const s3_pack_buffer &b, bool inplace)
 Instantiate a new array of POD types T and initialise from @c. More...


Detailed Description

template<typename T>
struct s3_streamable_helper_pod< T >

Note: Never call any function in this class directly - these should only be called from s3_streamable_dispatcher<T, s3_typegroup_pod>.

Helper class handling packing of the following POD types

A template specialisation is required for non-POD types not derived from s3_streamable that needs to be packed. This is accomplished by extracting all the relevant data in packable form and packing this during the packing. The unpacking is accomplished by extracting the packed data and configuring or constructing an instance from this data.

Definition at line 252 of file s3_streamable.h.


Member Function Documentation

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

Pack the memory footprint of t into b, at the current position.

This does not currently provide a cross-platform solution. Note: This should only be invoked with T a POD type.

Parameters:
t  Instance of T to pack.
b  s3_packed_data instance to pack t into.

Definition at line 34 of file s3_streamable.tcc.

References s3_pack_buffer::copy_in.

Referenced by s3_streamable_dispatcher::pack.

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

Pack an array of POD types into b at the current position.

Parameters:
t  Pointer to array of T to pack.
b  s3_packed_data instance to pack the array into.
n  Number of elements in the array.

Definition at line 58 of file s3_streamable.tcc.

References s3_pack_buffer::copy_in.

Referenced by s3_streamable_dispatcher::pack_array.

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

Unpack a new instance of T, from the current position of b.

Parameters:
t  Instance of T to unpack into.
b  s3_packed_data instance containing T.

Definition at line 47 of file s3_streamable.tcc.

References s3_pack_buffer::copy_out.

Referenced by s3_streamable_dispatcher::unpack.

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

Instantiate a new array of POD types T and initialise from @c.

Set the T pointer to point to the new initialised array.

Note:

  • The caller owns the storage allocated during this call.
  • The storage pointed to by t when entering this call is not deallocated, the current value of t is simply overwritten.
Parameters:
t  Pointer that points to array when\ this function returns.
b  s3_packed_data instance containing the T.

Definition at line 75 of file s3_streamable.tcc.

References s3_pack_buffer::copy_out.

Referenced by s3_streamable_dispatcher::unpack_array.


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