stmm-games-doc  0.32.0
Public Types | Public Member Functions | List of all members
stmi::CallIfFuction Class Referencefinal

Function callif. More...

Inheritance diagram for stmi::CallIfFuction:
Inheritance graph
[legend]

Public Types

using CallIfFunction = std::function< bool(const shared_ptr< const Event > &)>
 

Public Member Functions

 CallIfFuction (CallIfFunction &&oCallIfFunction) noexcept
 
 CallIfFuction (const CallIfFunction &oCallIfFunction) noexcept
 
bool operator() (const shared_ptr< const Event > &refEvent) const noexcept override
 Function that determines whether an event should be sent to a listener. More...
 
- Public Member Functions inherited from stmi::CallIf
virtual ~CallIf () noexcept=default
 

Additional Inherited Members

- Protected Member Functions inherited from stmi::CallIf
 CallIf () noexcept
 

Detailed Description

Function callif.

Selects an event according to the return value of a custom function.

Beware! The function should not cause reference cycles that can lead to memory leaks.

The function should not throw exceptions (be noexcept).

Member Typedef Documentation

◆ CallIfFunction

using stmi::CallIfFuction::CallIfFunction = std::function<bool(const shared_ptr<const Event>&)>

Constructor & Destructor Documentation

◆ CallIfFuction() [1/2]

stmi::CallIfFuction::CallIfFuction ( CallIfFunction &&  oCallIfFunction)
explicitnoexcept

◆ CallIfFuction() [2/2]

stmi::CallIfFuction::CallIfFuction ( const CallIfFunction oCallIfFunction)
explicitnoexcept

Member Function Documentation

◆ operator()()

bool stmi::CallIfFuction::operator() ( const shared_ptr< const Event > &  refEvent) const
inlineoverridevirtualnoexcept

Function that determines whether an event should be sent to a listener.

Parameters
refEventThe event. Cannot be null.
Returns
true if the event is to be sent to the listener, false otherwise.

Implements stmi::CallIf.