fw4spl
ObjectLock.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
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 __FWDATA_OBJECTLOCK_HPP__
8 #define __FWDATA_OBJECTLOCK_HPP__
9 
10 
11 #include "fwData/Image.hpp"
12 #include "fwData/Array.hpp"
13 #include "fwData/Mesh.hpp"
14 #include "fwData/Reconstruction.hpp"
15 #include "fwData/config.hpp"
16 
17 #include <vector>
18 
19 namespace fwData
20 {
21 
22 
26 class FWDATA_CLASS_API ObjectLock
27 {
28 
29 public:
30 
31  ObjectLock()
32  {
33  }
34 
35  FWDATA_API ObjectLock( const ObjectLock & );
36  FWDATA_API ObjectLock( ::fwData::Object::sptr obj );
37 
38  FWDATA_API ~ObjectLock();
39 
40  FWDATA_API ObjectLock & operator=(const ObjectLock & );
41 private:
42 
43 
44  typedef std::vector< ::fwMemory::BufferObject::Lock > LocksType;
45  typedef std::vector< ::fwData::Object::sptr > ObjectsType;
46 
47  void lock( ::fwData::Array::sptr array, LocksType & locks );
48  void lock( ::fwData::Image::sptr image, LocksType & locks );
49  void lock( ::fwData::Mesh::sptr mesh, LocksType & locks );
50  void lock( ::fwData::Reconstruction::sptr rec, LocksType & locks );
51 
52  LocksType m_locks;
53  ObjectsType m_objects;
54 };
55 
56 } // fwData
57 
58 #endif // __FWDATA_OBJECTLOCK_HPP__
Contains the representation of the data objects used in the framework.
A simple helper to lock specific object, manages : Image, Mesh and Array.
Definition: ObjectLock.hpp:26