VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
vlink::Version Struct Referencefinal

Semantic version number with comparison and string conversion utilities. More...

#include <types.h>

Collaboration diagram for vlink::Version:

Public Member Functions

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.

Static Public Member Functions

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

Public Attributes

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.

Detailed Description

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).

Member Function Documentation

◆ 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.

Parameters
version_strString such as "2.1.0".
Returns
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.

Returns
true if the version was successfully parsed or explicitly set.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

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

Returns true when versions differ.

Parameters
targetVersion to compare against.
Returns
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).

Parameters
targetVersion to compare against.
Returns
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.

Parameters
targetVersion to compare against.
Returns
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.

Parameters
targetVersion to compare against.
Returns
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.

Returns
Formatted version string, e.g. "2.1.0".

Member Data Documentation

◆ 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.


The documentation for this struct was generated from the following file: