fw4spl
StructureTraitsDictionary.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 __FWDATA_STRUCTURETRAITSDICTIONARY_HPP__
8 #define __FWDATA_STRUCTURETRAITSDICTIONARY_HPP__
9 
10 #include "fwData/factory/new.hpp"
11 #include "fwData/Object.hpp"
12 #include "fwData/StructureTraits.hpp"
13 
14 fwCampAutoDeclareDataMacro((fwData)(StructureTraitsDictionary), FWDATA_API);
15 
16 namespace fwData
17 {
24 class FWDATA_CLASS_API StructureTraitsDictionary : public ::fwData::Object
25 {
26 public:
28  ::fwData::factory::New< StructureTraitsDictionary >);
29  fwCampMakeFriendDataMacro((fwData)(StructureTraitsDictionary));
30 
31  typedef std::vector<std::string> StructureTypeNameContainer;
32 
38 
40  FWDATA_API virtual ~StructureTraitsDictionary();
41 
50  FWDATA_API void addStructure(StructureTraits::sptr structureTraits);
51 
56  FWDATA_API StructureTraits::sptr getStructure(std::string type);
57 
59  FWDATA_API StructureTypeNameContainer getStructureTypeNames() const;
60 
62  FWDATA_API void shallowCopy( const Object::csptr& _source ) override;
63 
65  FWDATA_API void cachedDeepCopy(const Object::csptr& _source, DeepCopyCacheType& cache) override;
66 
67 private:
68 
69  typedef std::map< std::string, ::fwData::StructureTraits::sptr > StructureTraitsMapType;
70 
72  StructureTraitsMapType m_structureTraitsMap;
73 
74 };
75 
76 } // namespace fwData
77 
78 #endif // __FWDATA_STRUCTURETRAITSDICTIONARY_HPP__
79 
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
This class defines a dictionary of structure traits.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Base class for each data object.
Contains the representation of the data objects used in the framework.