Thermal Camera SDK 11.3.0
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
Version.h
Go to the documentation of this file.
1// Copyright (c) 2008-2026 Optris GmbH & Co. KG
2
10
11#pragma once
12
13#include <string>
14#include <ostream>
15
16#include "otcsdk/Api.h"
17
18
19namespace optris
20{
21
24{
25public:
27 OTC_SDK_API Version() noexcept;
28
36 OTC_SDK_API Version(int major, int minor, int patch) noexcept;
37
43 int getMajor() const noexcept;
44
50 int getMinor() const noexcept;
51
57 int getPatch() const noexcept;
58
59
65 OTC_SDK_API std::string toString() const noexcept;
66
67
75 OTC_SDK_API bool isValid() const noexcept;
76
84 OTC_SDK_API operator bool() const noexcept;
85
86
96 OTC_SDK_API int compare(const Version& rhs) const noexcept;
97
109 OTC_SDK_API int compare(int major, int minor, int patch) const noexcept;
110
111
119 bool operator==(const Version& rhs) const noexcept;
120
128 bool operator!=(const Version& rhs) const noexcept;
129
137 bool operator<(const Version& rhs) const noexcept;
138
146 bool operator<=(const Version& rhs) const noexcept;
147
155 bool operator>(const Version& rhs) const noexcept;
156
164 bool operator>=(const Version& rhs) const noexcept;
165
166
167private:
168 int _major;
169 int _minor;
170 int _patch;
171};
172
173
174// Inline implementations
175inline int Version::getMajor() const noexcept
176{
177 return _major;
178}
179
180inline int Version::getMinor() const noexcept
181{
182 return _minor;
183}
184
185inline int Version::getPatch() const noexcept
186{
187 return _patch;
188}
189
190inline bool Version::operator==(const Version& rhs) const noexcept
191{
192 return compare(rhs) == 0;
193}
194
195inline bool Version::operator!=(const Version& rhs) const noexcept
196{
197 return compare(rhs) != 0;
198}
199
200inline bool Version::operator<(const Version& rhs) const noexcept
201{
202 return compare(rhs) < 0;
203}
204
205inline bool Version::operator<=(const Version& rhs) const noexcept
206{
207 return compare(rhs) <= 0;
208}
209
210inline bool Version::operator>(const Version& rhs) const noexcept
211{
212 return compare(rhs) > 0;
213}
214
215inline bool Version::operator>=(const Version& rhs) const noexcept
216{
217 return compare(rhs) >= 0;
218}
219
220
221// Utility functions
230OTC_SDK_API std::ostream& operator<<(std::ostream& out, const Version& version);
231
232} // namespace optris
Contains defines controlling the Windows DLL export and import of symbols.
#define OTC_SDK_API
Only needed when working with Windows DLLs.
Definition Api.h:65
Represent a version with major, minor and patch version numbers.
Definition Version.h:24
OTC_SDK_API int compare(const Version &rhs) const noexcept
Compares the provided version with the stored one.
int getMajor() const noexcept
Returns the major version number.
Definition Version.h:175
bool operator!=(const Version &rhs) const noexcept
Return whether the provided version is not equal to the stored one.
Definition Version.h:195
int getPatch() const noexcept
Returns the patch version number.
Definition Version.h:185
bool operator>(const Version &rhs) const noexcept
Return whether the stored version is higher than to the provided one.
Definition Version.h:210
bool operator<(const Version &rhs) const noexcept
Return whether the stored version is lower than the provided one.
Definition Version.h:200
OTC_SDK_API Version() noexcept
Constructor.
bool operator>=(const Version &rhs) const noexcept
Return whether the stored version is higher than or equal to the provided one.
Definition Version.h:215
bool operator==(const Version &rhs) const noexcept
Return whether the provided version equals the stored one.
Definition Version.h:190
OTC_SDK_API std::string toString() const noexcept
Returns a string representation of the version.
int getMinor() const noexcept
Returns the minor version number.
Definition Version.h:180
OTC_SDK_API bool isValid() const noexcept
Returns whether the stored version is valid.
bool operator<=(const Version &rhs) const noexcept
Return whether the stored version is lower than or equal to the provided one.
Definition Version.h:205
Main SDK namespace.
Definition AlarmChannel.h:21
OTC_SDK_API std::ostream & operator<<(std::ostream &out, const AlarmChannelConfig &config) noexcept
Output stream operator for alarm channel configurations.