fw4spl
fwMDSemanticPatch/src/fwMDSemanticPatch/PatchLoader.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #include "fwMDSemanticPatch/PatchLoader.hpp"
8 
9 #include <fwAtomsPatch/VersionsManager.hpp>
10 
11 #include <fwRuntime/operations.hpp>
12 
13 namespace fwMDSemanticPatch
14 {
15 
16 std::string PatchLoader::s_currentVersion = "V11";
17 
18 //------------------------------------------------------------------------------
19 
21 {
23  auto path = ::fwRuntime::getLibraryResourceFilePath("fwMDSemanticPatch-" FWMDSEMANTICPATCH_VER "/");
24  versionManager->buildVersionTable(path.string());
25  versionManager->buildLinkTable(path.string());
26 }
27 
28 //------------------------------------------------------------------------------
29 
30 void PatchLoader::setCurrentVersion(const std::string& version)
31 {
32  s_currentVersion = version;
33 }
34 
35 //------------------------------------------------------------------------------
36 
38 {
39  return s_currentVersion;
40 }
41 
42 //------------------------------------------------------------------------------
43 
44 } //namespace fwMDSemanticPatch
#define SPTR(_cls_)
static FWMDSEMANTICPATCH_API void setCurrentVersion(const std::string &version)
Set the current MedicalData version.
Contains the semantic patches within the context "MedicalData".
static FWMDSEMANTICPATCH_API std::string getCurrentVersion()
Returns current MedicalData version.
Maintains a table of object versions and a table of links between objects.
static std::shared_ptr< VersionsManager > getDefault()
Returns the default instance of VersionsManager.
static FWMDSEMANTICPATCH_API void loadPatches()
Computes VersionsManager&#39;s link and version tables.