SH4ZAM! 0.7.0
Fast math library for the Sega Dreamcast's SH4 CPU
Loading...
Searching...
No Matches
shz::version Class Reference

#include <shz_version.hpp>

Public Member Functions

constexpr version (shz_version_t value) noexcept
 
constexpr version (uint8_t major, uint16_t minor, uint8_t patch) noexcept
 
constexpr operator shz_version_t () const noexcept
 
constexpr version operator= (uint32_t rhs) noexcept
 
constexpr uint8_t major () const noexcept
 
constexpr uint16_t minor () const noexcept
 
constexpr uint8_t patch () const noexcept
 

Static Public Member Functions

static constexpr version compiled () noexcept
 
static version linked () noexcept
 

Detailed Description

Class representing a full SH4ZAM API version.

Definition at line 21 of file shz_version.hpp.

Constructor & Destructor Documentation

◆ version() [1/2]

shz::version::version ( shz_version_t value)
inlineconstexprnoexcept

Constructs a version from the given full value.

Definition at line 26 of file shz_version.hpp.

26 :
27 value_(value) {}

◆ version() [2/2]

shz::version::version ( uint8_t major,
uint16_t minor,
uint8_t patch )
inlineconstexprnoexcept

Constructs a full version from the given component values.

Definition at line 30 of file shz_version.hpp.

30 :
constexpr uint8_t major() const noexcept
Extracts the major component value from a full version.
constexpr uint8_t patch() const noexcept
Extracts the patch component value from a full version.
constexpr uint16_t minor() const noexcept
Extracts the minor component value from a full version.
constexpr version(shz_version_t value) noexcept
Constructs a version from the given full value.
#define SHZ_VERSION_INIT(major, minor, patch)
Packs values of individual version components into a SH4ZAM full version value.
Definition shz_version.h:44

Member Function Documentation

◆ compiled()

static constexpr version shz::version::compiled ( )
inlinestaticconstexprnoexcept

Compile-time version of SH4ZAM headers which are being included.

Definition at line 34 of file shz_version.hpp.

34{ return SHZ_VERSION; }
#define SHZ_VERSION
Current SH4ZAM full compile-time version identifier, integer-compatible.
Definition shz_version.h:30

◆ linked()

static version shz::version::linked ( )
inlinestaticnoexcept

Link-time version of SH4ZAM library which was linked against.

Definition at line 37 of file shz_version.hpp.

37{ return shz_version_linked(); }
shz_version_t shz_version_linked(void)
Returns the full version of SH4ZAM that was linked against.

◆ operator shz_version_t()

shz::version::operator shz_version_t ( ) const
inlineconstexprnoexcept

Implicit conversion operator to make this class automatically comparable to a uint32_t.

Definition at line 40 of file shz_version.hpp.

40{ return value_; }

◆ operator=()

version shz::version::operator= ( uint32_t rhs)
inlineconstexprnoexcept

Assignment operator for assigning a version to a full version ID value.

Definition at line 43 of file shz_version.hpp.

43{ value_ = rhs; return *this; }

◆ major()

uint8_t shz::version::major ( ) const
inlineconstexprnoexcept

Extracts the major component value from a full version.

Definition at line 46 of file shz_version.hpp.

46{ return (value_ >> 24) & 0xff; }

◆ minor()

uint16_t shz::version::minor ( ) const
inlineconstexprnoexcept

Extracts the minor component value from a full version.

Definition at line 49 of file shz_version.hpp.

49{ return (value_ >> 8) & 0xffff; }

◆ patch()

uint8_t shz::version::patch ( ) const
inlineconstexprnoexcept

Extracts the patch component value from a full version.

Definition at line 52 of file shz_version.hpp.

52{ return value_ & 0xff; }

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