SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Version.h
Go to the documentation of this file.
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 #ifndef smtk_common_Version_h
11 #define smtk_common_Version_h
12 
13 #include "smtk/CoreExports.h"
14 
15 #include <string>
16 
23 #define SMTK_VERSION "1.1.0"
25 #define SMTK_VERSION_MAJOR 1
27 #define SMTK_VERSION_MINOR_INT @SMTK_VERSION_MINOR_INT@
29 #define SMTK_VERSION_PATCH 0
31 
33 #define SMTK_VERSION_MINOR 1
34 
35 // On some systems, major and minor are defined as macros. If this is one of
36 // those systems, undefine these macros before defining the static methods
37 // of smtk::common::Version.
38 #ifdef major
39 #undef major
40 #endif
41 
42 #ifdef minor
43 #undef minor
44 #endif
45 
46 namespace smtk {
47  namespace common {
48 
50 class SMTKCORE_EXPORT Version
51 {
52 public:
54  static int major() { return SMTK_VERSION_MAJOR; }
55 
57  static int minor() { return SMTK_VERSION_MINOR_INT; }
58 
60  static int patch() { return SMTK_VERSION_PATCH; }
61 
63  static std::string number() { return SMTK_VERSION; }
64 
66  static int combined()
67  { return combined(major(), minor(), patch()); }
68 
70  static int combined(int maj, int min, int pat)
71  { return pat + 1000 * (min + 100 * maj); }
72 };
73 
74  } // namespace common
75 } // namespace smtk
76 
77 #endif // smtk_common_Version_h
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
smtk::common::Version::number
static std::string number()
Return the full version number as a string.
Definition: Version.h:63
smtk::common::Version::patch
static int patch()
Return the version number components as integers.
Definition: Version.h:60
smtk::common::Version
Run-time access to the version number in different formats.
Definition: Version.h:50
smtk::common::Version::minor
static int minor()
Return the version number components as integers.
Definition: Version.h:57
smtk::common::Version::combined
static int combined()
Return the full version number encoded into a single integer.
Definition: Version.h:66
SMTK_VERSION_PATCH
#define SMTK_VERSION_PATCH
Integer-valued patch version number.
Definition: Version.h:30
smtk::common::Version::combined
static int combined(int maj, int min, int pat)
Return an encoded version integer given integer components.
Definition: Version.h:70
SMTK_VERSION_MAJOR
#define SMTK_VERSION_MAJOR
Integer-valued major version number.
Definition: Version.h:26
smtk::common::Version::major
static int major()
Return the version number components as integers.
Definition: Version.h:54
SMTK_VERSION_MINOR_INT
#define SMTK_VERSION_MINOR_INT
Integer-valued minor version number.
Definition: Version.h:28
SMTK_VERSION
#define SMTK_VERSION
Version number as a string.
Definition: Version.h:24