fw4spl
VersionDescriptor.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_VERSIONDESCRIPTOR_HPP__
8 #define __FWATOMSPATCH_VERSIONDESCRIPTOR_HPP__
9 
10 #include <map>
11 #include <string>
12 
13 #include <fwCore/BaseObject.hpp>
14 
15 #include "fwAtomsPatch/config.hpp"
16 
17 
18 namespace fwAtomsPatch
19 {
20 
24 class FWATOMSPATCH_CLASS_API VersionDescriptor
25 {
26 
27 public:
28 
32  struct Compare {
33  bool operator() (VersionDescriptor a, VersionDescriptor b) const
34  {
35  return a.getVersionName() < b.getVersionName();
36  }
37  };
38 
42  typedef std::map< std::string, std::string > VersionsType;
43 
48 
52  VersionDescriptor(const std::string& context, const std::string& versionName, const VersionsType& versions);
53 
58 
60  const std::string& getContext() const
61  {
62  return m_context;
63  }
64 
66  const std::string& getVersionName() const
67  {
68  return m_versionName;
69  }
70 
72  const VersionsType& getVersions() const
73  {
74  return m_versions;
75  }
76 
77 private:
78 
80  std::string m_context;
81 
83  std::string m_versionName;
84 
86  VersionsType m_versions;
87 };
88 
89 } // fwAtomsPatch
90 
91 #endif /* __FWATOMSPATCH_VERSIONDESCRIPTOR_HPP__ */
const VersionsType & getVersions() const
Returns versions.
Version descriptor used to identify a version.
Contains base functionalities used to transform objects from a version to another.
Definition: Abstract.hpp:16
Struct used to compare two VersionDescriptor.
std::map< std::string, std::string > VersionsType
VersionIDs used to link type and version.
const std::string & getVersionName() const
Returns version name.
const std::string & getContext() const
Returns context name.