7 #include "fwDataTools/helper/ArrayGetter.hpp" 15 ArrayGetter::ArrayGetter( ::fwData::Array::csptr array ) : m_array (array)
18 m_lock = array->getBufferObject()->lock();
23 ArrayGetter::~ArrayGetter()
39 return static_cast<const char*
>(this->
getBuffer());
44 const char* ArrayGetter::end()
const 46 return reinterpret_cast<const char*
> (
static_cast<const char*
>(this->
getBuffer()) + m_array->getSizeInBytes());
53 size_t sizeOf = m_array->getType().sizeOf();
54 size_t offset = m_array->getBufferOffset(
id, component, sizeOf);
55 const char* item =
static_cast<const char*
>(this->
getBuffer()) + offset;
63 size_t sizeOf = m_array->getType().sizeOf();
64 const char* item = this->
getBufferPtr(
id, component, sizeOf);
72 size_t sizeOf = m_array->getType().sizeOf();
74 char* val =
static_cast<char*
>(value);
75 std::copy(item, item + m_array->getNumberOfComponents()*sizeOf, val);
80 void ArrayGetter::getItem(const ::fwData::Array::IndexType&
id,
const size_t component,
void* value)
const 82 size_t sizeOf = m_array->getType().sizeOf();
83 const char* item = this->
getBufferPtr(
id, component, sizeOf);
84 char* val =
static_cast<char*
>(value);
85 std::copy(item, item + m_array->getNumberOfComponents()*sizeOf, val);
base class for BufferObject Lock
LockBase< T >::BufferType getBuffer() const
Returns BufferObject's buffer pointer.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...