Sleeping Wombat GUI
0.100
swGUI
|
Base class for delegates containers. More...
#include <DelegateContainer.h>
Public Member Functions | |
DelegatesContainerBase (EventType eventID) | |
virtual | ~DelegatesContainerBase ()=default |
EventType | GetEventType () |
Call this function to check event type holded by derived class. More... | |
DelegatesContainerBase * | GetNextContainer () |
Gets next element on linked list. More... | |
void | AddContainer (DelegatesContainerBaseOPtr &&container) |
Adds container on the end of list. More... | |
void | RemoveNext () |
Removed element following this object. More... | |
DelegatesContainerBaseOPtr | StealRestOfList () |
Steal list following this. More... | |
virtual void | CallDelegates (UIElement *sender, IEventArgs *arguments)=0 |
Invokes delegates functions. More... | |
Private Attributes | |
DelegatesContainerBaseOPtr | m_next |
Intrusive list. More... | |
EventType | m_eventType |
Type of event used to distinguish between Delegates Containers. More... | |
Base class for delegates containers.
Purpose of this class is to provide interface for storing delegates of different types in one list. Derived classes are templates that can hold typed delegates. Note that each derived class can correspond to multiple events, because different event can be sent with the same structure that holds parameters.
Thats why there's m_eventType field. While looking for appropriate container EventManager will check this field to compare it with sent event type.
This class is designed to minimize memory footprint in Control classes. That's why I use intrusive list to store consecutive containers. Since there're only few delegates used at the same time, there's no sense to expose DelegatesContainer for each event.
This class owns next delegates container and is responsible for releasing memory.
|
inlineexplicit |
|
virtualdefault |
|
inline |
Adds container on the end of list.
|
pure virtual |
Invokes delegates functions.
Implemented in sw::gui::DelegatesContainer< EventArgType >.
|
inline |
Call this function to check event type holded by derived class.
|
inline |
Gets next element on linked list.
|
inline |
Removed element following this object.
|
inline |
Steal list following this.
|
private |
Type of event used to distinguish between Delegates Containers.
|
private |
Intrusive list.