id_base_t< tag, impl > Class Template Reference
Detailed Description
template<typename tag, typename impl>
class id_base_t< tag, impl >
The id_base_t class.
- Template Parameters
-
tag Type of the object identified. impl Underlying implementation of id_base_t.
The base identifier type. Classes should not have to use this directly; instead the identifier type is Id<T>.
A class wishing to be identified like this should inherit from IdentifiedObject<T> or Entity<T>, like this :
This ensures that one cannot mistakenly use the identifier of an object in another object, e.g. one cannot do :
// ...
myFunction(myModel.id());
The compiler will rightfully prevent this incorrect code from working.
The class has a cache to allow for fast access to the object it is identifying.
- See also
- Id
- IdentifiedObject
- IdentifiedObjectMap
- Entity
- EntityMap
Public Types | |
using | value_type = impl |
Public Member Functions | |
id_base_t (const id_base_t &other) noexcept | |
id_base_t (id_base_t &&other) noexcept | |
template<typename other > | |
requires (std::is_base_of_v< tag, other >) id_base_t(const id_base_t< other | |
impl &oid other | id_base_t (id_base_t &&oid) noexcept |
id_base_t & | operator= (const id_base_t &other) noexcept |
id_base_t & | operator= (id_base_t &&other) noexcept |
id_base_t (value_type val) noexcept | |
id_base_t (tag &element) noexcept | |
id_base_t & | operator= (tag &element) noexcept |
operator value_type () const noexcept | |
const value_type & | val () const noexcept |
void | setVal (value_type val) noexcept |
Public Attributes | |
impl &oid | noexcept: m_id{oid.val()} { } template <typename other> requires(std::is_base_of_v<tag |
Friends | |
class | score::EntityMap< tag, false > |
class | score::EntityMap< tag, true > |
class | IdentifiedObject< tag > |
template<typename Element , typename Model , bool Order> | |
class | IdContainer |
bool | operator== (const id_base_t &lhs, const id_base_t &rhs) noexcept |
bool | operator!= (const id_base_t &lhs, const id_base_t &rhs) noexcept |
bool | operator< (const id_base_t &lhs, const id_base_t &rhs) noexcept |
The documentation for this class was generated from the following file: