7 #define CAMP_COMPILATION 9 #include "fwMemory/BufferObject.hpp" 11 fwCampImplementMacro((
fwMemory)(BufferObject))
15 .function(
"is_a", (
bool(::
fwMemory::BufferObject::*)(
const std::string&)
const) & ::fwMemory::BufferObject::isA);
27 m_bufferManager->registerBuffer(&m_buffer).get();
36 m_bufferManager->unregisterBuffer(&m_buffer).get();
43 m_bufferManager->allocateBuffer(&m_buffer, size, policy).get();
44 m_allocPolicy = policy;
52 m_bufferManager->reallocateBuffer(&m_buffer, size).get();
60 m_bufferManager->destroyBuffer(&m_buffer).get();
61 m_allocPolicy = ::fwMemory::BufferNoAllocPolicy::New();
68 const ::fwMemory::BufferAllocationPolicy::sptr& policy)
70 m_bufferManager->setBuffer(&m_buffer, buffer, size, policy).get();
71 m_allocPolicy = policy;
93 m_bufferManager->swapBuffer(&m_buffer, &(_source->m_buffer)).get();
95 std::swap(m_size, _source->m_size);
96 m_bufferManager.swap(_source->m_bufferManager);
97 m_allocPolicy.swap(_source->m_allocPolicy);
104 return m_bufferManager->getStreamInfo(&m_buffer).get();
111 const ::boost::filesystem::path& sourceFile,
112 ::fwMemory::FileFormatType format,
113 const ::fwMemory::BufferAllocationPolicy::sptr& policy
117 m_allocPolicy = policy;
118 m_bufferManager->setIStreamFactory(&m_buffer, factory, size, sourceFile, format, policy).get();
The namespace fwMemory contains tools to manage memory. Use for dump.
FWMEMORY_API void swap(const BufferObject::sptr &_source)
Exchanges the content of the BufferObject with the content of _source.
std::string className() const
return the sub class classname : an alias of this->getClassname
base class for BufferObject Lock
Contains fwAtomsFilter::factory utilities.
virtual FWMEMORY_API void allocate(SizeType size, const ::fwMemory::BufferAllocationPolicy::sptr &policy=::fwMemory::BufferMallocPolicy::New())
Buffer allocation.
virtual FWMEMORY_API ~BufferObject()
BufferObject destructor.
FWMEMORY_API void setIStreamFactory(const std::shared_ptr< ::fwMemory::stream::in::IFactory > &factory, SizeType size, const ::boost::filesystem::path &sourceFile="",::fwMemory::FileFormatType format=::fwMemory::OTHER, const ::fwMemory::BufferAllocationPolicy::sptr &policy=::fwMemory::BufferMallocPolicy::New())
Set a stream factory for the buffer manager The factory will be used to load data on demand by the bu...
virtual FWMEMORY_API void setBuffer(::fwMemory::BufferManager::BufferType buffer, SizeType size, const ::fwMemory::BufferAllocationPolicy::sptr &policy=::fwMemory::BufferMallocPolicy::New())
Buffer setter.
BufferManager implementation.
virtual FWMEMORY_API void reallocate(SizeType size)
Buffer reallocation.
virtual FWMEMORY_API Lock lock()
Return a lock on the BufferObject.
Define Base class for FW4SPL buffers.
virtual FWMEMORY_API void destroy()
Buffer deallocation.
FWMEMORY_API BufferObject()
BufferObject constructor.