Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
usModuleVersion.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  Library: CppMicroServices
4 
5  Copyright (c) German Cancer Research Center,
6  Division of Medical and Biological Informatics
7 
8  Licensed under the Apache License, Version 2.0 (the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0
13 
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 
20 =============================================================================*/
21 
22 #ifndef USMODULEVERSION_H
23 #define USMODULEVERSION_H
24 
25 #include <usCoreExport.h>
26 
27 #include <string>
28 
29 #ifdef _MSC_VER
30 # pragma warning(push)
31 # pragma warning(disable: 4251)
32 #endif
33 
34 US_BEGIN_NAMESPACE
35 
54 class US_Core_EXPORT ModuleVersion {
55 
56 private:
57 
58  friend class ModulePrivate;
59 
60  unsigned int majorVersion;
61  unsigned int minorVersion;
62  unsigned int microVersion;
63  std::string qualifier;
64 
65  static const char SEPARATOR; // = "."
66 
67  bool undefined;
68 
69 
75  void Validate();
76 
77  ModuleVersion& operator=(const ModuleVersion& v);
78 
79  explicit ModuleVersion(bool undefined = false);
80 
81 public:
82 
86  static ModuleVersion EmptyVersion();
87 
92  static ModuleVersion UndefinedVersion();
93 
105  ModuleVersion(unsigned int majorVersion, unsigned int minorVersion, unsigned int microVersion);
106 
115  ModuleVersion(unsigned int majorVersion, unsigned int minorVersion, unsigned int microVersion, const std::string& qualifier);
116 
137  ModuleVersion(const std::string& version);
138 
144  ModuleVersion(const ModuleVersion& version);
145 
146 
160  static ModuleVersion ParseVersion(const std::string& version);
161 
168  bool IsUndefined() const;
169 
175  unsigned int GetMajor() const;
176 
182  unsigned int GetMinor() const;
183 
189  unsigned int GetMicro() const;
190 
196  std::string GetQualifier() const;
197 
208  std::string ToString() const;
209 
223  bool operator==(const ModuleVersion& object) const;
224 
248  int Compare(const ModuleVersion& object) const;
249 
250 };
251 
252 US_END_NAMESPACE
253 
254 #ifdef _MSC_VER
255 # pragma warning(pop)
256 #endif
257 
261 US_Core_EXPORT std::ostream& operator<<(std::ostream& os, const US_PREPEND_NAMESPACE(ModuleVersion)& v);
262 
263 #endif // USMODULEVERSION_H
US_Core_EXPORT std::ostream & operator<<(std::ostream &os, const us::ModuleVersion &v)
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)