Mixin type used to add signal support to storage types.
More...
#include <mixin.hpp>
|
using | allocator_type = typename underlying_type::allocator_type |
| Allocator type.
|
|
using | entity_type = typename underlying_type::entity_type |
| Underlying entity identifier.
|
|
using | registry_type = owner_type |
| Expected registry type.
|
|
|
| basic_sigh_mixin () |
| Default constructor.
|
|
| basic_sigh_mixin (const allocator_type &allocator) |
| Constructs an empty storage with a given allocator.
|
|
| basic_sigh_mixin (const basic_sigh_mixin &)=delete |
| Default copy constructor, deleted on purpose.
|
|
| basic_sigh_mixin (basic_sigh_mixin &&other) noexcept |
| Move constructor.
|
|
| basic_sigh_mixin (basic_sigh_mixin &&other, const allocator_type &allocator) |
| Allocator-extended move constructor.
|
|
| ~basic_sigh_mixin () override=default |
| Default destructor.
|
|
basic_sigh_mixin & | operator= (const basic_sigh_mixin &)=delete |
| Default copy assignment operator, deleted on purpose.
|
|
basic_sigh_mixin & | operator= (basic_sigh_mixin &&other) noexcept |
| Move assignment operator.
|
|
void | swap (basic_sigh_mixin &other) noexcept |
| Exchanges the contents with those of a given storage.
|
|
auto | on_construct () noexcept |
| Returns a sink object.
|
|
auto | on_update () noexcept |
| Returns a sink object.
|
|
auto | on_destroy () noexcept |
| Returns a sink object.
|
|
| operator bool () const noexcept |
| Checks if a mixin refers to a valid registry.
|
|
const registry_type & | registry () const noexcept |
| Returns a pointer to the underlying registry, if any.
|
|
registry_type & | registry () noexcept |
| Returns a pointer to the underlying registry, if any.
|
|
auto | emplace () |
| Emplace elements into a storage.
|
|
template<typename... Args> |
std::conditional_t< std::is_same_v< typename underlying_type::element_type, entity_type >, entity_type, decltype(std::declval< underlying_type >().get({}))> | emplace (const entity_type hint, Args &&...args) |
| Emplace elements into a storage.
|
|
template<typename... Func> |
decltype(auto) | patch (const entity_type entt, Func &&...func) |
| Patches the given instance for an entity.
|
|
template<typename It , typename... Args> |
void | insert (It first, It last, Args &&...args) |
| Emplace elements into a storage.
|
|
template<typename Type, typename Registry>
class entt::basic_sigh_mixin< Type, Registry >
Mixin type used to add signal support to storage types.
The function type of a listener is equivalent to:
Fast and reliable entity-component system.
typename underlying_type::entity_type entity_type
Underlying entity identifier.
This applies to all signals made available.
- Template Parameters
-
Type | Underlying storage type. |
Registry | Basic registry type. |
Definition at line 71 of file mixin.hpp.
◆ allocator_type
template<typename Type , typename Registry >
◆ entity_type
template<typename Type , typename Registry >
Underlying entity identifier.
Definition at line 141 of file mixin.hpp.
◆ registry_type
template<typename Type , typename Registry >
Expected registry type.
Definition at line 143 of file mixin.hpp.
◆ basic_sigh_mixin() [1/4]
template<typename Type , typename Registry >
Default constructor.
Definition at line 146 of file mixin.hpp.
◆ basic_sigh_mixin() [2/4]
template<typename Type , typename Registry >
Constructs an empty storage with a given allocator.
- Parameters
-
allocator | The allocator to use. |
Definition at line 153 of file mixin.hpp.
◆ basic_sigh_mixin() [3/4]
template<typename Type , typename Registry >
Move constructor.
- Parameters
-
other | The instance to move from. |
Definition at line 179 of file mixin.hpp.
◆ basic_sigh_mixin() [4/4]
template<typename Type , typename Registry >
Allocator-extended move constructor.
- Parameters
-
other | The instance to move from. |
allocator | The allocator to use. |
Definition at line 191 of file mixin.hpp.
◆ emplace() [1/2]
template<typename Type , typename Registry >
Emplace elements into a storage.
The behavior of this operation depends on the underlying storage type (for example, components vs entities).
Refer to the specific documentation for more details.
- Returns
- Whatever the underlying storage returns.
Definition at line 305 of file mixin.hpp.
◆ emplace() [2/2]
template<typename Type , typename Registry >
template<typename... Args>
Emplace elements into a storage.
The behavior of this operation depends on the underlying storage type (for example, components vs entities).
Refer to the specific documentation for more details.
- Template Parameters
-
Args | Types of arguments to forward to the underlying storage. |
- Parameters
-
hint | A valid identifier. |
args | Parameters to forward to the underlying storage. |
- Returns
- Whatever the underlying storage returns.
Definition at line 325 of file mixin.hpp.
◆ insert()
template<typename Type , typename Registry >
template<typename It , typename... Args>
Emplace elements into a storage.
The behavior of this operation depends on the underlying storage type (for example, components vs entities).
Refer to the specific documentation for more details.
- Template Parameters
-
It | Iterator type (as required by the underlying storage type). |
Args | Types of arguments to forward to the underlying storage. |
- Parameters
-
first | An iterator to the first element of the range. |
last | An iterator past the last element of the range. |
args | Parameters to use to forward to the underlying storage. |
Definition at line 365 of file mixin.hpp.
◆ on_construct()
template<typename Type , typename Registry >
Returns a sink object.
The sink returned by this function can be used to receive notifications whenever a new instance is created and assigned to an entity.
Listeners are invoked after the object has been assigned to the entity.
- See also
- sink
- Returns
- A temporary sink object.
Definition at line 241 of file mixin.hpp.
◆ on_destroy()
template<typename Type , typename Registry >
Returns a sink object.
The sink returned by this function can be used to receive notifications whenever an instance is removed from an entity and thus destroyed.
Listeners are invoked before the object has been removed from the entity.
- See also
- sink
- Returns
- A temporary sink object.
Definition at line 271 of file mixin.hpp.
◆ on_update()
template<typename Type , typename Registry >
Returns a sink object.
The sink returned by this function can be used to receive notifications whenever an instance is explicitly updated.
Listeners are invoked after the object has been updated.
- See also
- sink
- Returns
- A temporary sink object.
Definition at line 256 of file mixin.hpp.
◆ operator bool()
template<typename Type , typename Registry >
|
inlineexplicitnodiscardnoexcept |
Checks if a mixin refers to a valid registry.
- Returns
- True if the mixin refers to a valid registry, false otherwise.
Definition at line 279 of file mixin.hpp.
◆ operator=() [1/2]
template<typename Type , typename Registry >
Move assignment operator.
- Parameters
-
other | The instance to move from. |
- Returns
- This mixin.
Definition at line 212 of file mixin.hpp.
◆ operator=() [2/2]
template<typename Type , typename Registry >
Default copy assignment operator, deleted on purpose.
- Returns
- This mixin.
◆ patch()
template<typename Type , typename Registry >
template<typename... Func>
Patches the given instance for an entity.
- Template Parameters
-
Func | Types of the function objects to invoke. |
- Parameters
-
entt | A valid identifier. |
func | Valid function objects. |
- Returns
- A reference to the patched instance.
Definition at line 345 of file mixin.hpp.
◆ registry() [1/2]
template<typename Type , typename Registry >
Returns a pointer to the underlying registry, if any.
- Returns
- A pointer to the underlying registry, if any.
Definition at line 287 of file mixin.hpp.
◆ registry() [2/2]
template<typename Type , typename Registry >
Returns a pointer to the underlying registry, if any.
- Returns
- A pointer to the underlying registry, if any.
Definition at line 292 of file mixin.hpp.
◆ swap()
template<typename Type , typename Registry >
Exchanges the contents with those of a given storage.
- Parameters
-
other | Storage to exchange the content with. |
Definition at line 221 of file mixin.hpp.
The documentation for this class was generated from the following files: