Gaia-ECS v0.9.3
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::util::signal< Ret(Args...)> Class Template Reference

Signal is a container of listener which it can notify. It works directly with references to classes and pointers to both free and member functions. More...

#include <signal.h>

Public Types

using size_type = typename detail::container< Ret, Args... >::size_type
 
using sink_type = sink< Ret(Args...)>
 

Public Member Functions

GAIA_NODISCARD size_type size () const noexcept
 Number of listeners connected to the signal.
 
GAIA_NODISCARD bool empty () const noexcept
 Check is there is any listener bound to the signal.
 
void emit (Args... args)
 Signals all listeners.
 

Friends

class sink< Ret(Args...)>
 

Detailed Description

template<typename Ret, typename... Args>
class gaia::util::signal< Ret(Args...)>

Signal is a container of listener which it can notify. It works directly with references to classes and pointers to both free and member functions.

Template Parameters
RetReturn type of a function type.
ArgsTypes of arguments of a function type.

Member Function Documentation

◆ emit()

template<typename Ret , typename... Args>
void gaia::util::signal< Ret(Args...)>::emit ( Args...  args)
inline

Signals all listeners.

Parameters
argsArguments to use to trigger listeners.

◆ empty()

template<typename Ret , typename... Args>
GAIA_NODISCARD bool gaia::util::signal< Ret(Args...)>::empty ( ) const
inlinenoexcept

Check is there is any listener bound to the signal.

Returns
True if there is any listener bound to the signal, false otherwise.

◆ size()

template<typename Ret , typename... Args>
GAIA_NODISCARD size_type gaia::util::signal< Ret(Args...)>::size ( ) const
inlinenoexcept

Number of listeners connected to the signal.

Returns
Number of listeners currently connected.

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