|
fw4spl
|
Helper to manage array buffer. Lock the buffer before to modify it. More...
#include <Array.hpp>
Public Member Functions | |
| FWDATATOOLS_API | Array (::fwData::Array::sptr array) |
| virtual FWDATATOOLS_API void | setItem (const ::fwData::Array::IndexType &id, const void *value) |
| Setter for one item components of the array. More... | |
| virtual FWDATATOOLS_API void | setItem (const ::fwData::Array::IndexType &id, const size_t component, const void *value) |
| Setter for one item component of the array. More... | |
| virtual FWDATATOOLS_API void * | getItem (const ::fwData::Array::IndexType &id, const size_t component=0) |
| Getter for a buffer item. pointer to the requested item in the buffer. More... | |
| template<typename T > | |
| T * | getItem (const ::fwData::Array::IndexType &id, const size_t component=0) |
| 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 |
| FWDATATOOLS_API void | setBuffer (void *buf, bool takeOwnership, const ::fwTools::Type &type, const ::fwData::Array::SizeType &size, size_t nbOfComponents,::fwMemory::BufferAllocationPolicy::sptr policy=::fwMemory::BufferMallocPolicy::New()) |
| Setter for the array buffer. More... | |
| virtual FWDATATOOLS_API char * | begin () |
| Returns the begining/end of the buffer interpreted as a char buffer. | |
| virtual FWDATATOOLS_API char * | end () |
| virtual FWDATATOOLS_API const char * | begin () const |
| virtual FWDATATOOLS_API const char * | end () const |
| template<typename T > | |
| T * | begin () |
| Returns the begining/end of the buffer, casted to T. | |
| template<typename T > | |
| T * | end () |
| FWDATATOOLS_API::fwMemory::BufferObject::Lock | getLock () const |
| Returns a copy of current lock on array. | |
| virtual FWDATATOOLS_API void * | getBuffer () |
| Getter for the array buffer. More... | |
| virtual FWDATATOOLS_API const void * | getBuffer () const |
| Getter for the array buffer. More... | |
| FWDATATOOLS_API char * | getBufferPtr (const ::fwData::Array::IndexType &id, size_t component, size_t sizeOfType) |
| Get a pointer to the value described by given parameters. More... | |
| 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... | |
Protected Member Functions | |
| virtual FWDATATOOLS_API void | setBuffer (void *buf, bool takeOwnership=false,::fwMemory::BufferAllocationPolicy::sptr policy=::fwMemory::BufferMallocPolicy::New()) |
| Protected setter for the array buffer. An existing buffer will be released if the array own it. More... | |
Protected Attributes | |
| ::fwData::Array::sptr | m_array |
| ::fwMemory::BufferObject::Lock | m_lock |
Helper to manage array buffer. Lock the buffer before to modify it.
Definition at line 24 of file ools/include/fwDataTools/helper/Array.hpp.
|
virtual |
Getter for the array buffer.
Definition at line 31 of file ools/src/fwDataTools/helper/Array.cpp.
Referenced by fwDataTools::helper::ArrayGetter::begin(), fwDataTools::Mesh::colorizeMeshCells(), fwDataTools::Mesh::colorizeMeshPoints(), Tuto14MeshGenerator::AlgoMeshDeformation::computeSimu(), fwDcmtkIO::reader::ImageStorageReader::directRead(), fwDcmtkIO::reader::ImageStorageReader::directRGBLookupRead(), fwDataTools::helper::ArrayGetter::getBufferPtr(), fwDataIO::reader::GzArrayReader::read(), fwDataTools::Mesh::shakeNormals(), Tuto16MultithreadConsole::SReadArray::updating(), and Tuto16MultithreadConsole::SIncrementArray::updating().
Here is the caller graph for this function:
|
virtual |
Getter for the array buffer.
Definition at line 38 of file ools/src/fwDataTools/helper/Array.cpp.
| char * fwDataTools::helper::Array::getBufferPtr | ( | const ::fwData::Array::IndexType & | id, |
| size_t | component, | ||
| size_t | sizeOfType | ||
| ) |
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 108 of file ools/src/fwDataTools/helper/Array.cpp.
Referenced by fwDataTools::helper::ArrayGetter::getItem().
Here is the caller graph for this function:| const char * fwDataTools::helper::Array::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 118 of file ools/src/fwDataTools/helper/Array.cpp.
|
virtual |
Getter for a buffer item. pointer to the requested item in the buffer.
| id | Item id |
| component | Component id |
Definition at line 147 of file ools/src/fwDataTools/helper/Array.cpp.
| T * fwDataTools::helper::Array::getItem | ( | const ::fwData::Array::IndexType & | id, |
| const size_t | component = 0 |
||
| ) |
Typed version of getItem.
| T | Type in which the pointer will be returned |
| id | Item id |
| component | Component id |
Definition at line 185 of file ools/include/fwDataTools/helper/Array.hpp.
|
virtual |
Copies the data into the buffer pointed by
| id | Item id | |
| [out] | value | Buffer to write into |
Definition at line 156 of file ools/src/fwDataTools/helper/Array.cpp.
| void fwDataTools::helper::Array::setBuffer | ( | void * | buf, |
| bool | takeOwnership, | ||
| const ::fwTools::Type & | type, | ||
| const ::fwData::Array::SizeType & | size, | ||
| size_t | nbOfComponents, | ||
| ::fwMemory::BufferAllocationPolicy::sptr | policy = ::fwMemory::BufferMallocPolicy::New() |
||
| ) |
Setter for the array buffer.
An existing buffer will be released if the array own it.
| buf | Buffer to set as Array's buffer |
| takeOwnership | if true, the Array will manage allocation and destroy the buffer when needed. |
| type | Type of the array view |
| size | Size of the array view |
| nbOfComponents | Number of components of the array view, Min value : 1 |
| policy | If the array takes ownership of the buffer, specifies the buffer allocation policy. |
Definition at line 66 of file ools/src/fwDataTools/helper/Array.cpp.
Referenced by fwItkIO::dataImageFactory(), and fwGdcmIO::reader::ie::Image::readImagePixelModule().
Here is the caller graph for this function:
|
protectedvirtual |
Protected setter for the array buffer. An existing buffer will be released if the array own it.
| buf | Buffer to set as Array's buffer |
| takeOwnership | if true, the Array will manage allocation and destroy the buffer when needed. |
| policy | If the array takes ownership of the buffer, specifies the buffer allocation policy. |
Definition at line 45 of file ools/src/fwDataTools/helper/Array.cpp.
|
virtual |
Setter for one item components of the array.
| id | Item id |
| value | Valid buffer of elements of type <m_type> with a length equal to <m_nbOfComponents> to be copied to array 'id' |
Definition at line 128 of file ools/src/fwDataTools/helper/Array.cpp.
|
virtual |
Setter for one item component of the array.
| id | Item id |
| component | Component id to write data in. |
| value | Valid buffer of elements of type <m_type> with a length equal to <m_nbOfComponents> to be copied to array 'id', component index 'component' |
Definition at line 137 of file ools/src/fwDataTools/helper/Array.cpp.