fw4spl
IStructuralPatch.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 __FWATOMSPATCH_ISTRUCTURALPATCH_HPP__
8 #define __FWATOMSPATCH_ISTRUCTURALPATCH_HPP__
9 
10 #include "fwAtomsPatch/config.hpp"
11 #include "fwAtomsPatch/helper/Object.hpp"
12 #include "fwAtomsPatch/IPatch.hpp"
13 
14 #include <fwCore/base.hpp>
15 
16 #include <string>
17 
18 namespace fwAtoms
19 {
20 class Object;
21 }
22 
23 namespace fwAtomsPatch
24 {
25 
29 class FWATOMSPATCH_CLASS_API IStructuralPatch : public IPatch
30 {
31 
32 public:
35 
37  FWATOMSPATCH_API IStructuralPatch();
38 
40  FWATOMSPATCH_API IStructuralPatch( const IStructuralPatch& cpy );
41 
43  FWATOMSPATCH_API virtual ~IStructuralPatch();
44 
54  FWATOMSPATCH_API virtual void apply(const SPTR(::fwAtoms::Object)& previous,
55  const SPTR(::fwAtoms::Object)& current,
56  ::fwAtomsPatch::IPatch::NewVersionsType& newVersions) override;
57 
59  FWATOMSPATCH_API virtual const std::string& getTargetClassname() const;
60 
62  FWATOMSPATCH_API virtual const std::string& getTargetVersion() const;
63 
64 protected:
65 
67  FWATOMSPATCH_API void updateVersion(SPTR(::fwAtoms::Object) current);
68 
70  std::string m_targetClassname;
71 
73  std::string m_targetVersion;
74 };
75 
76 } // namespace fwAtomsPatch
77 
78 #endif /* __FWATOMSPATCH_ISTRUCTURALPATCH_HPP__ */
#define SPTR(_cls_)
#define fwCoreNonInstanciableClassDefinitionsMacro(_classinfo_)
Generate common code for Non Instanciable classes (Interfaces, Abstract classes, ...)
fwAtoms contains basic objects to represent any other kind of object
Contains base functionalities used to transform objects from a version to another.
Definition: Abstract.hpp:16
Class represented a fwData::Object.
std::string m_targetClassname
Target type.
std::string m_targetVersion
Target version.
#define fwCoreAllowSharedFromThis()
Generate getSptr and getConstSptr methods.
Base class of all structural patches.
Base class of all patches.
Definition: IPatch.hpp:27