fw4spl
SrcLib/core/fwDataTools/include/fwDataTools/helper/Composite.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2016.
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 __FWDATATOOLS_HELPER_COMPOSITE_HPP__
8 #define __FWDATATOOLS_HELPER_COMPOSITE_HPP__
9 
10 #include "fwDataTools/config.hpp"
11 
12 #include "fwData/Composite.hpp"
13 
14 namespace fwDataTools
15 {
16 namespace helper
17 {
18 
22 class FWDATATOOLS_CLASS_API Composite
23 {
24 
25 public:
26 
28  FWDATATOOLS_API Composite( ::fwData::Composite::wptr _composite );
29 
31  FWDATATOOLS_API ~Composite();
32 
40  FWDATATOOLS_API void add( std::string _compositeKey, ::fwData::Object::sptr _newObject );
41 
48  FWDATATOOLS_API void remove( std::string _compositeKey );
49 
55  FWDATATOOLS_API void clear();
56 
64  FWDATATOOLS_API void swap( std::string _compositeKey, ::fwData::Object::sptr _newObject );
65 
71  FWDATATOOLS_API void notify();
72 
73 private:
74 
76  ::fwData::Composite::ContainerType m_addedObjects;
78  ::fwData::Composite::ContainerType m_newChangedObjects;
80  ::fwData::Composite::ContainerType m_oldChangedObjects;
82  ::fwData::Composite::ContainerType m_removedObjects;
84  ::fwData::Composite::wptr m_composite;
85 };
86 
87 } // namespace helper
88 } // namespace fwDataTools
89 
90 #endif // __FWDATATOOLS_HELPER_COMPOSITE_HPP__
The namespace fwDataTools contains classes which provide helpers to manipulate fwData::Object. *.
Defines an helper to modify an fwData::Composite and create in parallel the message to announce this ...