|
VLink
2.0.0
A high-performance communication middleware
|
Semantic version number with comparison and string-conversion helpers. 更多...
#include <types.h>
Public 成员函数 | |
| bool | operator== (const Version &target) const noexcept |
Tests equality with target. 更多... | |
| bool | operator!= (const Version &target) const noexcept |
Tests inequality with target. 更多... | |
| bool | operator< (const Version &target) const noexcept |
Reports whether this version is strictly older than target. 更多... | |
| bool | operator> (const Version &target) const noexcept |
Reports whether this version is strictly newer than target. 更多... | |
| std::string | to_string () const noexcept |
Serialises this version back to a "major.minor.patch" string. 更多... | |
| bool | is_valid () const noexcept |
| Returns whether every component has been set to a non-negative value. 更多... | |
静态 Public 成员函数 | |
| static Version | from_string (const std::string &version_str) noexcept |
Parses a version string in "major.minor.patch" form. 更多... | |
Public 属性 | |
| int | major {-1} |
Major version number; -1 when unset. 更多... | |
| int | minor {-1} |
Minor version number; -1 when unset. 更多... | |
| int | patch {-1} |
Patch version number; -1 when unset. 更多... | |
Semantic version number with comparison and string-conversion helpers.
Used by NodeImpl::check_version() to compare a build-time application version against the live VLink library version. All components default to -1, which marks the value as not yet set.
|
staticnoexcept |
Parses a version string in "major.minor.patch" form.
Each component is decoded with std::from_chars; components missing from version_str retain the -1 sentinel.
| version_str | Source string such as "2.1.0". |
Version.
|
noexcept |
Returns whether every component has been set to a non-negative value.
true when the version has been parsed or assigned explicitly.
|
noexcept |
Tests inequality with target.
| target | Version to compare against. |
operator==.
|
noexcept |
Reports whether this version is strictly older than target.
Numeric ordering: compares major first, then minor, then patch.
| target | Version to compare against. |
true when this version is less than target.
|
noexcept |
Tests equality with target.
| target | Version to compare against. |
true when major, minor and patch all match.
|
noexcept |
Reports whether this version is strictly newer than target.
| target | Version to compare against. |
true when this version is greater than target.
|
noexcept |
Serialises this version back to a "major.minor.patch" string.
"2.1.0". | int vlink::Version::major {-1} |
Major version number; -1 when unset.
| int vlink::Version::minor {-1} |
Minor version number; -1 when unset.
| int vlink::Version::patch {-1} |
Patch version number; -1 when unset.