BLooper Class Reference

#include <Looper.h>

Inheritance diagram for BLooper:

BHandler BArchivable BApplication BGameSupport BMailChainRunner BMediaRoster BWindow DocApplication BAlert BDirectWindow DocWindow BSimpleWindow PrintPanelWindow BWindowScreen BDirectGLWindow List of all members.

Detailed Description

A BLooper object creates a "message loop" that receives messages that are sent or posted to the BLooper. The message loop runs in a separate thread that's spawned (and told to run) when the BLooper receives a Run() call. If you're creating your own BLooper, you can invoke Run() from within the constructor.

See also:
Using BLooper

Hook Functions



Public Member Functions

 BLooper (const char *name=NULL, int32 priority=B_NORMAL_PRIORITY, int32 port_capacity=B_LOOPER_PORT_DEFAULT_CAPACITY)
virtual ~BLooper ()
 BLooper (BMessage *data)
virtual status_t Archive (BMessage *data, bool deep=true) const
virtual void DispatchMessage (BMessage *message, BHandler *handler)
virtual void MessageReceived (BMessage *msg)
BMessageCurrentMessage () const
BMessageDetachCurrentMessage ()
BMessageQueueMessageQueue () const
bool IsMessageWaiting () const
void AddHandler (BHandler *handler)
bool RemoveHandler (BHandler *handler)
int32 CountHandlers () const
BHandlerHandlerAt (int32 index) const
int32 IndexOf (BHandler *handler) const
BHandlerPreferredHandler () const
void SetPreferredHandler (BHandler *handler)
thread_id RunInCurrentThread ()
virtual thread_id Run ()
virtual void Quit ()
virtual bool QuitRequested ()
bool Lock ()
lock_status_t LockWithStatus ()
void Unlock ()
bool IsLocked () const
lock_status_t LockWithTimeout (bigtime_t timeout, uint32 debug_flags=0)
thread_id Thread () const
team_id Team () const
bool IsRunningInCurrentThread ()
thread_id LockingThread () const
int32 CountLocks () const
int32 CountLockRequests () const
sem_id Sem () const
virtual BHandlerResolveSpecifier (BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property)
virtual status_t GetSupportedSuites (BMessage *data)
virtual void AddCommonFilter (BMessageFilter *filter)
virtual bool RemoveCommonFilter (BMessageFilter *filter)
virtual void SetCommonFilterList (BList *filters)
BListCommonFilterList () const
status_t PostMessage (uint32 command)
status_t PostMessage (BMessage *message)
status_t PostMessage (uint32 command, BHandler *handler, BHandler *reply_to=NULL)
status_t PostMessage (BMessage *message, BHandler *handler, BHandler *reply_to=NULL)
virtual status_t Perform (perform_code d, void *arg)

Static Public Member Functions

static BArchivableInstantiate (BMessage *data)
static BLooperLooperForThread (thread_id tid)

Protected Member Functions

virtual status_t ReadyToLoop (loop_state *outState)
BMessageMessageFromPort (bigtime_t=B_INFINITE_TIMEOUT)

Friends

class BWindow
class BApplication
class BMessenger
class BView
class BHandler
struct _looper_list_nuker_
port_id _get_looper_port_ (const BLooper *)
status_t _safe_get_server_token_ (const BLooper *, int32 *)
team_id _find_cur_team_id_ ()
status_t _call_ready_to_loop_ (BLooper *, loop_state *)

Classes

struct  loop_state


Constructor & Destructor Documentation

BLooper const char *  name = NULL,
int32  priority = B_NORMAL_PRIORITY,
int32  port_capacity = B_LOOPER_PORT_DEFAULT_CAPACITY
 

~BLooper  )  [virtual]
 

BLooper BMessage data  ) 
 


Member Function Documentation

void AddCommonFilter BMessageFilter filter  )  [virtual]
 

void AddHandler BHandler handler  ) 
 

status_t Archive BMessage data,
bool  deep = true
const [virtual]
 

Reimplemented from BHandler.

Reimplemented in BApplication, BDirectWindow, BAlert, and BWindow.

BList * CommonFilterList  )  const
 

int32 CountHandlers  )  const
 

int32 CountLockRequests  )  const
 

int32 CountLocks  )  const
 

BMessage * CurrentMessage  )  const
 

BMessage * DetachCurrentMessage  ) 
 

