You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// get the root type from the hierarchy which serves as reference/pointer to base class.
using Event = ni::type_hierarchy::from_base<EventBase>;
// derive custom types, the first template argument must always be the derived type
// itself. This is required due to the missing reflections in C++ and is used to
// assign a unique id to the new type.
struct MouseEvent : ni::sub_type<MouseEvent, Event> {
int x, y;
MouseEvent(int x_, int y_) : x{x_}, y{y_} {}
};
struct KeyEvent : ni::sub_type<KeyEvent, Event> {
// ...
};
// 2nd level event
struct MouseButtonDownEvent : ni::sub_type<MouseButtonDownEvent, MouseEvent> {
// ...
};
It does not specify how to declare the constructor for MouseButtonDownEvent, or how to initialize the int x,y, parent members or how to declare and initialize the child members.
From experimenting, using the standard inheritance approach of:
Uh oh!
There was an error while loading. Please reload this page.
README states:
It does not specify how to declare the constructor for MouseButtonDownEvent, or how to initialize the int x,y, parent members or how to declare and initialize the child members.
From experimenting, using the standard inheritance approach of:
does not compile. Instead I've had to do:
I'm not sure if this is intended method of initialization. More detail in the README would be very helpful.
The text was updated successfully, but these errors were encountered: