fw4spl
AtomToDataMappingVisitor.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 __FWATOMCONVERSION_ATOMTODATAMAPPINGVISITOR_HPP__
8 #define __FWATOMCONVERSION_ATOMTODATAMAPPINGVISITOR_HPP__
9 
10 #include <fwCamp/camp/ExtendedClassVisitor.hpp>
11 
12 #include "fwAtomConversion/config.hpp"
13 #include "fwAtomConversion/AtomVisitor.hpp"
14 
15 namespace fwAtoms
16 {
17 class Object;
18 }
19 namespace fwData
20 {
21 class Object;
22 }
23 
25 {
26 
33 class FWATOMCONVERSION_CLASS_API AtomToDataMappingVisitor : public ::camp::ExtendedClassVisitor
34 {
35 
36 public:
37 
39  FWATOMCONVERSION_API AtomToDataMappingVisitor(
40  SPTR(::fwData::Object)dataObj,
41  SPTR(::fwAtoms::Object)atomObj,
42  AtomVisitor::DataCacheType & cache,
43  const AtomVisitor::IReadPolicy &uuidPolicy
44  );
45 
47  FWATOMCONVERSION_API virtual ~AtomToDataMappingVisitor();
48 
50  FWATOMCONVERSION_API void visit(const camp::SimpleProperty& property);
51 
53  FWATOMCONVERSION_API void visit(const camp::EnumProperty& property);
54 
59  FWATOMCONVERSION_API void visit(const camp::UserProperty& property);
60 
68  FWATOMCONVERSION_API void visit(const camp::ArrayProperty& property);
69 
77  FWATOMCONVERSION_API void visit(const camp::MapProperty& property);
78 
79 private:
80 
82  SPTR(::fwData::Object) m_dataObj;
83 
85  ::camp::UserObject m_campDataObj;
86 
88  SPTR(::fwAtoms::Object) m_atomObj;
89 
91  AtomVisitor::DataCacheType & m_cache;
92 
94  const AtomVisitor::IReadPolicy & m_uuidPolicy;
95 };
96 
97 } // end namespace fwAtomConversion
98 
99 #endif // __FWATOMCONVERSION_ATOMTODATAMAPPINGVISITOR_HPP__
#define SPTR(_cls_)
fwAtoms contains basic objects to represent any other kind of object
This namespace contains the necessary class for fwData <-> fwAtoms conversion.
Visitor UUID Management policies.
Definition: AtomVisitor.hpp:40
Class represented a fwData::Object.
This visitor visits data object to fill it with associated atom object attributes. This class is used by AtomVisitor to convert an fwData::Object.
Base class for each data object.
Contains the representation of the data objects used in the framework.