7 #ifndef __FWATOMSPATCH_PATCHER_DEFAULTPATCHER_HPP__ 8 #define __FWATOMSPATCH_PATCHER_DEFAULTPATCHER_HPP__ 10 #include "fwAtomsPatch/config.hpp" 11 #include "fwAtomsPatch/helper/Object.hpp" 12 #include "fwAtomsPatch/patcher/IPatcher.hpp" 13 #include "fwAtomsPatch/VersionDescriptor.hpp" 15 #include <fwAtoms/Blob.hpp> 16 #include <fwAtoms/Boolean.hpp> 17 #include <fwAtoms/Map.hpp> 18 #include <fwAtoms/Numeric.hpp> 19 #include <fwAtoms/Object.hpp> 20 #include <fwAtoms/Sequence.hpp> 21 #include <fwAtoms/String.hpp> 23 #include <fwCore/base.hpp> 42 ::fwAtomsPatch::patcher::factory::New< DefaultPatcher >);
51 FWATOMSPATCH_API virtual ::fwAtoms::Object::sptr transformObject(::fwAtoms::Object::sptr
object,
52 const std::string& context,
53 const std::string& currentVersion,
54 const std::string& targetVersion)
override;
59 FWATOMSPATCH_API virtual ::fwAtoms::Object::sptr processStructuralObject(::fwAtoms::Object::sptr current);
62 FWATOMSPATCH_API virtual ::fwAtoms::Object::sptr processContextualObject(::fwAtoms::Object::sptr current);
65 FWATOMSPATCH_API virtual ::fwAtoms::Base::sptr processBase(::fwAtoms::Base::sptr base);
68 FWATOMSPATCH_API virtual ::fwAtoms::Map::sptr processMapping(::fwAtoms::Map::sptr map);
71 FWATOMSPATCH_API virtual ::fwAtoms::Sequence::sptr processSequence(::fwAtoms::Sequence::sptr seq);
74 FWATOMSPATCH_API virtual ::fwAtoms::Object::sptr applyStructuralPatch(::fwAtoms::Object::sptr previous,
75 ::fwAtoms::Object::sptr current);
78 FWATOMSPATCH_API virtual ::fwAtoms::Object::sptr applyContextualPatch(::fwAtoms::Object::sptr previous,
79 ::fwAtoms::Object::sptr current);
81 FWATOMSPATCH_API
bool isKnown(const ::fwAtoms::Base::sptr& base);
89 typedef std::map<std::string, ::fwAtoms::Object::sptr > CacheType;
90 typedef std::map< ::fwAtoms::Object::sptr, ::fwAtoms::Object::sptr > NewVersionsType;
::fwAtomsPatch::VersionsGraph::sptr m_versionsGraph
Versions graph.
NewVersionsType m_newVersions
Map used to store the correspondence between an old object and a new one.
Contains base functionalities used to transform objects from a version to another.
::fwAtomsPatch::VersionsGraph::NodeIDType m_currentVersion
Current object version.
std::string m_context
Context where the object is patched.
::fwAtomsPatch::VersionsGraph::NodeIDType m_targetVersion
Target version for current object.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Base class of all patchers.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
PassType
Type of the pass.
CacheType m_cache
Cache used to store objects which have already been patched (in order to avoid patching the same obje...
::fwAtoms::Object::sptr m_object
Current object being patched.