Bifrost SDK
Bifrost SDK documentation
Version.h
Go to the documentation of this file.
1//-
2// =============================================================================
3// Copyright 2022 Autodesk, Inc. All rights reserved.
4//
5// Use of this software is subject to the terms of the Autodesk license
6// agreement provided at the time of installation or download, or which
7// otherwise accompanies this software in either electronic or hard copy form.
8// =============================================================================
9//+
10
11#ifndef BIFROST_VERSION_H_
12#define BIFROST_VERSION_H_
13
14#include <cstdint>
15#include <string>
16
18#define _bifrost_version_ "2.15.0.11"
19
21#define _bifrost_arch_ 2
22
24#define _bifrost_major_ 15
25
27#define _bifrost_minor_ 0
28
30#define _bifrost_patch_ 11
31
32static_assert((_bifrost_arch_ > 0 && _bifrost_arch_ < 100),
33 "_bifrost_arch_ out of range");
34static_assert((_bifrost_major_ >= 0 && _bifrost_major_ < 100),
35 "_bifrost_major_ out of range");
36static_assert((_bifrost_minor_ >= 0 && _bifrost_minor_ < 100),
37 "_bifrost_minor_ out of range");
38static_assert((_bifrost_patch_ >= 0 && _bifrost_patch_ < 1000),
39 "_bifrost_patch_ out of range");
40
41namespace Bifrost {
42//----------------------------------------------------------------------------
43//
44namespace Version {
45
46//----------------------------------------------------------------------------
47//
49static inline constexpr unsigned getArchNumber() {
50 return static_cast<unsigned>(_bifrost_arch_);
51}
52
53//----------------------------------------------------------------------------
54//
56static inline constexpr unsigned getMajorNumber() {
57 return static_cast<unsigned>(_bifrost_major_);
58}
59
60//----------------------------------------------------------------------------
61//
63static inline constexpr unsigned getMinorNumber() {
64 return static_cast<unsigned>(_bifrost_minor_);
65}
66
67//----------------------------------------------------------------------------
68//
70static inline constexpr unsigned getPatchNumber() {
71 return static_cast<unsigned>(_bifrost_patch_);
72}
73
74//----------------------------------------------------------------------------
75//
77static inline std::string getAsString() {
78 return std::string(_bifrost_version_);
79}
80
81//-----------------------------------------------------------------------------
82//
86static inline constexpr uint64_t getAsNumber() {
87 return (getArchNumber() * 100 * 100 * 1000 + getMajorNumber() * 100 * 1000
88 + getMinorNumber() * 1000 + getPatchNumber());
89}
90
91} // namespace Version
92} // namespace Bifrost
93
94#endif // BIFROST_VERSION_H_
#define _bifrost_version_
String representation of the complete bifrost version.
Definition: Version.h:18
#define _bifrost_major_
Major number part of Bifrost version.
Definition: Version.h:24
#define _bifrost_minor_
Minor number part of Bifrost version.
Definition: Version.h:27
#define _bifrost_arch_
Arch number part of Bifrost version.
Definition: Version.h:21
#define _bifrost_patch_
Patch number part of Bifrost version.
Definition: Version.h:30
Definition: FCurve.h:35
static constexpr unsigned getMajorNumber()
Returns the Major number part of Bifrost version.
Definition: Version.h:56
static std::string getAsString()
Returns the complete Bifrost version as a std::string.
Definition: Version.h:77
static constexpr uint64_t getAsNumber()
Returns the complete Bifrost version as a single 64-bit unsigned.
Definition: Version.h:86
static constexpr unsigned getArchNumber()
Returns the Arch number part of Bifrost version.
Definition: Version.h:49
static constexpr unsigned getMinorNumber()
Returns the Minor number part of Bifrost version.
Definition: Version.h:63
static constexpr unsigned getPatchNumber()
Returns the Patch number part of Bifrost version.
Definition: Version.h:70