EnTT 3.13.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
entt::basic_sigh_mixin< Type, Registry > Class Template Reference

Mixin type used to add signal support to storage types. More...

#include <mixin.hpp>

Inheritance diagram for entt::basic_sigh_mixin< Type, Registry >:
Inheritance graph
[legend]
Collaboration diagram for entt::basic_sigh_mixin< Type, Registry >:
Collaboration graph
[legend]

Public Types

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.
 

Public Member Functions

 basic_sigh_mixin ()
 Default constructor.
 
 basic_sigh_mixin (const allocator_type &allocator)
 Constructs an empty storage with a given allocator.
 
 basic_sigh_mixin (basic_sigh_mixin &&other) noexcept
 Move constructor.
 
 basic_sigh_mixin (basic_sigh_mixin &&other, const allocator_type &allocator) noexcept
 Allocator-extended move constructor.
 
basic_sigh_mixinoperator= (basic_sigh_mixin &&other) noexcept
 Move assignment operator.
 
void swap (basic_sigh_mixin &other)
 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.
 
auto emplace ()
 Emplace elements into a storage.
 
template<typename... Args>
decltype(auto) 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.
 
void bind (any value) noexcept final
 Forwards variables to derived classes, if any.
 

Detailed Description

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.
Definition registry.hpp:233
typename underlying_type::entity_type entity_type
Underlying entity identifier.
Definition mixin.hpp:91

This applies to all signals made available.

Template Parameters
TypeUnderlying storage type.
RegistryBasic registry type.

Definition at line 29 of file mixin.hpp.

Member Typedef Documentation

◆ allocator_type

template<typename Type , typename Registry >
using entt::basic_sigh_mixin< Type, Registry >::allocator_type = typename underlying_type::allocator_type

Allocator type.

Definition at line 89 of file mixin.hpp.

◆ entity_type

template<typename Type , typename Registry >
using entt::basic_sigh_mixin< Type, Registry >::entity_type = typename underlying_type::entity_type

Underlying entity identifier.

Definition at line 91 of file mixin.hpp.

◆ registry_type

template<typename Type , typename Registry >
using entt::basic_sigh_mixin< Type, Registry >::registry_type = owner_type

Expected registry type.

Definition at line 93 of file mixin.hpp.

Constructor & Destructor Documentation

◆ basic_sigh_mixin() [1/4]

template<typename Type , typename Registry >
entt::basic_sigh_mixin< Type, Registry >::basic_sigh_mixin ( )
inline

Default constructor.

Definition at line 96 of file mixin.hpp.

◆ basic_sigh_mixin() [2/4]

template<typename Type , typename Registry >
entt::basic_sigh_mixin< Type, Registry >::basic_sigh_mixin ( const allocator_type allocator)
inlineexplicit

Constructs an empty storage with a given allocator.

Parameters
allocatorThe allocator to use.

Definition at line 103 of file mixin.hpp.

◆ basic_sigh_mixin() [3/4]

template<typename Type , typename Registry >
entt::basic_sigh_mixin< Type, Registry >::basic_sigh_mixin ( basic_sigh_mixin< Type, Registry > &&  other)
inlinenoexcept

Move constructor.

Parameters
otherThe instance to move from.

Definition at line 114 of file mixin.hpp.

◆ basic_sigh_mixin() [4/4]

template<typename Type , typename Registry >
entt::basic_sigh_mixin< Type, Registry >::basic_sigh_mixin ( basic_sigh_mixin< Type, Registry > &&  other,
const allocator_type allocator 
)
inlinenoexcept

Allocator-extended move constructor.

Parameters
otherThe instance to move from.
allocatorThe allocator to use.

Definition at line 126 of file mixin.hpp.

Member Function Documentation

◆ bind()

template<typename Type , typename Registry >
void entt::basic_sigh_mixin< Type, Registry >::bind ( any  value)
inlinefinalnoexcept

Forwards variables to derived classes, if any.

Parameters
valueA variable wrapped in an opaque container.

Definition at line 287 of file mixin.hpp.

◆ emplace() [1/2]

template<typename Type , typename Registry >
auto entt::basic_sigh_mixin< Type, Registry >::emplace ( )
inline

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
A return value as returned by the underlying storage.

Definition at line 214 of file mixin.hpp.

◆ emplace() [2/2]

template<typename Type , typename Registry >
template<typename... Args>
decltype(auto) entt::basic_sigh_mixin< Type, Registry >::emplace ( const entity_type  hint,
Args &&...  args 
)
inline

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
ArgsTypes of arguments to forward to the underlying storage.
Parameters
hintA valid identifier.
argsParameters to forward to the underlying storage.
Returns
A return value as returned by the underlying storage.

Definition at line 233 of file mixin.hpp.

◆ insert()

template<typename Type , typename Registry >
template<typename It , typename... Args>
void entt::basic_sigh_mixin< Type, Registry >::insert ( It  first,
It  last,
Args &&...  args 
)
inline

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
ItIterator type (as required by the underlying storage type).
ArgsTypes of arguments to forward to the underlying storage.
Parameters
firstAn iterator to the first element of the range.
lastAn iterator past the last element of the range.
argsParameters to use to forward to the underlying storage.

Definition at line 273 of file mixin.hpp.

◆ on_construct()

template<typename Type , typename Registry >
auto entt::basic_sigh_mixin< Type, Registry >::on_construct ( )
inlinenoexcept

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 171 of file mixin.hpp.

◆ on_destroy()

template<typename Type , typename Registry >
auto entt::basic_sigh_mixin< Type, Registry >::on_destroy ( )
inlinenoexcept

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 201 of file mixin.hpp.

◆ on_update()

template<typename Type , typename Registry >
auto entt::basic_sigh_mixin< Type, Registry >::on_update ( )
inlinenoexcept

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 186 of file mixin.hpp.

◆ operator=()

template<typename Type , typename Registry >
basic_sigh_mixin & entt::basic_sigh_mixin< Type, Registry >::operator= ( basic_sigh_mixin< Type, Registry > &&  other)
inlinenoexcept

Move assignment operator.

Parameters
otherThe instance to move from.
Returns
This storage.

Definition at line 138 of file mixin.hpp.

◆ patch()

template<typename Type , typename Registry >
template<typename... Func>
decltype(auto) entt::basic_sigh_mixin< Type, Registry >::patch ( const entity_type  entt,
Func &&...  func 
)
inline

Patches the given instance for an entity.

Template Parameters
FuncTypes of the function objects to invoke.
Parameters
enttA valid identifier.
funcValid function objects.
Returns
A reference to the patched instance.

Definition at line 253 of file mixin.hpp.

◆ swap()

template<typename Type , typename Registry >
void entt::basic_sigh_mixin< Type, Registry >::swap ( basic_sigh_mixin< Type, Registry > &  other)
inline

Exchanges the contents with those of a given storage.

Parameters
otherStorage to exchange the content with.

Definition at line 151 of file mixin.hpp.


The documentation for this class was generated from the following files: