|
| | sink () noexcept |
| | Constructs an invalid sink.
|
| | sink (sigh< Ret(Args...), Allocator > &ref) noexcept |
| | Constructs a sink that is allowed to modify a given signal.
|
| bool | empty () const noexcept |
| | Returns false if at least a listener is connected to the sink.
|
| template<auto Candidate> |
| connection | connect () |
| | Connects a free function or an unbound member to a signal.
|
| template<auto Candidate, typename Type> |
| connection | connect (Type &value_or_instance) |
| | Connects a free function with payload or a bound member to a signal.
|
| template<auto Candidate, typename Type> |
| connection | connect (Type *value_or_instance) |
| | Connects a free function with payload or a bound member to a signal.
|
| template<auto Candidate> |
| void | disconnect () |
| | Disconnects a free function or an unbound member from a signal.
|
| template<auto Candidate, typename Type> |
| void | disconnect (Type &value_or_instance) |
| | Disconnects a free function with payload or a bound member from a signal.
|
| template<auto Candidate, typename Type> |
| void | disconnect (Type *value_or_instance) |
| | Disconnects a free function with payload or a bound member from a signal.
|
| void | disconnect (const void *value_or_instance) |
| | Disconnects free functions with payload or bound members from a signal.
|
| void | disconnect () |
| | Disconnects all the listeners from a signal.
|
| | operator bool () const noexcept |
| | Returns true if a sink is correctly initialized, false otherwise.
|
template<typename Ret, typename... Args, typename Allocator>
class entt::sink< sigh< Ret(Args...), Allocator > >
Sink class.
A sink is used to connect listeners to signals and to disconnect them.
The function type for a listener is the one of the signal to which it belongs.
The clear separation between a signal and a sink permits to store the former as private data member without exposing the publish functionality to the users of the class.
- Warning
- Lifetime of a sink must not overcome that of the signal to which it refers. In any other case, attempting to use a sink results in undefined behavior.
- Template Parameters
-
| Ret | Return type of a function type. |
| Args | Types of arguments of a function type. |
| Allocator | Type of allocator used to manage memory and elements. |
Definition at line 360 of file sigh.hpp.
template<typename Ret, typename... Args, typename Allocator>
template<auto Candidate, typename Type>
Connects a free function with payload or a bound member to a signal.
The signal isn't responsible for the connected object or the payload. Users must always guarantee that the lifetime of the instance overcomes the one of the signal.
When used to connect a free function with payload, its signature must be such that the instance is the first argument before the ones used to define the signal itself.
- Template Parameters
-
| Candidate | Function or member to connect to the signal. |
| Type | Type of class or type of payload. |
- Parameters
-
| value_or_instance | A valid reference that fits the purpose. |
- Returns
- A properly initialized connection object.
Definition at line 447 of file sigh.hpp.
template<typename Ret, typename... Args, typename Allocator>
template<auto Candidate, typename Type>
Connects a free function with payload or a bound member to a signal.
- See also
- connect(Type &)
- Template Parameters
-
| Candidate | Function or member to connect to the signal. |
| Type | Type of class or type of payload. |
- Parameters
-
| value_or_instance | A valid pointer that fits the purpose. |
- Returns
- A properly initialized connection object.
Definition at line 471 of file sigh.hpp.
template<typename Ret, typename... Args, typename Allocator>
template<auto Candidate, typename Type>
| void entt::sink< sigh< Ret(Args...), Allocator > >::disconnect |
( |
Type & | value_or_instance | ) |
|
|
inline |
Disconnects a free function with payload or a bound member from a signal.
The signal isn't responsible for the connected object or the payload. Users must always guarantee that the lifetime of the instance overcomes the one of the signal.
When used to connect a free function with payload, its signature must be such that the instance is the first argument before the ones used to define the signal itself.
- Template Parameters
-
| Candidate | Function or member to disconnect from the signal. |
| Type | Type of class or type of payload, if any. |
- Parameters
-
| value_or_instance | A valid reference that fits the purpose. |
Definition at line 510 of file sigh.hpp.
template<typename Ret, typename... Args, typename Allocator>
template<auto Candidate, typename Type>
| void entt::sink< sigh< Ret(Args...), Allocator > >::disconnect |
( |
Type * | value_or_instance | ) |
|
|
inline |
Disconnects a free function with payload or a bound member from a signal.
- See also
- disconnect(Type &)
- Template Parameters
-
| Candidate | Function or member to disconnect from the signal. |
| Type | Type of class or type of payload, if any. |
- Parameters
-
| value_or_instance | A valid pointer that fits the purpose. |
Definition at line 527 of file sigh.hpp.