VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
vlink::Version结构体 参考final

Semantic version number with comparison and string conversion utilities. 更多...

#include <types.h>

vlink::Version 的协作图:

Public 成员函数

bool operator== (const Version &target) const noexcept
 Returns true when both versions are identical.
bool operator!= (const Version &target) const noexcept
 Returns true when versions differ.
bool operator< (const Version &target) const noexcept
 Returns true when this version is older than target.
bool operator> (const Version &target) const noexcept
 Returns true when this version is newer than target.
std::string to_string () const noexcept
 Converts this version to a "major.minor.patch" string.
bool is_valid () const noexcept
 Returns true when all three components are non-negative.

静态 Public 成员函数

static Version from_string (const std::string &version_str) noexcept
 Parses a version string in "major.minor.patch" format.

Public 属性

int major {-1}
 Major version number; -1 if not set.
int minor {-1}
 Minor version number; -1 if not set.
int patch {-1}
 Patch version number; -1 if not set.

详细描述

Semantic version number with comparison and string conversion utilities.

Used by NodeImpl::check_version() to compare the compile-time VLink version against the runtime library version. All fields default to -1 (invalid).

成员函数说明

◆ from_string()

Version vlink::Version::from_string ( const std::string & version_str)
staticnodiscardnoexcept

Parses a version string in "major.minor.patch" format.

Uses std::from_chars for each component; components missing from the string remain -1.

参数
version_strString such as "2.1.0".
返回
Parsed Version; any missing component stays -1.

◆ is_valid()

bool vlink::Version::is_valid ( ) const
nodiscardnoexcept

Returns true when all three components are non-negative.

返回
true if the version was successfully parsed or explicitly set.
函数调用图:
这是这个函数的调用关系图:

◆ operator!=()

bool vlink::Version::operator!= ( const Version & target) const
nodiscardnoexcept

Returns true when versions differ.

参数
targetVersion to compare against.
返回
Logical negation of operator==.

◆ operator<()

bool vlink::Version::operator< ( const Version & target) const
nodiscardnoexcept

Returns true when this version is older than target.

Compares major first, then minor, then patch (numeric order).

参数
targetVersion to compare against.
返回
true if this version is strictly less than target.

◆ operator==()

bool vlink::Version::operator== ( const Version & target) const
nodiscardnoexcept

Returns true when both versions are identical.

参数
targetVersion to compare against.
返回
true if major, minor, and patch are all equal.

◆ operator>()

bool vlink::Version::operator> ( const Version & target) const
nodiscardnoexcept

Returns true when this version is newer than target.

参数
targetVersion to compare against.
返回
true if this version is strictly greater than target.

◆ to_string()

std::string vlink::Version::to_string ( ) const
nodiscardnoexcept

Converts this version to a "major.minor.patch" string.

返回
Formatted version string, e.g. "2.1.0".

类成员变量说明

◆ major

int vlink::Version::major {-1}

Major version number; -1 if not set.

◆ minor

int vlink::Version::minor {-1}

Minor version number; -1 if not set.

◆ patch

int vlink::Version::patch {-1}

Patch version number; -1 if not set.


该结构体的文档由以下文件生成: