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

Basic signal class. More...

#include <Signal.hpp>

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

Public Types

using connection = my_connection
 

Public Member Functions

 SignalT (SignalT &&) noexcept=default
 
SignalToperator= (SignalT &&) noexcept=default
 
 SignalT ()=default
 
 ~SignalT () 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 ConnectionT< SignalT< 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::SignalT< Function >

Basic signal class.

Member Typedef Documentation

◆ connection

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

Constructor & Destructor Documentation

◆ SignalT() [1/2]

template<typename Function >
castor::SignalT< Function >::SignalT ( SignalT< Function > && )
defaultnoexcept

◆ SignalT() [2/2]

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

◆ ~SignalT()

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

Destructor.

Remarks
Disconnects all remaining connections.

References CU_Require.

Member Function Documentation

◆ connect()

template<typename Function >
my_connection castor::SignalT< 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.

◆ operator()() [1/2]

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

Emits the signal, calls every connected function.

◆ operator()() [2/2]

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

Emits the signal, calls every connected function.

Parameters
[in]paramsThe functions parameters.

◆ operator=()

template<typename Function >
SignalT & castor::SignalT< Function >::operator= ( SignalT< Function > && )
defaultnoexcept

Friends And Related Symbol Documentation

◆ ConnectionT< SignalT< Function > >

template<typename Function >
friend class ConnectionT< SignalT< Function > >
friend

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