UtiLite  0.3.1
A lite utilities library
Public Member Functions | Protected Member Functions | Private Attributes
UEvent Class Reference

#include <UEvent.h>

Inherited by UAudioEvent, UImageEvent, ULogEvent, and UObjDeletedEvent.

List of all members.

Public Member Functions

virtual std::string getClassName () const =0
int getCode () const

Protected Member Functions

 UEvent (int code=0)

Private Attributes

int code_

Detailed Description

This is the base class for all events used with the UEventsManager. Inherited classes must redefined the virtual method getClassName() to return their class name.

Example:

  class MyEvent : public UEvent
  {
  public:
     MyEvent() {}
     virtual ~MyEvent() {}
     std::string getClassName() const {return "MyEvent";}
  };

  int main(int argc, char * argv[])
  {
        ...
        UEventsManager::post(new MyEvent()); // UEventsManager take ownership of the event (deleted by UEventsManager).
        ...
  }
See also:
UEventsManager
UEventsHandler
getClassName()

Constructor & Destructor Documentation

UEvent::UEvent ( int  code = 0) [inline, protected]
Parameters:
codethe event code. TODO : Remove the code, not required for most of all implemented events

Member Function Documentation

virtual std::string UEvent::getClassName ( ) const [pure virtual]

This method is used to get the class name of the event. For example, if a class MouseEvent inherits from UEvent, it must return the "MouseEvent" string.

Returns:
the class name

Implemented in ULogEvent, UImageEvent, UAudioEvent, and UObjDeletedEvent.

int UEvent::getCode ( ) const [inline]

Get event's code.

Returns:
the code

Member Data Documentation

int UEvent::code_ [private]

The event's code.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations Friends Defines