7 #include <fwAtoms/Object.hpp> 9 #include "fwAtomsPatch/helper/functions.hpp" 10 #include "fwAtomsPatch/ISemanticPatch.hpp" 11 #include "fwAtomsPatch/types.hpp" 37 const std::string& originVersion,
38 const std::string& targetVersion)
47 const std::string& originVersion,
48 const std::string& targetVersion)
const 50 Context c(context, originVersion, targetVersion);
59 const ::fwAtoms::Object::sptr& current,
60 ::fwAtomsPatch::IPatch::NewVersionsType& newVersions)
virtual FWATOMSPATCH_API const std::string & getOriginClassname() const
Returns the origin classname of the object.
#define OSLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
FWATOMSPATCH_API std::string getClassname(const ::fwAtoms::Object::sptr &obj)
Get classname of an object.
virtual FWATOMSPATCH_API ~ISemanticPatch()
Destructor.
mutable::fwCore::mt::ReadWriteMutex m_mutex
Mutex to protect concurrent access for m_contexts.
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::string m_originClassname
Origin classname of the object.
virtual FWATOMSPATCH_API void addContext(const std::string &context, const std::string &originVersion, const std::string &targetVersion)
Add a context where the patch can be applied.
virtual FWATOMSPATCH_API bool isApplicable(const std::string &context, const std::string &originVersion, const std::string &targetVersion) const
Returns true if patch is applicable into the context from origin to target versions.
std::string m_originVersion
Origin version of the object.
FWATOMSPATCH_API ISemanticPatch()
Constructor.
::boost::shared_lock< ReadWriteMutex > ReadLock
Defines a lock of read type for read/write mutex.
virtual FWATOMSPATCH_API void apply(const std::shared_ptr< ::fwAtoms::Object > &previous, const std::shared_ptr< ::fwAtoms::Object > ¤t,::fwAtomsPatch::IPatch::NewVersionsType &newVersions) override
Applies modifications between given objects.
Base class of contextual patches.
FWATOMSPATCH_API std::string getVersion(const ::fwAtoms::Object::sptr &obj)
Get version of an object.
Struct used to store a context and the versions where the patch can be applied.
virtual FWATOMSPATCH_API const std::string & getOriginVersion() const
Returns the origin version of the object.
Base class of all patches.
ContextVectorType m_contexts
Vector used to store the contexts where the patch can be applied.