void DispatchMessage BMessage message,
BHandler handler
[virtual]
 

Reimplemented in BApplication, BDirectWindow, BAlert, BWindow, and BDirectGLWindow.

virtual status_t GetSupportedSuites BMessage data  )  [virtual]
 

Reimplemented from BHandler.

Reimplemented in BApplication, BDirectWindow, BAlert, BWindow, BMediaRoster, and BDirectGLWindow.

BHandler * HandlerAt int32  index  )  const
 

int32 IndexOf BHandler handler  )  const
 

BArchivable * Instantiate BMessage data  )  [static]
 

Reimplemented from BHandler.

Reimplemented in BApplication, BDirectWindow, BAlert, and BWindow.

bool IsLocked  )  const
 

bool IsMessageWaiting  )  const
 

bool IsRunningInCurrentThread  ) 
 

bool Lock  ) 
 

thread_id LockingThread  )  const
 

lock_status_t LockWithStatus  ) 
 

lock_status_t LockWithTimeout bigtime_t  timeout,
uint32  debug_flags = 0
 

BLooper * LooperForThread thread_id  tid  )  [static]
 

BMessage * MessageFromPort bigtime_t  = B_INFINITE_TIMEOUT  )  [protected]
 

BMessageQueue * MessageQueue  )  const
 

void MessageReceived BMessage msg  )  [virtual]
 

Reimplemented from BHandler.

Reimplemented in BMailChainRunner, BApplication, DocApplication, DocWindow, BDirectWindow, BAlert, BWindow, BMediaRoster, BDirectGLWindow, PrintPanelWindow, and BSimpleWindow.

status_t Perform perform_code  d,
void *  arg
[virtual]
 

Reimplemented from BHandler.

Reimplemented in BApplication, BDirectWindow, BWindowScreen, BAlert, BWindow, and BDirectGLWindow.

status_t PostMessage BMessage message,
BHandler handler,
BHandler reply_to = NULL
 

status_t PostMessage uint32  command,
BHandler handler,
BHandler reply_to = NULL
 

status_t PostMessage BMessage message  ) 
 

status_t PostMessage uint32  command  ) 
 

BHandler * PreferredHandler  )  const
 

void Quit  )  [virtual]
 

Reimplemented in BApplication, BDirectWindow, BWindowScreen, BAlert, BWindow, and BDirectGLWindow.

bool QuitRequested  )  [virtual]
 

Reimplemented in BMailChainRunner, BApplication, DocApplication, DocWindow, BAlert, BWindow, BMediaRoster, PrintPanelWindow, and BSimpleWindow.

status_t ReadyToLoop loop_state outState  )  [protected, virtual]
 

bool RemoveCommonFilter BMessageFilter filter  )  [virtual]
 

bool RemoveHandler BHandler handler  ) 
 

virtual BHandler* ResolveSpecifier BMessage msg,
int32  index,
BMessage specifier,
int32  form,
const char *  property
[virtual]
 

Reimplemented from BHandler.

Reimplemented in BApplication, BDirectWindow, BAlert, BWindow, BMediaRoster, and BDirectGLWindow.

thread_id Run  )  [virtual]
 

Reimplemented in BApplication, and BWindow.

thread_id RunInCurrentThread  ) 
 

sem_id Sem  )  const
 

void SetCommonFilterList BList filters  )  [virtual]
 

void SetPreferredHandler BHandler handler  ) 
 

thread_id Team  )  const
 

thread_id Thread  )  const
 

void Unlock  ) 
 


Friends And Related Function Documentation

status_t _call_ready_to_loop_ BLooper This,
BLooper::loop_state outState
[friend]
 

team_id _find_cur_team_id_  )  [friend]
 

port_id _get_looper_port_ const BLooper loop  )  [friend]
 

friend struct _looper_list_nuker_ [friend]
 

status_t _safe_get_server_token_ const BLooper l,
int32 *  token
[friend]
 

Reimplemented in BWindow.

friend class BApplication [friend]
 

Reimplemented in BWindow.

friend class BHandler [friend]
 

friend class BMessenger [friend]
 

friend class BView [friend]
 

Reimplemented in BApplication, and BWindow.

friend class BWindow [friend]
 

Reimplemented in BApplication.


Copyright 2005 by yellowTAB GmbH, Be Inc., Palm Source Inc. and their respective legal successors
All rights reserved.