|
| static void | addHandler (UEventsHandler *handler) |
| |
| static void | removeHandler (UEventsHandler *handler) |
| |
| static void | post (UEvent *event, bool async=true, const UEventsSender *sender=0) |
| |
|
static void | createPipe (const UEventsSender *sender, const UEventsHandler *receiver, const std::string &eventName) |
| |
|
static void | removePipe (const UEventsSender *sender, const UEventsHandler *receiver, const std::string &eventName) |
| |
|
static void | removeAllPipes (const UEventsSender *sender) |
| |
|
static void | removeNullPipes (const UEventsSender *sender) |
| |
| static unsigned long | currentThreadId () |
| |
| static int | Create (const Handler &Function, Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) |
| |
| static int | Join (Handle H) |
| |
| static int | Kill (Handle H) |
| |
| static int | Detach (Handle H) |
| |
| static int | Create (const Handler &Function, Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) |
| |
| static int | Join (const Handle &H) |
| |
| static int | Kill (const Handle &H) |
| |
| static int | Detach (const Handle &H) |
| |
|
| enum | Priority {
kPLow
, kPBelowNormal
, kPNormal
, kPAboveNormal
,
kPRealTime
} |
| |
| typedef THREAD_HANDLE | Handle |
| |
| typedef void(* | Handler) () |
| |
| typedef THREAD_HANDLE | Handle |
| |
| typedef void(* | Handler) () |
| |
| | UThread (Priority priority=kPNormal) |
| |
| virtual | ~UThread () |
| |
| void | start () |
| |
| void | kill () |
| |
| void | join (bool killFirst=false) |
| |
| void | setPriority (Priority priority) |
| |
| void | setAffinity (int cpu=0) |
| |
| bool | isCreating () const |
| |
| bool | isRunning () const |
| |
| bool | isIdle () const |
| |
| bool | isKilled () const |
| |
| Handle | getThreadHandle () const |
| |
| unsigned long | getThreadId () const |
| |
| int | Create (Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) const |
| |
| int | Create (unsigned long &ThreadId, Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) const |
| |
| int | Create (Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) const |
| |
| int | Create (unsigned long &ThreadId, Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) const |
| |
This class is used to post events between threads in the application. It is Thread-Safe and the events are sent to receivers in the same order they are posted (FIFO). It works like the design pattern Mediator. It is also a Singleton, so it can be used anywhere in the application.
To send an event, use UEventsManager::post(). Events are automatically deleted after they are posted.
The EventsManager have a list of handlers to which it sends posted events. To add an handler, use UEventsManager::addHandler(). To remove, use UEventsManager::removeHandler().
static void post(UEvent *event, bool async=true, const UEventsSender *sender=0)
- See also
- UEvent
-
UEventsHandler
-
post()
-
addHandler()
-
removeHandler()
Definition at line 78 of file UEventsManager.h.