7 #ifndef __FWDATATOOLS_HELPER_ARRAYGETTER_HPP__ 8 #define __FWDATATOOLS_HELPER_ARRAYGETTER_HPP__ 10 #include "fwDataTools/config.hpp" 12 #include <fwData/Array.hpp> 14 #include <fwMemory/BufferObject.hpp> 16 #include <fwTools/Type.hpp> 34 FWDATATOOLS_API
ArrayGetter( ::fwData::Array::csptr array );
36 FWDATATOOLS_API
virtual ~ArrayGetter();
47 FWDATATOOLS_API
virtual const void* getItem(const ::fwData::Array::IndexType&
id,
const size_t component = 0)
const;
58 template<
typename T >
const T* getItem(const ::fwData::Array::IndexType&
id,
const size_t component = 0)
const;
66 FWDATATOOLS_API
virtual void getItem(const ::fwData::Array::IndexType&
id,
void* value)
const;
67 FWDATATOOLS_API
virtual void getItem(const ::fwData::Array::IndexType&
id,
const size_t component,
75 FWDATATOOLS_API
virtual const void* getBuffer()
const;
78 FWDATATOOLS_API
virtual const char* begin()
const;
79 FWDATATOOLS_API
virtual const char* end()
const;
82 template<
typename T >
const T* begin()
const;
83 template<
typename T >
const T* end()
const;
94 FWDATATOOLS_API
const char* getBufferPtr( const ::fwData::Array::IndexType&
id,
size_t component,
95 size_t sizeOfType )
const;
98 FWDATATOOLS_API ::fwMemory::BufferObject::Lock getLock()
const;
102 ::fwData::Array::csptr m_array;
109 template<
typename T >
112 return static_cast<const T*
>(this->getBuffer());
117 template<
typename T >
118 const T* ArrayGetter::end()
const 120 return reinterpret_cast<const T*
> (
static_cast<const char*
>(this->getBuffer()) + m_array->getSizeInBytes());
125 template<
typename T >
128 return static_cast<const T*
> (this->getItem(
id, component));
135 #endif // __FWDATATOOLS_HELPER_ARRAYGETTER_HPP__
base class for BufferObject Lock
#define fwCoreClassFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate methods for classes with one factory.