Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::TListener< Args >::emitter_type Class Reference

Emitter class type for creating an instance which is emitting events to listeners. More...

#include <TListener.h>

Public Member Functions

 emitter_type ()=default
 
 ~emitter_type ()
 Destructor clearing all shared pointers.
 
TListenerlink (ListenerList *list, const func_type &function) const
 Assigns a listener instance to this handler instance and also to the passed listener list.
 
template<typename T >
TListenerlink (ListenerList *list, T *obj, void(T::*method)(Args... args)) const
 Assigns a listener instance to this handler instance and also to the passed listener list.
 
void call (Args... args)
 Calls the linked listeners and also cleans up when pointer expired.
 
size_t cleanup ()
 Removes expired listeners.
 
void flush ()
 Removes all listeners.
 

Detailed Description

template<typename... Args>
class sf::TListener< Args >::emitter_type

Emitter class type for creating an instance which is emitting events to listeners.

Constructor & Destructor Documentation

◆ emitter_type()

template<typename... Args>
sf::TListener< Args >::emitter_type::emitter_type ( )
default

Default constructor.

◆ ~emitter_type()

template<typename... Args>
sf::TListener< Args >::emitter_type::~emitter_type ( )

Destructor clearing all shared pointers.

Member Function Documentation

◆ call()

template<typename... Args>
void sf::TListener< Args >::emitter_type::call ( Args...  args)

Calls the linked listeners and also cleans up when pointer expired.

Parameters
argsArguments set using this template.

◆ cleanup()

template<typename... Args>
size_t sf::TListener< Args >::emitter_type::cleanup ( )

Removes expired listeners.

Returns
Amount of removed entries.

◆ flush()

template<typename... Args>
void sf::TListener< Args >::emitter_type::flush ( )

Removes all listeners.

◆ link() [1/2]

template<typename... Args>
TListener * sf::TListener< Args >::emitter_type::link ( ListenerList list,
const func_type function 
) const

Assigns a listener instance to this handler instance and also to the passed listener list.

Returns
Pointer to created TListener which can be deleted to unlink.

◆ link() [2/2]

template<typename... Args>
template<typename T >
TListener * sf::TListener< Args >::emitter_type::link ( ListenerList list,
T *  obj,
void(T::*)(Args... args)  method 
) const

Assigns a listener instance to this handler instance and also to the passed listener list.

Returns
Pointer to created TListener which can be deleted to unlink.

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