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

Event class callif. More...

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

Public Member Functions

 CallIfEventClass (const Event::Class &oClass) noexcept
 Constructor. More...
 
 CallIfEventClass (const std::type_info &oEventType) noexcept
 Type id constructor. More...
 
 CallIfEventClass (const std::string &sEventClassId) noexcept
 String id Constructor. More...
 
bool operator() (const shared_ptr< const Event > &refEvent) const noexcept override
 Function that determines whether an event should be sent to a listener. More...
 
const Event::ClassgetClass () const noexcept
 The registered event class to be selected. 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

Event class callif.

Selects events that are (sub)classes of a given registered event class.

Constructor & Destructor Documentation

◆ CallIfEventClass() [1/3]

stmi::CallIfEventClass::CallIfEventClass ( const Event::Class oClass)
explicitnoexcept

Constructor.

Parameters
oClassThe event class. Must be registered.

◆ CallIfEventClass() [2/3]

stmi::CallIfEventClass::CallIfEventClass ( const std::type_info &  oEventType)
explicitnoexcept

Type id constructor.

Parameters
oEventTypeThe event class by typeid. Must be registered.

◆ CallIfEventClass() [3/3]

stmi::CallIfEventClass::CallIfEventClass ( const std::string &  sEventClassId)
explicitnoexcept

String id Constructor.

Parameters
sEventClassIdThe registered event class string id. Cannot be null.

Member Function Documentation

◆ getClass()

const Event::Class& stmi::CallIfEventClass::getClass ( ) const
inlinenoexcept

The registered event class to be selected.

◆ operator()()

bool stmi::CallIfEventClass::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.