Skip to main content

types Namespace

Definition

namespace helios::engine::runtime::enginestate::types { ... }

Typedefs Index

usingEngineStateType = uint16_t

Underlying type for EngineState bitmask values. More...

Enumerations Index

enum classEngineState : EngineStateType { ... }

Enumeration of possible game states. More...

enum classEngineStateTransitionId : uint16_t { ... }

Enumeration of transition identifiers. More...

Operators Index

constexpr EngineStateoperator| (const EngineState lhs, const EngineState rhs) noexcept

Bitwise OR operator for combining game states. More...

constexpr EngineStateoperator& (const EngineState lhs, const EngineState rhs) noexcept

Bitwise AND operator for masking game states. More...

constexpr EngineStateoperator~ (const EngineState lhs) noexcept

Bitwise NOT operator for inverting game state bits. More...

Functions Index

constexpr boolhasFlag (const EngineState mask, const EngineState flag) noexcept

Checks if a flag is set in a state mask. More...

Variables Index

constexpr size_tEngineStateTypeSize = 16

Typedefs

EngineStateType

using helios::engine::runtime::enginestate::types::EngineStateType = typedef uint16_t

Underlying type for EngineState bitmask values.

Definition at line 19 of file EngineState.ixx.

Enumerations

EngineState

enum class helios::engine::runtime::enginestate::types::EngineState : EngineStateType
strong

Enumeration of possible game states.

Enumeration values
Undefined (= 0)
Booting (= 1 << 0)
Booted (= 1 << 1)
Warmup (= 1 << 2)
Running (= 1 << 3)
Shutdown (= 1 << 4)
AnyBitmask representing all base/ single-bit state flags (= Booting | Booted | Running | Shutdown | Warmup)
LiveBitmask representing any running state, i.e. any state except Booting, Booted, Warmup and Shutdown (= Any & ~(Booting | Booted | Warmup | Shutdown))

States can be combined using bitwise operators for masking.

Definition at line 28 of file EngineState.ixx.

29
30 Undefined = 0,
31
32 Booting = 1 << 0,
33
34 Booted = 1 << 1,
35
36 Warmup = 1 << 2,
37
38 Running = 1 << 3,
39
40 Shutdown = 1 << 4,
41
42
47
52
53
54 };

EngineStateTransitionId

enum class helios::engine::runtime::enginestate::types::EngineStateTransitionId : uint16_t
strong

Enumeration of transition identifiers.

Enumeration values
Undefined (= 0)
BootRequest
WarmupRequest
WarmupDone
ShutdownRequest

Each identifier represents a specific type of state transition request.

Definition at line 21 of file EngineStateTransitionId.ixx.

22
23 Undefined = 0,
24
26
28
30
32
33 };

Operators

operator&()

constexpr EngineState helios::engine::runtime::enginestate::types::operator& (const EngineState lhs, const EngineState rhs)
constexpr noexcept

Bitwise AND operator for masking game states.

Definition at line 66 of file EngineState.ixx.

66 [[nodiscard]] constexpr EngineState operator&(const EngineState lhs, const EngineState rhs) noexcept {
67 return static_cast<EngineState>(static_cast<EngineStateType>(lhs) & static_cast<EngineStateType>(rhs));
68 }

Reference helios::engine::runtime::registerComponents.

operator|()

constexpr EngineState helios::engine::runtime::enginestate::types::operator| (const EngineState lhs, const EngineState rhs)
constexpr noexcept

Bitwise OR operator for combining game states.

Definition at line 59 of file EngineState.ixx.

59 [[nodiscard]] constexpr EngineState operator|(const EngineState lhs, const EngineState rhs) noexcept {
60 return static_cast<EngineState>(static_cast<EngineStateType>(lhs) | static_cast<EngineStateType>(rhs));
61 }

Reference helios::engine::runtime::registerComponents.

operator~()

constexpr EngineState helios::engine::runtime::enginestate::types::operator~ (const EngineState lhs)
constexpr noexcept

Bitwise NOT operator for inverting game state bits.

Definition at line 73 of file EngineState.ixx.

73 [[nodiscard]] constexpr EngineState operator~(const EngineState lhs) noexcept {
75 }

References Any and helios::engine::runtime::registerComponents.

Functions

hasFlag()

constexpr bool helios::engine::runtime::enginestate::types::hasFlag (const EngineState mask, const EngineState flag)
constexpr noexcept

Checks if a flag is set in a state mask.

Parameters
mask

The state mask to check.

flag

The flag to check for.

Returns

True if the flag is set in the mask.

Definition at line 85 of file EngineState.ixx.

85 [[nodiscard]] constexpr bool hasFlag(const EngineState mask, const EngineState flag) noexcept {
86 return (mask & flag) == flag;
87 }

Reference helios::engine::runtime::registerComponents.

Variables

EngineStateTypeSize

constexpr size_t helios::engine::runtime::enginestate::types::EngineStateTypeSize = 16
constexpr

Definition at line 21 of file EngineState.ixx.

21 constexpr size_t EngineStateTypeSize = 16;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.