Public Types |
typedef std::map< int, Handler *> | handler_map |
Public Methods |
| Looper (const std::string &cName, int nPriority=NORMAL_PRIORITY, int nPortSize=DEFAULT_PORT_SIZE) |
| The looper constructor. More...
|
virtual | ~Looper () |
| Looper destructor. More...
|
void | SetName (const std::string &cName) |
| Rename the looper. More...
|
std::string | GetName () const |
| Get the loopers name. More...
|
port_id | GetMsgPort () const |
| Obtain the low-level message port used by this looper. More...
|
thread_id | GetThread () const |
| Obtain the thread id of the looper thread. More...
|
proc_id | GetProcess () const |
| Obtain the process ID of the loopers thread. More...
|
status_t | Lock () |
| Lock the looper object. More...
|
status_t | Lock (bigtime_t nTimeout) |
| Lock the looper with a timeout. More...
|
status_t | SafeLock () |
| Attempt to lock the looper. More...
|
status_t | Unlock () |
| Unlock the looper. More...
|
void | SetMutex (Locker *pcMutex) |
| Set a custom mutex to be used by the looper. More...
|
Locker * | GetMutex () const |
| Get a pointer to the loopers mutex. More...
|
int | GetLockCount () const |
| Obtain the number of locks held on the looper. More...
|
thread_id | GetLockingThread () const |
| Obtaing the owner of the looper lock. More...
|
bool | IsLocked () const |
| Check if the looper lock is owned by the calling thread. More...
|
virtual thread_id | Run () |
| Start and unlock the looper. More...
|
int | Wait () const |
| Wait for the looper thread to die. More...
|
status_t | PostMessage (uint32 nCode) |
| Deliver a message to the looper. More...
|
status_t | PostMessage (Message *pcMsg) |
| Deliver a message to the looper. More...
|
status_t | PostMessage (uint32 cCode, Handler *pcHandler, Handler *pcReplyTo=NULL) |
| Deliver a message to the looper. More...
|
status_t | PostMessage (Message *pcMsg, Handler *pcHandler, Handler *pcReplyTo=NULL) |
| Deliver a message to the looper. More...
|
void | SpoolMessages () |
| Drain the low-level message port. More...
|
Message * | GetCurrentMessage () const |
| Obtaine the message currently being processed. More...
|
Message * | DetachCurrentMessage () |
| Steal the current message. More...
|
virtual void | DispatchMessage (Message *pcMessage, Handler *pcHandler) |
| The loopers message handling callback. More...
|
virtual void | Started () |
| Called by the looper thread before entering the message loop. More...
|
virtual bool | Idle () |
| Hook called each time the message queue is drained. More...
|
MessageQueue * | GetMessageQueue () const |
| Obtain the internal message queue used by the looper. More...
|
virtual bool | OkToQuit () |
| Check if it is ok to break the loop. More...
|
virtual void | Quit () |
| Unconditionally terminate the looper. More...
|
void | AddTimer (Handler *pcTarget, int nID, bigtime_t nTimeout, bool bOneShot=true) |
| Add a timer to the looper. More...
|
bool | RemoveTimer (Handler *pcTarget, int nID) |
| Delete a timer. More...
|
const handler_map & | GetHandlerMap () const |
| Get the internal handler list. More...
|
void | AddHandler (Handler *pcHandler) |
| Add a handler to the looper. More...
|
bool | RemoveHandler (Handler *pcHandler) |
| Remove a handler previously added by AddHandler(). More...
|
Handler * | FindHandler (const std::string &cName) const |
| Search the looper for a named handler. More...
|
int | GetHandlerCount () const |
| Obtain the count of handlers added to this looper. More...
|
void | SetDefaultHandler (Handler *pcHandler) |
| Set the default target for incomming messages. More...
|
Handler * | GetDefaultHandler () const |
| Obtain the default handler for the looper. More...
|
void | AddCommonFilter (MessageFilter *pcFilter) |
void | RemoveCommonFilter (MessageFilter *pcFilter) |
const MsgFilterList & | GetCommonFilterList () const |
Static Public Methods |
Looper * | GetLooperForThread (thread_id hThread) |
Friends |
class | Application |
class | Messenger |
class | NodeMonitor |
class | Window |