Clementine
Public Types | Public Member Functions | List of all members
entt::sigh_storage_mixin< Type > Struct Template Reference

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

#include <entt.hpp>

Inheritance diagram for entt::sigh_storage_mixin< Type >:
Inheritance graph
[legend]
Collaboration diagram for entt::sigh_storage_mixin< Type >:
Collaboration graph
[legend]

Public Types

using value_type = typename Type::value_type
 Underlying value type.
 
using entity_type = typename Type::entity_type
 Underlying entity identifier.
 
using storage_category = typename Type::storage_category
 Storage category.
 

Public Member Functions

auto on_construct () ENTT_NOEXCEPT
 Returns a sink object. More...
 
auto on_update () ENTT_NOEXCEPT
 Returns a sink object. More...
 
auto on_destroy () ENTT_NOEXCEPT
 Returns a sink object. More...
 
template<typename... Args>
decltype(auto) emplace (basic_registry< entity_type > &owner, const entity_type entity, Args &&... args)
 Assigns entities to a storage. More...
 
template<typename It , typename... Args>
void insert (basic_registry< entity_type > &owner, It first, It last, Args &&... args)
 Assigns entities to a storage. More...
 
void remove (basic_registry< entity_type > &owner, const entity_type entity)
 Removes entities from a storage. More...
 
template<typename It >
void remove (basic_registry< entity_type > &owner, It first, It last)
 Removes entities from a storage. More...
 
template<typename... Func>
decltype(auto) patch (basic_registry< entity_type > &owner, const entity_type entity, [[maybe_unused]] Func &&... func)
 Patches the given instance for an entity. More...
 

Detailed Description

template<typename Type>
struct entt::sigh_storage_mixin< Type >

Mixin type to use to add signal support to storage types.

Template Parameters
TypeThe type of the underlying storage.

Member Function Documentation

◆ emplace()

template<typename Type >
template<typename... Args>
decltype(auto) entt::sigh_storage_mixin< Type >::emplace ( basic_registry< entity_type > &  owner,
const entity_type  entity,
Args &&...  args 
)
inline

Assigns entities to a storage.

Template Parameters
ArgsTypes of arguments to use to construct the object.
Parameters
ownerThe registry that issued the request.
entityA valid entity identifier.
argsParameters to use to initialize the object.
Returns
A reference to the newly created object.

◆ insert()

template<typename Type >
template<typename It , typename... Args>
void entt::sigh_storage_mixin< Type >::insert ( basic_registry< entity_type > &  owner,
It  first,
It  last,
Args &&...  args 
)
inline

Assigns entities to a storage.

Template Parameters
ItType of input iterator.
ArgsTypes of arguments to use to construct the objects associated with the entities.
Parameters
ownerThe registry that issued the request.
firstAn iterator to the first element of the range of entities.
lastAn iterator past the last element of the range of entities.
argsParameters to use to initialize the objects associated with the entities.

◆ on_construct()

template<typename Type >
auto entt::sigh_storage_mixin< Type >::on_construct ( )
inline

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.
The function type for a listener is equivalent to:

void(basic_registry<entity_type> &, entity_type);

Listeners are invoked after the object has been assigned to the entity.

See also
sink
Returns
A temporary sink object.

◆ on_destroy()

template<typename Type >
auto entt::sigh_storage_mixin< Type >::on_destroy ( )
inline

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.
The function type for a listener is equivalent to:

void(basic_registry<entity_type> &, entity_type);

Listeners are invoked before the object has been removed from the entity.

See also
sink
Returns
A temporary sink object.

◆ on_update()

template<typename Type >
auto entt::sigh_storage_mixin< Type >::on_update ( )
inline

Returns a sink object.

The sink returned by this function can be used to receive notifications whenever an instance is explicitly updated.
The function type for a listener is equivalent to:

void(basic_registry<entity_type> &, entity_type);

Listeners are invoked after the object has been updated.

See also
sink
Returns
A temporary sink object.

◆ patch()

template<typename Type >
template<typename... Func>
decltype(auto) entt::sigh_storage_mixin< Type >::patch ( basic_registry< entity_type > &  owner,
const entity_type  entity,
[[maybe_unused] ] Func &&...  func 
)
inline

Patches the given instance for an entity.

Template Parameters
FuncTypes of the function objects to invoke.
Parameters
ownerThe registry that issued the request.
entityA valid entity identifier.
funcValid function objects.
Returns
A reference to the patched instance.

◆ remove() [1/2]

template<typename Type >
void entt::sigh_storage_mixin< Type >::remove ( basic_registry< entity_type > &  owner,
const entity_type  entity 
)
inline

Removes entities from a storage.

Parameters
ownerThe registry that issued the request.
entityA valid entity identifier.

◆ remove() [2/2]

template<typename Type >
template<typename It >
void entt::sigh_storage_mixin< Type >::remove ( basic_registry< entity_type > &  owner,
It  first,
It  last 
)
inline

Removes entities from a storage.

Template Parameters
ItType of input iterator.
Parameters
ownerThe registry that issued the request.
firstAn iterator to the first element of the range of entities.
lastAn iterator past the last element of the range of entities.

The documentation for this struct was generated from the following file: