Pyro higlevel API
|
Public Types | |
enum | { M_CHANGE_DIR = 1, M_COPY_FILES, M_MOVE_FILES, M_DELETE_FILES, M_RENAME_FILES, M_ENTRIES_ADDED, M_ENTRIES_REMOVED, M_ENTRIES_UPDATED, M_LAYOUT_UPDATED } |
Public Types inherited from os::Looper | |
typedef std::map< int, Handler * > | handler_map |
Public Member Functions | |
DirKeeper (const Messenger &cTarget, const String &cPath) | |
virtual void | HandleMessage (Message *pcMessage) |
Handle a message targeted at this handler. More... | |
virtual bool | Idle () |
Hook called each time the message queue is drained. More... | |
void | Stop () |
status_t | GetNode (os::String zPath, os::FSNode *pcNode, bool *pbBrokenLink) |
Directory * | GetCurrentDir () |
bool | IsReading () |
Public Member Functions inherited from os::Looper | |
Looper (const String &cName, int nPriority=NORMAL_PRIORITY, int nPortSize=DEFAULT_PORT_SIZE) | |
The looper constructor. More... | |
virtual | ~Looper () |
Looper destructor. More... | |
void | SetName (const String &cName) |
Rename the looper. More... | |
String | GetName () const |
Get the loopers name. More... | |
bool | IsPublic () const |
See if the looper's message port is public. More... | |
void | SetPublic (bool bPublic) |
Make port public/private. 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 |
Obtain 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... | |
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 | Terminate () |
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 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 |
Public Member Functions inherited from os::Handler | |
Handler (const String &cName) | |
Construct a handler. More... | |
virtual | ~Handler () |
Destructor. More... | |
virtual void | TimerTick (int nID) |
Timer dispatch member. More... | |
String | GetName () const |
Get the handlers name. More... | |
void | SetName (const String &cName) |
Rename the handler. More... | |
Looper * | GetLooper () const |
Get a pointer to the looper this handler belongs to. More... | |
void | SetNextHandler (Handler *pcNextHandler) |
Set a handler that should handle messages this handler is not interrested in. More... | |
Handler * | GetNextHandler () const |
Get the next handler in a handler chain. More... | |
void | AddFilter (MessageFilter *pcFilter) |
void | RemoveFilter (MessageFilter *pcFilter) |
const MsgFilterList & | GetFilterList () const |
const uint32 | GetToken () |
Get the handlers token. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from os::Looper | |
static Looper * | GetLooperForThread (thread_id hThread) |
Protected Member Functions inherited from os::Looper | |
bool | FilterMessage (Message *pcMsg, Handler **ppcTarget, std::list< MessageFilter * > *pcFilterList) |
anonymous enum |
References LAYOUT_TIME, os::Directory::Rewind(), and os::NodeMonitor::SetTo().
|
inline |
Referenced by os::IconDirectoryView::HandleMessage().
status_t DirKeeper::GetNode | ( | os::String | zPath, |
os::FSNode * | pcNode, | ||
bool * | pbBrokenLink | ||
) |
References os::FSNode::SetTo().
Referenced by os::IconDirectoryView::HandleMessage().
|
virtual |
pcMessage
is also available through os::Looper::GetCurrentMessage() and os::Looper::DetachCurrentMessage() until this member returns. This is normally not very usefull for HandleMessage() itself but it can be convinient for other members called from HandleMessage() in case they need data from the message that was not passed on from HandleMessage(). pcMessage | The message that should be handled. This message will be deleted by the looper when HandleMessage() returns unless you detach it with os::Looper::DetachCurrentMessage(), |
Reimplemented from os::Handler.
References os::Message::FindInt(), os::Message::FindInt32(), os::Message::FindInt64(), os::Message::FindString(), os::Message::GetCode(), os::FSNode::GetInode(), M_CHANGE_DIR, M_ENTRIES_ADDED, M_ENTRIES_REMOVED, M_ENTRIES_UPDATED, M_LAYOUT_UPDATED, M_NODE_MONITOR, os::Directory::Rewind(), os::NodeMonitor::SetTo(), Stop(), and os::NodeMonitor::Unset().
|
virtual |
Reimplemented from os::Looper.
References os::Volumes::GetFSInfo(), os::Volumes::GetMountPoint(), os::Volumes::GetMountPointCount(), os::Directory::GetNextEntry(), LAYOUT_TIME, os::String::Length(), os::Messenger::SendMessage(), and os::String::substr().
|
inline |
void DirKeeper::Stop | ( | ) |
References os::MessageQueue::AddMessage(), os::Message::GetCode(), os::Looper::GetMessageQueue(), os::MessageQueue::Lock(), os::Looper::Lock(), M_ENTRIES_ADDED, M_ENTRIES_REMOVED, M_ENTRIES_UPDATED, M_NODE_MONITOR, os::MessageQueue::NextMessage(), os::Looper::SpoolMessages(), os::MessageQueue::Unlock(), os::Looper::Unlock(), and os::NodeMonitor::Unset().
Referenced by HandleMessage(), and os::IconDirectoryView::ReRead().