SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
sutil::CMemCopier< T > Class Template Reference

#include <CMemCopier.hpp>

Collaboration diagram for sutil::CMemCopier< T >:
Collaboration graph
[legend]

Public Member Functions

bool init (const T *arg_mem)
 
bool addBuf (T *arg_buf)
 
T * removeBuf (T *arg_buf)
 
bool copy ()
 

Private Attributes

const T * mem_
 
std::vector< T * > buf_
 
bool initialized_
 

Detailed Description

template<typename T>
class sutil::CMemCopier< T >

A template class that can memcpy its member data to a set of output buffers, whenever required.

Member Function Documentation

template<typename T >
bool sutil::CMemCopier< T >::addBuf ( T *  arg_buf)

Registers a "to" buffer with the mem copier. Whenever copy is called next, the memory will be copied into these buffer(s).

template<typename T >
bool sutil::CMemCopier< T >::copy ( )

Copies the memory into all the associated output buffers.

Returns
: true if succeeded, else false
template<typename T >
bool sutil::CMemCopier< T >::init ( const T *  arg_mem)

Initializes a mem copier "from" buffer

template<typename T >
T * sutil::CMemCopier< T >::removeBuf ( T *  arg_buf)

Function to de-register an output buffer.

Parameters
arg_buf: The pointer to the buffer to be removed
Returns
: Removed element if found. Null else.

Member Data Documentation

template<typename T >
std::vector<T*> sutil::CMemCopier< T >::buf_
private

The buffers into which the data is copied.

template<typename T >
bool sutil::CMemCopier< T >::initialized_
private

Is initialized?

template<typename T >
const T* sutil::CMemCopier< T >::mem_
private

Original data source which is copied to a buffer


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