fw4spl
Blob.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWATOMS_BLOB_HPP__
8 #define __FWATOMS_BLOB_HPP__
9 
10 #include "fwAtoms/Base.hpp"
11 #include "fwAtoms/config.hpp"
12 #include "fwAtoms/factory/new.hpp"
13 
14 #include <fwMemory/BufferObject.hpp>
15 
16 namespace fwAtoms
17 {
23 class FWATOMS_CLASS_API Blob : public Base
24 {
25 public:
26  fwCoreClassDefinitionsWithFactoryMacro( (Blob)(::fwAtoms::Base), (()), ::fwAtoms::factory::New< Blob >);
27 
33  {
34  }
35 
39  virtual ~Blob()
40  {
41  }
42 
47  FWATOMS_API static Blob::sptr New(::fwMemory::BufferObject::sptr buffer);
48 
54  FWATOMS_API static Blob::sptr New(void* buffer, unsigned int size);
55 
61  FWATOMS_API ::fwMemory::BufferObject::sptr getBufferObject() const;
62  FWATOMS_API void setBufferObject(const ::fwMemory::BufferObject::sptr& bo);
64 
68  FWATOMS_API virtual Base::sptr clone() const override;
69 
73  ::fwAtoms::Base::AtomType type() const override
74  {
75  return ::fwAtoms::Base::BLOB;
76  }
77 
78 protected:
79 
80  ::fwMemory::BufferObject::sptr m_bufferObject;
81 };
82 
83 }
84 
85 #endif /* __FWATOMS_BLOB_HPP__ */
86 
virtual ~Blob()
Destructor.
Definition: Blob.hpp:39
fwAtoms contains basic objects to represent any other kind of object
::fwAtoms::Base::AtomType type() const override
returns Atom type
Definition: Blob.hpp:73
Blob(::fwAtoms::Base::Key key)
Constructor.
Definition: Blob.hpp:32
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
Base class for all Atom classes.
Representation of a buffer.
Definition: Blob.hpp:23