SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
smtk
common
VersionNumber.h
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_VersionNumber_h
11
#define smtk_common_VersionNumber_h
12
13
#include "smtk/CoreExports.h"
14
#include "smtk/SystemConfig.h"
15
16
#include <array>
17
#include <string>
18
19
// On some systems, major and minor are defined as macros. If this is one of
20
// those systems, undefine these macros before defining the methods
21
// of smtk::common::VersionNumber.
22
#ifdef major
23
#undef major
24
#endif
25
26
#ifdef minor
27
#undef minor
28
#endif
29
30
namespace
smtk
31
{
32
namespace
common
33
{
34
38
class
SMTKCORE_EXPORT
VersionNumber
:
public
std::array<int, 3>
39
{
40
public
:
41
VersionNumber
();
42
VersionNumber
(
const
VersionNumber
& other);
43
VersionNumber
(
int
major,
int
minor = 0,
int
patch = 0);
44
VersionNumber
(
const
std::string& versionString);
45
46
int
major()
const
;
47
int
minor()
const
;
48
int
patch()
const
;
49
50
std::string string()
const
;
51
56
bool
isValid()
const
;
57
58
VersionNumber
& operator=(
const
VersionNumber
&) =
default
;
59
};
60
61
SMTKCORE_EXPORT std::ostream& operator<<(std::ostream& stream,
const
VersionNumber
& uid);
62
SMTKCORE_EXPORT std::istream& operator>>(std::istream& stream,
VersionNumber
& uid);
63
64
}
// namespace common
65
}
// namespace smtk
66
67
#endif // smtk_common_VersionNumber_h
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition:
doc.h:33
smtk::common::VersionNumber
A 2- or 3-component version number (i.e., major, minor, and optional patch).
Definition:
VersionNumber.h:38
Generated by
1.8.17