Celeritas 0.7.0-dev.529+develop.b0df1df8d
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
celeritas::Version Class Reference

Simple version comparison. More...

#include <Version.hh>

Public Types

Type aliases
using size_type = unsigned int
 
using ArrayT = std::array< size_type, 3 >
 

Public Member Functions

constexpr Version (size_type major, size_type minor=0, size_type patch=0)
 Construct from x.y.z integers.
 
Accessors
constexpr ArrayT constvalue () const
 Get version as an array.
 
constexpr size_type major () const
 Get major version.
 
constexpr size_type minor () const
 Get minor version.
 
constexpr size_type patch () const
 Get patch version.
 

Static Public Member Functions

static Version from_string (std::string_view sv)
 Construct from a string "1.2.3".
 
static constexpr Version from_hex_xxyyzz (size_type value)
 Construct from an 0xXXYYZZ integer.
 
static constexpr Version from_dec_xyz (size_type value)
 Construct from a decimal with XYZ or XXYZ.
 

Detailed Description

Simple version comparison.

This is intended to be constructed with version numbers from celeritas_cmake_strings.hh and used in unit tests. It can be used in if constexpr expressions with preprocessor macros. In the constructor documentation, x/y/z correspond to major/minor/patch.

Version(4) == Version(4.0) == Version(4.0.0)
Version(3.1) > Version(3)
Simple version comparison.
Definition src/corecel/sys/Version.hh:40

Member Function Documentation

◆ from_dec_xyz()

constexpr Version celeritas::Version::from_dec_xyz ( size_type  value)
inlinestaticconstexpr

Construct from a decimal with XYZ or XXYZ.

This version scheme is used by Geant4.

◆ from_hex_xxyyzz()

constexpr Version celeritas::Version::from_hex_xxyyzz ( size_type  value)
inlinestaticconstexpr

Construct from an 0xXXYYZZ integer.

This version scheme is used by Celeritas. (The leading 0x prevents version 01 from turning the expression into an octal.)

◆ from_string()

Version celeritas::Version::from_string ( std::string_view  sv)
static

Construct from a string "1.2.3".

Ignore prerelease and build metadata suffixes introduced by '-' or '+'.


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