7 #include "fwAtoms/registry/macros.hpp" 8 #include "fwAtoms/Blob.hpp" 17 Blob::sptr
Blob::New(::fwMemory::BufferObject::sptr buffer)
20 blob->m_bufferObject = buffer;
27 Blob::sptr
Blob::New(
void* buffer,
unsigned int size)
29 ::fwMemory::BufferObject::sptr bufferObject = ::fwMemory::BufferObject::New();
30 bufferObject->setBuffer(buffer, size);
31 Blob::sptr blob =
Blob::New(bufferObject);
39 return m_bufferObject;
51 ::fwMemory::BufferObject::sptr bufferObjectDest = ::fwMemory::BufferObject::New();
52 Blob::sptr cloneBlob =
Blob::New(bufferObjectDest);
55 bufferObjectDest->allocate(m_bufferObject->getSize());
58 char * buffSrc =
static_cast< char *
>( lockerSource.
getBuffer() );
61 char * buffDest =
static_cast< char *
>( lockerDest.
getBuffer() );
63 std::copy(buffSrc, buffSrc + m_bufferObject->getSize(), buffDest );
virtual FWATOMS_API Base::sptr clone() const override
Returns a clone object.
fwAtoms contains basic objects to represent any other kind of object
base class for BufferObject Lock
FWATOMS_API void setBufferObject(const ::fwMemory::BufferObject::sptr &bo)
buffer accessor.
FWATOMS_API::fwMemory::BufferObject::sptr getBufferObject() const
buffer accessor.
LockBase< T >::BufferType getBuffer() const
Returns BufferObject's buffer pointer.
static FWATOMS_API Blob::sptr New(::fwMemory::BufferObject::sptr buffer)
create a new Blob shared ptr.
Representation of a buffer.