#include <RuntimeId.hpp>
Public Member Functions | |
RuntimeId () | |
RuntimeId (int runtime) | |
RuntimeId (const char *persistent) | |
No warning if conversion fails. More... | |
RuntimeId (const char *persistent, Context *context) | |
Emmits warning if conversion fails. More... | |
bool | operator== (Me const &other) const |
bool | operator!= (Me const &other) const |
bool | operator< (Me const &other) const |
int | runtime_value () const |
std::string | persistent_value () const |
bool | valid () const |
Same result as comparing it to default value, eg myid != MyRuntimeId() . More... | |
Static Public Member Functions | |
static Me | create (const char *persistent_name) |
If RuntimeId was already locked, this will emmit runtime_warning. More... | |
static void | lock () |
This tells us that something used ids_count for something that will not be changed, so that functionality of newer ids might be incomplete. Creating new ids after locking the RuntimeId will emmit runtime_warning. More... | |
static size_t | ids_count () |
How many ids exist, including invalid id 0. Min id is ids_count - 1. All ids between 0 and ids_count are valid ids. More... | |
Static Public Attributes | |
static constexpr char | TypeName [] = "Unknown" |
Detailed Description
template<class Me>
class iv::RuntimeId< Me >
Specialization example: in .hpp: class AbilityInfoId : public RuntimeId< AbilityInfoId > { public: static constexpr char TypeName[] = "AbilityInfoId"; using RuntimeId< AbilityInfoId >::RuntimeId; static RuntimeIdDictionary Dictionary; };
in .cpp: RuntimeIdDictionary AbilityInfoId::Dictionary;
Definition at line 75 of file RuntimeId.hpp.
Constructor & Destructor Documentation
◆ RuntimeId() [1/4]
iv::RuntimeId< Me >::RuntimeId |
Definition at line 11 of file RuntimeId.inl.
◆ RuntimeId() [2/4]
|
explicit |
Definition at line 17 of file RuntimeId.inl.
◆ RuntimeId() [3/4]
|
explicit |
No warning if conversion fails.
Definition at line 23 of file RuntimeId.inl.
◆ RuntimeId() [4/4]
|
explicit |
Emmits warning if conversion fails.
Definition at line 29 of file RuntimeId.inl.
Member Function Documentation
◆ create()
|
static |
If RuntimeId was already locked, this will emmit runtime_warning.
Definition at line 37 of file RuntimeId.inl.
◆ lock()
|
static |
This tells us that something used ids_count for something that will not be changed, so that functionality of newer ids might be incomplete. Creating new ids after locking the RuntimeId will emmit runtime_warning.
Definition at line 43 of file RuntimeId.inl.
◆ ids_count()
|
static |
How many ids exist, including invalid id 0. Min id is ids_count - 1. All ids between 0 and ids_count are valid ids.
Definition at line 49 of file RuntimeId.inl.
◆ operator==()
bool iv::RuntimeId< Me >::operator== | ( | Me const & | other | ) | const |
Definition at line 73 of file RuntimeId.inl.
◆ operator!=()
bool iv::RuntimeId< Me >::operator!= | ( | Me const & | other | ) | const |
Definition at line 79 of file RuntimeId.inl.
◆ operator<()
bool iv::RuntimeId< Me >::operator< | ( | Me const & | other | ) | const |
Definition at line 85 of file RuntimeId.inl.
◆ runtime_value()
int iv::RuntimeId< Me >::runtime_value |
Definition at line 55 of file RuntimeId.inl.
◆ persistent_value()
std::string iv::RuntimeId< Me >::persistent_value |
Definition at line 61 of file RuntimeId.inl.
◆ valid()
bool iv::RuntimeId< Me >::valid |
Same result as comparing it to default value, eg myid != MyRuntimeId()
.
Definition at line 67 of file RuntimeId.inl.
Member Data Documentation
◆ TypeName
|
staticconstexpr |
Definition at line 79 of file RuntimeId.hpp.
The documentation for this class was generated from the following files:
- ivorium_core/Basics/RuntimeId.hpp
- ivorium_core/Basics/RuntimeId.inl