Castor3D 0.16.0
Multiplatform 3D engine
Public Types | Public Member Functions | Friends | List of all members
castor::TSSignalT< Function > Class Template Reference

Thread safe signal class. More...

#include <ThreadSafeSignal.hpp>

Inheritance diagram for castor::TSSignalT< Function >:
Inheritance graph
[legend]
Collaboration diagram for castor::TSSignalT< Function >:
Collaboration graph
[legend]

Public Types

using connection = my_connection
 

Public Member Functions

 TSSignalT ()=default
 
 TSSignalT (TSSignalT &&rhs) noexcept
 
TSSignalToperator= (TSSignalT &&rhs) noexcept
 
 ~TSSignalT () noexcept
 Destructor.
 
my_connection connect (Function function)
 Connects a new function that will be called if the signal is emitted.
 
void operator() () const
 Emits the signal, calls every connected function.
 
template<typename ... Params>
void operator() (Params &&... params) const
 Emits the signal, calls every connected function.
 

Friends

class TSConnectionT< TSSignalT< Function > >
 

Additional Inherited Members

- Protected Member Functions inherited from castor::NonCopyable
 NonCopyable ()=default
 Constructor.
 
 ~NonCopyable () noexcept=default
 Destructor.
 

Detailed Description

template<typename Function>
class castor::TSSignalT< Function >

Thread safe signal class.

Member Typedef Documentation

◆ connection

template<typename Function >
using castor::TSSignalT< Function >::connection = my_connection

Constructor & Destructor Documentation

◆ TSSignalT() [1/2]

template<typename Function >
castor::TSSignalT< Function >::TSSignalT ( )
default

◆ TSSignalT() [2/2]

template<typename Function >
castor::TSSignalT< Function >::TSSignalT ( TSSignalT< Function > && rhs)
inlinenoexcept

References castor::makeUniqueLock().

Here is the call graph for this function:

◆ ~TSSignalT()

template<typename Function >
castor::TSSignalT< Function >::~TSSignalT ( )
inlinenoexcept

Destructor.

Remarks
Disconnects all remaining connections.

References CU_Require, and castor::makeUniqueLock().

Here is the call graph for this function:

Member Function Documentation

◆ connect()

template<typename Function >
my_connection castor::TSSignalT< Function >::connect ( Function function)
inline

Connects a new function that will be called if the signal is emitted.

Parameters
[in]functionThe function.
Returns
The function index, in order to be able to disconnect it.

References castor::makeUniqueLock().

Here is the call graph for this function:

◆ operator()() [1/2]

template<typename Function >
void castor::TSSignalT< Function >::operator() ( ) const
inline

Emits the signal, calls every connected function.

References castor::makeUniqueLock().

Here is the call graph for this function:

◆ operator()() [2/2]

template<typename Function >
template<typename ... Params>
void castor::TSSignalT< Function >::operator() ( Params &&... params) const
inline

Emits the signal, calls every connected function.

Parameters
[in]paramsThe functions parameters.

References castor::makeUniqueLock().

Here is the call graph for this function:

◆ operator=()

template<typename Function >
TSSignalT & castor::TSSignalT< Function >::operator= ( TSSignalT< Function > && rhs)
inlinenoexcept

References castor::makeUniqueLock().

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ TSConnectionT< TSSignalT< Function > >

template<typename Function >
friend class TSConnectionT< TSSignalT< Function > >
friend

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