#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]

template<class Me >
iv::RuntimeId< Me >::RuntimeId

Definition at line 11 of file RuntimeId.inl.

◆ RuntimeId() [2/4]

template<class Me >
iv::RuntimeId< Me >::RuntimeId ( int  runtime)
explicit

Definition at line 17 of file RuntimeId.inl.

◆ RuntimeId() [3/4]

template<class Me >
iv::RuntimeId< Me >::RuntimeId ( const char *  persistent)
explicit

No warning if conversion fails.

Definition at line 23 of file RuntimeId.inl.

◆ RuntimeId() [4/4]

template<class Me >
iv::RuntimeId< Me >::RuntimeId ( const char *  persistent,
Context context 
)
explicit

Emmits warning if conversion fails.

Definition at line 29 of file RuntimeId.inl.

Member Function Documentation

◆ create()

template<class Me >
Me iv::RuntimeId< Me >::create ( const char *  persistent_name)
static

If RuntimeId was already locked, this will emmit runtime_warning.

Definition at line 37 of file RuntimeId.inl.

◆ lock()

template<class Me >
void iv::RuntimeId< Me >::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()

template<class Me >
size_t iv::RuntimeId< Me >::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==()

template<class Me >
bool iv::RuntimeId< Me >::operator== ( Me const &  other) const

Definition at line 73 of file RuntimeId.inl.

◆ operator!=()

template<class Me >
bool iv::RuntimeId< Me >::operator!= ( Me const &  other) const

Definition at line 79 of file RuntimeId.inl.

◆ operator<()

template<class Me >
bool iv::RuntimeId< Me >::operator< ( Me const &  other) const

Definition at line 85 of file RuntimeId.inl.

◆ runtime_value()

template<class Me >
int iv::RuntimeId< Me >::runtime_value

Definition at line 55 of file RuntimeId.inl.

◆ persistent_value()

template<class Me >
std::string iv::RuntimeId< Me >::persistent_value

Definition at line 61 of file RuntimeId.inl.

◆ valid()

template<class Me >
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

template<class Me >
constexpr char iv::RuntimeId< Me >::TypeName[] = "Unknown"
staticconstexpr

Definition at line 79 of file RuntimeId.hpp.


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