fw4spl
|
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 |
Helper to manage array buffer. Lock the buffer before to modify it.
Definition at line 28 of file ArrayGetter.hpp.
|
virtual |
Getter for the array buffer.
Definition at line 30 of file ArrayGetter.cpp.
References fwMemory::BufferObject::LockBase< T >::getBuffer().
Referenced by Tuto16MultithreadConsole::SShowArray::updating(), and fwDataIO::writer::GzArrayWriter::write().
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.
id | Item id |
component | Item component id |
sizeOfType | size of a component |
Definition at line 51 of file ArrayGetter.cpp.
References fwDataTools::helper::Array::getBuffer().
|
virtual |
Getter for a buffer item. pointer to the requested item in the buffer.
id | Item id |
component | Component id |
Definition at line 61 of file ArrayGetter.cpp.
References fwDataTools::helper::Array::getBufferPtr().
Referenced by getItem().
const T * fwDataTools::helper::ArrayGetter::getItem | ( | const ::fwData::Array::IndexType & | id, |
const size_t | component = 0 |
||
) | const |
Typed version of getItem.
T | Type in which the pointer will be returned |
id | Item id |
component | Component id |
Definition at line 126 of file ArrayGetter.hpp.
|
virtual |
Copies the data into the buffer pointed by
id | Item id | |
[out] | value | Buffer to write into |
Definition at line 70 of file ArrayGetter.cpp.
References fwDataTools::helper::Array::getBufferPtr(), and getItem().