Alchemy  1.0
A framework to robustly process network messages and structured data
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Static Public Member Functions | List of all members
Hg::StaticStoragePolicy< IsBufferedT > Struct Template Reference

Storage Policy implementation for fixed-size memory buffers. More...

#include <static_storage_policy.h>

Inherits integral_constant< bool, IsBufferedT >.

Static Public Member Functions

static s_pointer allocate (size_t size)
 Not Implemented. This is a fixed-size static storage policy;. More...
 
static void deallocate (s_pointer &spBuffer)
 Not Implemented. This is a fixed-size static storage policy.
 
static bool read (const_pointer pBuffer, void *pStorage, size_t size, std::ptrdiff_t offset)
 Performs a storage read operation for this policy. More...
 
static bool write (pointer pBuffer, const void *pStorage, size_t size, std::ptrdiff_t offset)
 Performs a storage write operation for this policy. More...
 

Detailed Description

template<bool IsBufferedT>
struct Hg::StaticStoragePolicy< IsBufferedT >

Storage Policy implementation for fixed-size memory buffers.

Template Parameters
IsBufferedTIndicates if the StoragePolicy desires data to be buffered, or accessed on demand.

Note: The policy itself is not responsible, and does not buffer the data. It is an indication to users of the policy, for how the best way to access the storage memory.

For example, storage policies developed to interface directly with hardware mapped memory access would indicate not to be buffered. However, a network packet buffer, which can vary in size between calls would indicate buffering is preferred.

Definition at line 34 of file static_storage_policy.h.

Member Function Documentation

template<bool IsBufferedT>
static s_pointer Hg::StaticStoragePolicy< IsBufferedT >::allocate ( size_t  size)
inlinestatic

Not Implemented. This is a fixed-size static storage policy;.

Returns
0.

Definition at line 50 of file static_storage_policy.h.

template<bool IsBufferedT>
static bool Hg::StaticStoragePolicy< IsBufferedT >::read ( const_pointer  pBuffer,
void *  pStorage,
size_t  size,
std::ptrdiff_t  offset 
)
inlinestatic

Performs a storage read operation for this policy.

Parameters
sp_bufferA shared pointer to a buffer previously allocated by this storage policies Allocate member function.
p_storageThe source memory buffer to read from.
sizeThe number of elements read from the buffer.
offsetA starting offset from the beginning of the specified read/write buffer.
Returns
This function will always return true. Other policy implementations may need to indicate failure.

Definition at line 78 of file static_storage_policy.h.

template<bool IsBufferedT>
static bool Hg::StaticStoragePolicy< IsBufferedT >::write ( pointer  pBuffer,
const void *  pStorage,
size_t  size,
std::ptrdiff_t  offset 
)
inlinestatic

Performs a storage write operation for this policy.

Parameters
sp_bufferA shared pointer to a buffer previously allocated by this storage policies Allocate member function.
p_storageThe source memory buffer to supply the data written into sp_buffer;
sizeThe number of elements write into the buffer.
offsetA starting offset from the beginning of the specified read/write buffer.
Returns
This function will always return true. Other policy implementations may need to indicate failure.

Definition at line 105 of file static_storage_policy.h.


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