fw4spl
fwDataTools::helper::ArrayGetter Class Reference

Helper to manage array buffer. Lock the buffer before to modify it. More...

#include <ArrayGetter.hpp>

Public Member Functions

FWDATATOOLS_API ArrayGetter (::fwData::Array::csptr array)
 
virtual FWDATATOOLS_API const void * getItem (const ::fwData::Array::IndexType &id, const size_t component=0) const
 Getter for a buffer item. pointer to the requested item in the buffer. More...
 
template<typename T >
const T * getItem (const ::fwData::Array::IndexType &id, const size_t component=0) const
 Typed version of getItem. More...
 
virtual FWDATATOOLS_API void getItem (const ::fwData::Array::IndexType &id, void *value) const
 Copies the data into the buffer pointed by More...
 
virtual FWDATATOOLS_API void getItem (const ::fwData::Array::IndexType &id, const size_t component, void *value) const
 
virtual FWDATATOOLS_API const void * getBuffer () const
 Getter for the array buffer. More...
 
virtual FWDATATOOLS_API const char * begin () const
 Returns the begining/end of the buffer interpreted as a char buffer.
 
virtual FWDATATOOLS_API const char * end () const
 
template<typename T >
const T * begin () const
 Returns the begining/end of the buffer, casted to T.
 
template<typename T >
const T * end () const
 
FWDATATOOLS_API const char * getBufferPtr (const ::fwData::Array::IndexType &id, size_t component, size_t sizeOfType) const
 Get a pointer to the value described by given parameters. More...
 
FWDATATOOLS_API::fwMemory::BufferObject::Lock getLock () const
 Returns a copy of current lock on array.
 

Protected Attributes

::fwData::Array::csptr m_array
 
::fwMemory::BufferObject::Lock m_lock
 

Friends

class ::boost::serialization::access
 
template<class , class >
struct ::boost::python::objects::pointer_holder
 
template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Detailed Description

Helper to manage array buffer. Lock the buffer before to modify it.

Definition at line 28 of file ArrayGetter.hpp.

Member Function Documentation

const void * fwDataTools::helper::ArrayGetter::getBuffer ( ) const
virtual

Getter for the array buffer.

Returns
Array's buffer, if exists, else NULL

Definition at line 30 of file ArrayGetter.cpp.

References fwMemory::BufferObject::LockBase< T >::getBuffer().

Referenced by Tuto16MultithreadConsole::SShowArray::updating(), and fwDataIO::writer::GzArrayWriter::write().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char * fwDataTools::helper::ArrayGetter::getBufferPtr ( const ::fwData::Array::IndexType id,
size_t  component,
size_t  sizeOfType 
) const

Get a pointer to the value described by given parameters.

Parameters
idItem id
componentItem component id
sizeOfTypesize of a component
Returns
buffer item pointer

Definition at line 51 of file ArrayGetter.cpp.

References fwDataTools::helper::Array::getBuffer().

+ Here is the call graph for this function:

const void * fwDataTools::helper::ArrayGetter::getItem ( const ::fwData::Array::IndexType id,
const size_t  component = 0 
) const
virtual

Getter for a buffer item. pointer to the requested item in the buffer.

Parameters
idItem id
componentComponent id
Returns
Pointer to the requested item in the buffer

Definition at line 61 of file ArrayGetter.cpp.

References fwDataTools::helper::Array::getBufferPtr().

Referenced by getItem().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
const T * fwDataTools::helper::ArrayGetter::getItem ( const ::fwData::Array::IndexType id,
const size_t  component = 0 
) const

Typed version of getItem.

Template Parameters
TType in which the pointer will be returned
Parameters
idItem id
componentComponent id
Returns
Array buffer pointer casted to T

Definition at line 126 of file ArrayGetter.hpp.

void fwDataTools::helper::ArrayGetter::getItem ( const ::fwData::Array::IndexType id,
void *  value 
) const
virtual

Copies the data into the buffer pointed by

Parameters
idItem id
[out]valueBuffer to write into

Definition at line 70 of file ArrayGetter.cpp.

References fwDataTools::helper::Array::getBufferPtr(), and getItem().

+ Here is the call graph for this function:


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