fw4spl
IPatch.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 __FWATOMSPATCH_IPATCH_HPP__
8 #define __FWATOMSPATCH_IPATCH_HPP__
9 
10 #include <string>
11 #include <map>
12 
13 #include <fwCore/base.hpp>
14 #include <fwAtoms/Object.hpp>
15 #include <fwAtomsPatch/helper/Object.hpp>
16 
17 #include "fwAtomsPatch/config.hpp"
18 
19 
20 namespace fwAtomsPatch
21 {
22 
27 class FWATOMSPATCH_CLASS_API IPatch : public ::fwCore::BaseObject
28 {
29 
30 public:
33 
37  typedef std::map< ::fwAtoms::Object::sptr, ::fwAtoms::Object::sptr > NewVersionsType;
40  FWATOMSPATCH_API IPatch();
42 
44  FWATOMSPATCH_API IPatch( const IPatch &cpy );
45 
47  FWATOMSPATCH_API virtual ~IPatch();
48 
50  FWATOMSPATCH_API virtual void apply(const ::fwAtoms::Object::sptr& previous,
51  const ::fwAtoms::Object::sptr& current,
52  ::fwAtomsPatch::IPatch::NewVersionsType& newVersions) = 0;
53 
55  FWATOMSPATCH_API virtual const std::string& getOriginClassname() const;
56 
58  FWATOMSPATCH_API virtual const std::string& getOriginVersion() const;
59 
60 
61 protected:
62 
64  std::string m_originClassname;
65 
67  std::string m_originVersion;
68 
69 };
70 
71 
72 } //fwAtomsPatch
73 #endif /* __FWATOMSPATCH_IPATCH_HPP__ */
#define fwCoreNonInstanciableClassDefinitionsMacro(_classinfo_)
Generate common code for Non Instanciable classes (Interfaces, Abstract classes, ...)
Base class for all FW4SPL&#39;s classes.
Definition: BaseObject.hpp:22
Contains base functionalities used to transform objects from a version to another.
Definition: Abstract.hpp:16
std::string m_originClassname
Origin classname of the object.
Definition: IPatch.hpp:64
std::string m_originVersion
Origin version of the object.
Definition: IPatch.hpp:67
#define fwCoreAllowSharedFromThis()
Generate getSptr and getConstSptr methods.
Base class of all patches.
Definition: IPatch.hpp:27