Class EventData::Class
Defined in File event-data.h
Nested Relationships
This class is a nested type of Class EventData.
Inheritance Relationships
Derived Type
public gpa::runtime::EventData::ClassDef< T >
(Template Class EventData::ClassDef)
Class Documentation
-
class Class
Base reflection metaclass type. Provides access to event class name, and means to create new instances of the described event type. The class definition metadata can be accessed from any EventData instance via GetClassDef() method, or via static GetClass() method on EventData class.
Subclassed by gpa::runtime::EventData::ClassDef< T >
Public Functions
-
Class(utility::UUID const &eventId, char const *eventName)
-
virtual ~Class()
-
utility::UUID const &ID() const
Globally-unique identifier for this metaclass.
- Returns
Const reference to the UUID for this metaclass.
-
char const *Name() const
Name of the class described by this metaclass.
- Returns
Pointer to UTF-8 class name.
-
virtual EventData *Create() const = 0
Create an instance of the class described by this metaclass. This method is pure virtual and requires a derived class implementation (see ClassDef).
- Returns
Naked pointer to a live instance of the class described by this metaclass. Caller owns the instance upon return (no reference counting or garbage collection is involved).
Public Members
-
Class *mNext = {nullptr}
Public Static Functions
-
static Class const *Find(utility::UUID const &eventId)
Find the event metaclass corresponding to the provided event ID (see ID()).
Note
Since the metaclass registration system depends on static initialization, DCE (dead-code elimination) may cause the metaclass definition to be discarded, and therefore not available to this method. You may need to employ anti-DCE methods to prevent this occurrence if you are looking for a metaclass you know exists, but is not found by this method.
- Parameters
eventId -- Globally-unique ID of the desired event metaclass.
- Returns
Pointer to the desired event metaclass if found, nullptr if not.
-
static Class const *Classes()
Obtain a pointer to a linked list of registered classes. This list is null-terminated (meaning, the last element in the list has an mNext value of "nullptr").
- Returns
Pointer to the head of the metaclass linked list. If no metaclasses are registered, this will return nullptr.
-
Class(utility::UUID const &eventId, char const *eventName)