#include <Entity.hh>
Public Member Functions | |
EntityPtr ()=default | |
EntityPtr (const EntityPtr &) | |
template<typename OtherEntityT > | |
EntityPtr (const EntityPtr< OtherEntityT > &_other) | |
Create a new reference to another entity. | |
template<typename Pimpl > | |
EntityPtr (const std::shared_ptr< Pimpl > &_pimpl, const Identity &_identity) | |
Create an EntityPtr that points to the Entity tied to _identity. | |
EntityPtr (EntityPtr &&)=default | |
EntityPtr (std::nullopt_t) | |
Create an EntityPtr that points to an invalid Entity. | |
EntityPtr (std::nullptr_t) | |
Create an EntityPtr that points to an invalid Entity. | |
~EntityPtr ()=default | |
std::size_t | Hash () const |
Produces a hash for the Entity that this EntityPtr is referring to. This function allows EntityPtr instances to be used as values in a std::unordered_set or keys in a std::unordered_map. Using this function directly should not normally be necessary. | |
operator bool () const | |
Implicitly cast this EntityPtr to a boolean. | |
template<typename OtherEntityT > | |
bool | operator!= (const EntityPtr< OtherEntityT > &_other) const |
Comparison operator. | |
EntityT & | operator* () const |
Dereference operator. Access a reference to the Entity being pointed to. This does NOT check whether the Entity is valid before trying to provide it. If the validity of the Entity is in doubt, check IsEmpty() or simply operator bool() before attempting to use this operator. | |
EntityT * | operator-> () const |
Drill operator. Access members of the Entity being pointed to. This does NOT check whether the Entity is valid before trying to use it. If the validity of the Entity is in doubt, check Valid() or simply operator bool() before attempting to use this operator. | |
template<typename OtherEntityT > | |
bool | operator< (const EntityPtr< OtherEntityT > &_other) const |
Comparison operator. | |
template<typename OtherEntityT > | |
bool | operator<= (const EntityPtr< OtherEntityT > &_other) const |
Comparison operator. | |
EntityPtr & | operator= (const EntityPtr &) |
template<typename OtherEntityT > | |
EntityPtr & | operator= (const EntityPtr< OtherEntityT > &_other) |
Assign this to point at another compatible Entity. | |
EntityPtr & | operator= (EntityPtr &&)=default |
EntityPtr & | operator= (std::nullopt_t) |
Assign this to point to an invalid Entity. | |
EntityPtr & | operator= (std::nullptr_t) |
Assign this to point to an invalid Entity. | |
template<typename OtherEntityT > | |
bool | operator== (const EntityPtr< OtherEntityT > &_other) const |
Comparison operator. | |
template<typename OtherEntityT > | |
bool | operator> (const EntityPtr< OtherEntityT > &_other) const |
Comparison operator. | |
template<typename OtherEntityT > | |
bool | operator>= (const EntityPtr< OtherEntityT > &_other) const |
Comparison operator. | |
bool | Valid () const |
Check whether this is pointing at a valid Entity. | |
Constructor & Destructor Documentation
◆ EntityPtr() [1/7]
|
default |
◆ EntityPtr() [2/7]
◆ ~EntityPtr()
|
default |
◆ EntityPtr() [3/7]
◆ EntityPtr() [4/7]
EntityPtr | ( | std::nullptr_t | ) |
◆ EntityPtr() [5/7]
EntityPtr | ( | std::nullopt_t | ) |
◆ EntityPtr() [6/7]
EntityPtr | ( | const std::shared_ptr< Pimpl > & | _pimpl, |
const Identity & | _identity | ||
) |
◆ EntityPtr() [7/7]
EntityPtr | ( | const EntityPtr< OtherEntityT > & | _other | ) |
Create a new reference to another entity.
- Parameters
-
[in] _other Another entity reference with a compatible type and compatible set of features
Member Function Documentation
◆ Hash()
std::size_t Hash | ( | ) | const |
Produces a hash for the Entity that this EntityPtr is referring to. This function allows EntityPtr instances to be used as values in a std::unordered_set or keys in a std::unordered_map. Using this function directly should not normally be necessary.
- Returns
- A hash of the underlying Entity.
◆ operator bool()
operator bool | ( | ) | const |
◆ operator!=()
bool operator!= | ( | const EntityPtr< OtherEntityT > & | _other | ) | const |
Comparison operator.
- Parameters
-
[in] _other Entity to compare to.
- Remarks
- Entities are uniquely identified by their underlying ID which is assigned by the physics engine. This may produce unintuitive results depending on how the physics engine organizes its Entities.
- Returns
- True if the ID of this Entity is not equal to the ID of _other, otherwise returns false.
◆ operator*()
EntityT & operator* | ( | ) | const |
Dereference operator. Access a reference to the Entity being pointed to. This does NOT check whether the Entity is valid before trying to provide it. If the validity of the Entity is in doubt, check IsEmpty() or simply operator bool() before attempting to use this operator.
- Returns
- A reference to the underlying entity
◆ operator->()
EntityT * operator-> | ( | ) | const |
Drill operator. Access members of the Entity being pointed to. This does NOT check whether the Entity is valid before trying to use it. If the validity of the Entity is in doubt, check Valid() or simply operator bool() before attempting to use this operator.
- Returns
- The ability to call a member function on the underlying Entity
◆ operator<()
bool operator< | ( | const EntityPtr< OtherEntityT > & | _other | ) | const |
Comparison operator.
- Parameters
-
[in] _other Entity to compare to.
- Remarks
- Entities are uniquely identified by their underlying ID which is assigned by the physics engine. This may produce unintuitive results depending on how the physics engine organizes its Entities.
- Returns
- True if the ID of this Entity is less than the ID of _other, otherwise returns false.
◆ operator<=()
bool operator<= | ( | const EntityPtr< OtherEntityT > & | _other | ) | const |
Comparison operator.
- Parameters
-
[in] _other Entity to compare to.
- Remarks
- Entities are uniquely identified by their underlying ID which is assigned by the physics engine. This may produce unintuitive results depending on how the physics engine organizes its Entities.
- Returns
- True if the ID of this Entity is less than or equal to the ID of _other, otherwise returns false.
◆ operator=() [1/5]
◆ operator=() [2/5]
EntityPtr & operator= | ( | const EntityPtr< OtherEntityT > & | _other | ) |
Assign this to point at another compatible Entity.
- Parameters
-
[in] _other Another entity reference with a compatible type and compatible set of features.
◆ operator=() [3/5]
◆ operator=() [4/5]
EntityPtr & operator= | ( | std::nullopt_t | ) |
Assign this to point to an invalid Entity.
◆ operator=() [5/5]
EntityPtr & operator= | ( | std::nullptr_t | ) |
Assign this to point to an invalid Entity.
◆ operator==()
bool operator== | ( | const EntityPtr< OtherEntityT > & | _other | ) | const |
Comparison operator.
- Parameters
-
[in] _other Entity to compare to.
- Remarks
- Entities are uniquely identified by their underlying ID which is assigned by the physics engine. This may produce unintuitive results depending on how the physics engine organizes its Entities.
- Returns
- True if the ID of this Entity is equal to the ID of _other, otherwise returns false.
◆ operator>()
bool operator> | ( | const EntityPtr< OtherEntityT > & | _other | ) | const |
Comparison operator.
- Parameters
-
[in] _other Entity to compare to.
- Remarks
- Entities are uniquely identified by their underlying ID which is assigned by the physics engine. This may produce unintuitive results depending on how the physics engine organizes its Entities.
- Returns
- True if the ID of this Entity is greater than the ID of _other, otherwise returns false.
◆ operator>=()
bool operator>= | ( | const EntityPtr< OtherEntityT > & | _other | ) | const |
Comparison operator.
- Parameters
-
[in] _other Entity to compare to.
- Remarks
- Entities are uniquely identified by their underlying ID which is assigned by the physics engine. This may produce unintuitive results depending on how the physics engine organizes its Entities.
- Returns
- True if the ID of this Entity is greater than or equal to the ID of _other, otherwise returns false.
◆ Valid()
bool Valid | ( | ) | const |
The documentation for this class was generated from the following file: