Leviathan  0.8.0.0
Leviathan game engine
Leviathan::PotentiallySetIndex Struct Reference

#include <Types.h>

Public Member Functions

 PotentiallySetIndex (size_t index)
 
 PotentiallySetIndex ()=default
 
 operator bool () const
 
 operator size_t () const
 
bool operator== (const PotentiallySetIndex &other) const
 
PotentiallySetIndexoperator= (const PotentiallySetIndex &other)
 
PotentiallySetIndexoperator= (const size_t &value)
 
bool IsSet () const
 

Public Attributes

bool ValueSet = false
 
size_t Index = 0
 

Detailed Description

Definition at line 38 of file Types.h.

Constructor & Destructor Documentation

◆ PotentiallySetIndex() [1/2]

Leviathan::PotentiallySetIndex::PotentiallySetIndex ( size_t  index)
inline

Definition at line 40 of file Types.h.

40 : ValueSet(true), Index(index) {}

◆ PotentiallySetIndex() [2/2]

Leviathan::PotentiallySetIndex::PotentiallySetIndex ( )
inlinedefault

Member Function Documentation

◆ IsSet()

bool Leviathan::PotentiallySetIndex::IsSet ( ) const
inline

Definition at line 84 of file Types.h.

85  {
86 
87  return ValueSet;
88  }

◆ operator bool()

Leviathan::PotentiallySetIndex::operator bool ( ) const
inline

Definition at line 43 of file Types.h.

44  {
45 
46  return ValueSet;
47  }

◆ operator size_t()

Leviathan::PotentiallySetIndex::operator size_t ( ) const
inline

Definition at line 49 of file Types.h.

50  {
51 #ifdef _DEBUG
53  ValueSet, "PotentiallySetIndex size_t() called when ValueSet is false");
54 #endif // _DEBUG
55 
56  return Index;
57  }
#define LEVIATHAN_ASSERT(x, msg)
Definition: Define.h:102

◆ operator=() [1/2]

PotentiallySetIndex& Leviathan::PotentiallySetIndex::operator= ( const PotentiallySetIndex other)
inline

Definition at line 68 of file Types.h.

69  {
70 
71  ValueSet = other.ValueSet;
72  Index = other.Index;
73  return *this;
74  }

◆ operator=() [2/2]

PotentiallySetIndex& Leviathan::PotentiallySetIndex::operator= ( const size_t &  value)
inline

Definition at line 76 of file Types.h.

77  {
78 
79  ValueSet = true;
80  Index = value;
81  return *this;
82  }

◆ operator==()

bool Leviathan::PotentiallySetIndex::operator== ( const PotentiallySetIndex other) const
inline

Definition at line 59 of file Types.h.

60  {
61 
62  if(!ValueSet)
63  return ValueSet == other.ValueSet;
64 
65  return Index == other.Index;
66  }

Member Data Documentation

◆ Index

size_t Leviathan::PotentiallySetIndex::Index = 0

Definition at line 91 of file Types.h.

◆ ValueSet

bool Leviathan::PotentiallySetIndex::ValueSet = false

Definition at line 90 of file Types.h.


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