20 #if !defined(__MITSUBA_CORE_VERSION_H_)
21 #define __MITSUBA_CORE_VERSION_H_
29 #define MTS_VERSION "0.5.0"
35 #define MTS_YEAR "2014"
46 inline Version() : m_major(0), m_minor(0), m_release(0) { }
49 inline Version(
int major,
int minor,
int release)
50 : m_major(major), m_minor(minor), m_release(release) { }
56 Version(
const std::string &versionString);
60 if (m_major < other.m_major)
62 else if (m_major > other.m_major)
64 else if (m_minor < other.m_minor)
66 else if (m_minor > other.m_minor)
68 else if (m_release < other.m_release)
76 return *
this < other || *
this == other;
81 return m_major == other.m_major
82 && m_minor == other.m_minor
83 && m_release == other.m_release;
88 return m_major != 0 || m_minor != 0 || m_release != 0;
93 return m_major == other.m_major &&
94 m_minor == other.m_minor;
98 std::string toString()
const;
101 std::string toStringComplete()
const;
bool operator<(const Version &other) const
Check if this program version is older than other.
Definition: version.h:59
bool isCompatible(const Version &other) const
Are the following two versions compatible?
Definition: version.h:92
int getRelease() const
Return the release.
Definition: version.h:110
#define MTS_EXPORT_CORE
Definition: getopt.h:29
Version(int major, int minor, int release)
Initialize with the specified version number.
Definition: version.h:49
int getMinorVersion() const
Return the minor version.
Definition: version.h:107
bool isValid()
Is this a valid version number?
Definition: version.h:87
bool operator<=(const Version &other) const
Check if this program version is older than or equal to other.
Definition: version.h:75
int getMajorVersion() const
Return the major version.
Definition: version.h:104
Version()
Default constructor: initialize to an invalid version (0.0.0)
Definition: version.h:46
A simple data structure for representing and comparing Mitsuba version strings.
Definition: version.h:43
bool operator==(const Version &other) const
Check if two program versions match.
Definition: version.h:80