Robot Raconteur Core C++ Library
Loading...
Searching...
No Matches
RobotRaconteur::RobotRaconteurVersion Class Reference

Robot Raconteur Version storage class. More...

#include <ServiceDefinition.h>

Public Member Functions

 RobotRaconteurVersion ()
 Construct a new default RobotRaconteurVersion instance.
 RobotRaconteurVersion (uint32_t major, uint32_t minor, uint32_t patch=0, uint32_t tweak=0)
 Construct a new RobotRaconteurVersion instance with a given version.
 RobotRaconteurVersion (boost::string_ref v)
 Construct a new RobotRaconteurVersion instance with a version parsed from as string.
std::string ToString () const
 Get the version as a string.
void FromString (boost::string_ref v, const ServiceDefinitionParseInfo *parse_info=NULL)
 Parse a version string and update version fields.
 operator bool () const
 Boolean operator test if version is specified.

Public Attributes

uint32_t major
 The major version.
uint32_t minor
 The minor version.
uint32_t patch
 The patch version.
uint32_t tweak
 The tweak version.
ServiceDefinitionParseInfo ParseInfo
 Parsing diagnostic information.

Friends

bool operator== (const RobotRaconteurVersion &v1, const RobotRaconteurVersion &v2)
 Equality operator.
bool operator!= (const RobotRaconteurVersion &v1, const RobotRaconteurVersion &v2)
 Inequality operator.
bool operator> (const RobotRaconteurVersion &v1, const RobotRaconteurVersion &v2)
 Greater than operator.
bool operator>= (const RobotRaconteurVersion &v1, const RobotRaconteurVersion &v2)
 Greater than or equal operator.
bool operator< (const RobotRaconteurVersion &v1, const RobotRaconteurVersion &v2)
 Less than operator.
bool operator<= (const RobotRaconteurVersion &v1, const RobotRaconteurVersion &v2)
 Less than or equal operator.

Detailed Description

Robot Raconteur Version storage class.

Stores a semantic version:

MAJOR.MINOR.PATCH(.tweak)?

Versioning should follow the Semantic Versioning 2.0.0 standard (http://semver.org/)

Constructor & Destructor Documentation

◆ RobotRaconteurVersion() [1/3]

RobotRaconteur::RobotRaconteurVersion::RobotRaconteurVersion ( )

Construct a new default RobotRaconteurVersion instance.

Version will be set to 0.0.0

◆ RobotRaconteurVersion() [2/3]

RobotRaconteur::RobotRaconteurVersion::RobotRaconteurVersion ( uint32_t major,
uint32_t minor,
uint32_t patch = 0,
uint32_t tweak = 0 )

Construct a new RobotRaconteurVersion instance with a given version.

Parameters
majorMajor version
minorMinor version
patchPatch version
tweakTweak version

◆ RobotRaconteurVersion() [3/3]

RobotRaconteur::RobotRaconteurVersion::RobotRaconteurVersion ( boost::string_ref v)

Construct a new RobotRaconteurVersion instance with a version parsed from as string.

String must be in the form "MAJOR.MINOR.PATCH.TWEAK", ie "1.0.4"

PATCH and TWEAK are optional

Parameters
vThe version as a string

Member Function Documentation

◆ FromString()

void RobotRaconteur::RobotRaconteurVersion::FromString ( boost::string_ref v,
const ServiceDefinitionParseInfo * parse_info = NULL )

Parse a version string and update version fields.

Fills major, minor, patch, and tweak fields from a string. String must be in the form "MAJOR.MINOR.PATCH.TWEAK", ie "1.0.4". PATCH and TWEAK are optional. Parse information may optionally be specified.

Parameters
vThe version string to parse
parse_infoParsing diagnostic information

◆ operator bool()

RobotRaconteur::RobotRaconteurVersion::operator bool ( ) const

Boolean operator test if version is specified.

The version is considered unspecified if version is all zeros

Returns
true The version is not all zeros
false The version is all zeros

◆ ToString()

std::string RobotRaconteur::RobotRaconteurVersion::ToString ( ) const

Get the version as a string.

Returns a string in the form "MAJOR.MINOR.PATCH.TWEAK". PATCH and TWEAK will be omitted if both are zero.

Returns
std::string The version as a string

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