id_base_t< tag, impl > Class Template Reference

The id_base_t class. More...

Detailed Description

template<typename tag, typename impl>
class id_base_t< tag, impl >

The id_base_t class.

Template Parameters
tagType of the object identified.
implUnderlying 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 :

class MyModel :
public score::Entity<MyModel>
{
};
Base for complex model objects.
Definition: EntityBase.hpp:24

This ensures that one cannot mistakenly use the identifier of an object in another object, e.g. one cannot do :

void myFunction(Id<OtherModel> id);
// ...
myFunction(myModel.id());
The id_base_t class.
Definition: Identifier.hpp:57

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_toperator= (const id_base_t &other) noexcept
 
id_base_toperator= (id_base_t &&other) noexcept
 
 id_base_t (value_type val) noexcept
 
 id_base_t (tag &element) noexcept
 
id_base_toperator= (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: