8 #include "fwAtomsPatch/StructuralPatchDB.hpp" 13 StructuralPatchDB::sptr StructuralPatchDB::s_default = std::make_shared<StructuralPatchDB>();
17 VersionIDType source = std::make_pair(patch->getOriginClassname(), patch->getOriginVersion());
18 VersionIDType target = std::make_pair(patch->getTargetClassname(), patch->getTargetVersion());
21 m_patches[key] = patch;
27 const std::string& originVersion,
28 const std::string& targetClassname,
29 const std::string& targetVersion)
const 31 const VersionIDType source = std::make_pair(originClassname, originVersion);
32 const VersionIDType target = std::make_pair(targetClassname, targetVersion);
36 PatchesType::const_iterator it = m_patches.find(key);
37 if(it != m_patches.end())
43 return ::fwAtomsPatch::IStructuralPatch::sptr();
52 return m_patches.size();
std::pair< VersionIDType, VersionIDType > PatchKeyType
Typedef used to store link to data structure.
FWATOMSPATCH_API size_t size() const
Retrieves number of patch.
FWATOMSPATCH_API void registerPatch(std::shared_ptr< ::fwAtomsPatch::IStructuralPatch > patch)
Registers a new Path.
Contains base functionalities used to transform objects from a version to another.
::boost::unique_lock< ReadWriteMutex > WriteLock
Defines a lock of write type for read/write mutex.
std::pair< std::string, std::string > VersionIDType
Typedef used to store the pair classname/version of a data structure.
::boost::shared_lock< ReadWriteMutex > ReadLock
Defines a lock of read type for read/write mutex.
FWATOMSPATCH_API std::shared_ptr< ::fwAtomsPatch::IStructuralPatch > getPatch(const std::string &originClassname, const std::string &originVersion, const std::string &targetClassname, const std::string &targetVersion) const
Retrieves patch to go to specified data revision.