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

The representation of a registered event class. More...

Public Member Functions

 Class () noexcept
 Constructs an empty event class instance. More...
 
 Class (const std::type_info &oEventType) noexcept
 Constructs an event class instance. More...
 
bool operator== (const std::type_info &oOtherEventType) const noexcept
 Compares a registered event class instance with a c++ typeid. More...
 
bool operator!= (const std::type_info &oOtherEventType) const noexcept
 
bool operator== (const Class &oOther) const noexcept
 Compares a registered event class to another. More...
 
bool operator!= (const Class &oOther) const noexcept
 
 operator bool () const noexcept
 Tells whether class is registered. More...
 
const std::type_info & getTypeInfo () const noexcept
 The underlying c++ typeid of the class. More...
 
std::string getId () const noexcept
 The class id. More...
 
bool isXYEvent () const noexcept
 Tells whether you can statically cast an instance of this Class to XYEvent. More...
 

Detailed Description

The representation of a registered event class.

Constructor & Destructor Documentation

◆ Class() [1/2]

stmi::Event::Class::Class ( )
inlinenoexcept

Constructs an empty event class instance.

◆ Class() [2/2]

stmi::Event::Class::Class ( const std::type_info &  oEventType)
inlineexplicitnoexcept

Constructs an event class instance.

If the passed c++ typeid is not of a registered class an empty class is constructed.

Parameters
oEventTypeunderlying c++ typeid of the class.

Member Function Documentation

◆ getId()

std::string stmi::Event::Class::getId ( ) const
inlinenoexcept

The class id.

If the class is empty returns empty string.

Returns
The class id.

◆ getTypeInfo()

const std::type_info& stmi::Event::Class::getTypeInfo ( ) const
inlinenoexcept

The underlying c++ typeid of the class.

Returns
The c++ type or if class is empty an invalid value.
See also
operator bool() const

◆ isXYEvent()

bool stmi::Event::Class::isXYEvent ( ) const
inlinenoexcept

Tells whether you can statically cast an instance of this Class to XYEvent.

See also
class XYEvent
Returns
Whether this registered class is subclass of XYEvent.

◆ operator bool()

stmi::Event::Class::operator bool ( ) const
inlinenoexcept

Tells whether class is registered.

Returns
Whether class is not empty.

◆ operator!=() [1/2]

bool stmi::Event::Class::operator!= ( const std::type_info &  oOtherEventType) const
inlinenoexcept
See also
operator==(const std::type_info&)

◆ operator!=() [2/2]

bool stmi::Event::Class::operator!= ( const Class oOther) const
inlinenoexcept
See also
operator==(const Class&)

◆ operator==() [1/2]

bool stmi::Event::Class::operator== ( const std::type_info &  oOtherEventType) const
inlinenoexcept

Compares a registered event class instance with a c++ typeid.

If the class instance is empty false is returned.

Parameters
oOtherEventTypeThe c++ typeid.
Returns
The result of the comparison.

◆ operator==() [2/2]

bool stmi::Event::Class::operator== ( const Class oOther) const
inlinenoexcept

Compares a registered event class to another.

If both are empty true is returned.

Parameters
oOtherThe other class instance. Might be empty.
Returns
The result of the comparison.