This class contains fields that identify an Entity. We use this separate class in order to have tight control over how Entities can be instantiated; in particular, an Identity can only be created by a plugin implementation, so users cannot create invalid Entities. More...
#include <Identity.hh>
Public Member Functions | |
operator bool () const | |
Convert to true if this Identity refers to a valid entity (i.e. its id field is not INVALID_ENTITY_ID). More... | |
operator std::size_t () const | |
Convert to the id value of this Identity. More... | |
Public Attributes | |
std::size_t | id |
This integer ID uniquely identifies the object that this entity is referring to. No two entities may use the same ID unless they are referring to the same instance of a physics engine object. More... | |
const std::shared_ptr< void > | ref |
This is an optional reference-counting field for the proxy objects. Not all engines are required to support this field for all types, so this may be left as a nullptr. More... | |
Detailed Description
This class contains fields that identify an Entity. We use this separate class in order to have tight control over how Entities can be instantiated; in particular, an Identity can only be created by a plugin implementation, so users cannot create invalid Entities.
Member Function Documentation
◆ operator bool()
operator bool | ( | ) | const |
Convert to true if this Identity refers to a valid entity (i.e. its id field is not INVALID_ENTITY_ID).
◆ operator std::size_t()
operator std::size_t | ( | ) | const |
Convert to the id value of this Identity.
Member Data Documentation
◆ id
std::size_t id |
This integer ID uniquely identifies the object that this entity is referring to. No two entities may use the same ID unless they are referring to the same instance of a physics engine object.
The ID is not allowed to change at any point in the lifetime of the engine object.
Note that the ID of 0 is reserved for the "engine" object.
◆ ref
const std::shared_ptr<void> ref |
This is an optional reference-counting field for the proxy objects. Not all engines are required to support this field for all types, so this may be left as a nullptr.
This reference is not allowed to change at any point in the lifetime of the engine object.
The documentation for this class was generated from the following file: