Empirical
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
emp::Signal< void(ARGS...)> Class Template Reference

Signals with void return. More...

#include <Signal.h>

Inheritance diagram for emp::Signal< void(ARGS...)>:
emp::SignalBase

Public Types

using fun_t = void(ARGS...)
 
using this_t = Signal< fun_t >
 

Public Member Functions

 Signal (const std::string &name="", internal::SignalManager_Base *manager=nullptr)
 
 Signal (const std::string &name, internal::SignalControl_Base &control)
 
virtual this_tClone () const
 
size_t GetNumArgs () const
 
size_t GetNumActions () const
 
void Trigger (ARGS...args)
 Trigger this signal, providing all needed arguments. More...
 
SignalKey AddAction (const std::function< void(ARGS...)> &in_fun)
 Add an action that takes the proper arguments. More...
 
SignalKey AddAction (ActionBase &in_action)
 Add a specified action to this signal. More...
 
template<typename... FUN_ARGS, typename... EXTRA_ARGS>
SignalKey AddAction (const std::function< void(FUN_ARGS...)> &in_fun, TypePack< EXTRA_ARGS... >)
 Add an action that takes too few arguments... but provide specific padding info. More...
 
template<typename... FUN_ARGS>
SignalKey AddAction (const std::function< void(FUN_ARGS...)> &in_fun)
 
template<typename... FUN_ARGS>
SignalKey AddAction (void in_fun(FUN_ARGS...))
 
void Remove (SignalKey key)
 Remove an action from this signal by providing its key. More...
 
size_t GetPriority (SignalKey key)
 Retrieve the relative priority associated with a specific. More...
 
const std::string & GetName () const
 
template<typename... ARGS>
void BaseTrigger (ARGS...args)
 
void Clear ()
 Remove all actions from this signal. More...
 
bool Has (SignalKey key) const
 

Protected Types

using man_t = internal::SignalManager_Base
 

Protected Member Functions

SignalKey NextSignalKey ()
 

Protected Attributes

FunctionSet< void(ARGS...)> actions
 Set of functions (actions) to be triggered with this signal. More...
 
std::string name
 What is the unique name of this signal? More...
 
uint32_t signal_id
 What is the unique ID of this signal? More...
 
uint32_t next_link_id
 What ID shouild the next link have? More...
 
std::map< SignalKey, size_t > link_key_map
 Map unique link keys to link index for actions. More...
 
emp::vector< man_t * > managers
 What manager is handling this signal? More...
 
man_tprime_manager
 Which manager leads deletion? (nullptr for self) More...
 

Detailed Description

template<typename... ARGS>
class emp::Signal< void(ARGS...)>

Signals with void return.

Member Typedef Documentation

template<typename... ARGS>
using emp::Signal< void(ARGS...)>::fun_t = void(ARGS...)
template<typename... ARGS>
using emp::Signal< void(ARGS...)>::this_t = Signal<fun_t>

Constructor & Destructor Documentation

template<typename... ARGS>
emp::Signal< void(ARGS...)>::Signal ( const std::string &  name = "",
internal::SignalManager_Base manager = nullptr 
)
inline
template<typename... ARGS>
emp::Signal< void(ARGS...)>::Signal ( const std::string &  name,
internal::SignalControl_Base control 
)
inline

Member Function Documentation

template<typename... ARGS>
SignalKey emp::Signal< void(ARGS...)>::AddAction ( const std::function< void(ARGS...)> &  in_fun)
inline

Add an action that takes the proper arguments.

template<typename... ARGS>
SignalKey emp::Signal< void(ARGS...)>::AddAction ( ActionBase in_action)
inlinevirtual

Add a specified action to this signal.

Implements emp::SignalBase.

template<typename... ARGS>
template<typename... FUN_ARGS, typename... EXTRA_ARGS>
SignalKey emp::Signal< void(ARGS...)>::AddAction ( const std::function< void(FUN_ARGS...)> &  in_fun,
TypePack< EXTRA_ARGS... >   
)
inline

Add an action that takes too few arguments... but provide specific padding info.

template<typename... ARGS>
template<typename... FUN_ARGS>
SignalKey emp::Signal< void(ARGS...)>::AddAction ( const std::function< void(FUN_ARGS...)> &  in_fun)
inline

Add an std::function that takes the wrong number of arguments. For now, we will assume that there are too few and we need to figure out how to pad it out.

template<typename... ARGS>
template<typename... FUN_ARGS>
SignalKey emp::Signal< void(ARGS...)>::AddAction ( void   in_funFUN_ARGS...)
inline

Add a regular function that takes the wrong number of arguments. For now, we will assume that there are too few and we need to figure out how to pad it out.

template<typename... ARGS>
void emp::SignalBase::BaseTrigger ( ARGS...  args)
inlineinherited
void emp::SignalBase::Clear ( )
inlineinherited

Remove all actions from this signal.

template<typename... ARGS>
virtual this_t* emp::Signal< void(ARGS...)>::Clone ( ) const
inlinevirtual

Implements emp::SignalBase.

const std::string& emp::SignalBase::GetName ( ) const
inlineinherited
template<typename... ARGS>
size_t emp::Signal< void(ARGS...)>::GetNumActions ( ) const
inlinevirtual

Implements emp::SignalBase.

template<typename... ARGS>
size_t emp::Signal< void(ARGS...)>::GetNumArgs ( ) const
inlinevirtual

Implements emp::SignalBase.

template<typename... ARGS>
size_t emp::Signal< void(ARGS...)>::GetPriority ( SignalKey  key)
inline

Retrieve the relative priority associated with a specific.

bool emp::SignalBase::Has ( SignalKey  key) const
inlineinherited
SignalKey emp::SignalBase::NextSignalKey ( )
inlineprotectedinherited
template<typename... ARGS>
void emp::Signal< void(ARGS...)>::Remove ( SignalKey  key)
inlinevirtual

Remove an action from this signal by providing its key.

Implements emp::SignalBase.

template<typename... ARGS>
void emp::Signal< void(ARGS...)>::Trigger ( ARGS...  args)
inline

Trigger this signal, providing all needed arguments.

Member Data Documentation

template<typename... ARGS>
FunctionSet<void(ARGS...)> emp::Signal< void(ARGS...)>::actions
protected

Set of functions (actions) to be triggered with this signal.

std::map<SignalKey, size_t> emp::SignalBase::link_key_map
protectedinherited

Map unique link keys to link index for actions.

emp::vector<man_t *> emp::SignalBase::managers
protectedinherited

What manager is handling this signal?

std::string emp::SignalBase::name
protectedinherited

What is the unique name of this signal?

uint32_t emp::SignalBase::next_link_id
protectedinherited

What ID shouild the next link have?

man_t* emp::SignalBase::prime_manager
protectedinherited

Which manager leads deletion? (nullptr for self)

uint32_t emp::SignalBase::signal_id
protectedinherited

What is the unique ID of this signal?


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