Public Member Functions | |
NodeMonitor () | |
NodeMonitor (const String &cPath, uint32 nFlags, const Handler *pcHandler, const Looper *pcLooper=NULL) | |
NodeMonitor (const String &cPath, uint32 nFlags, const Messenger &cTarget) | |
NodeMonitor (const Directory &cDir, const String &cPath, uint32 nFlags, const Handler *pcHandler, const Looper *pcLooper=NULL) | |
NodeMonitor (const Directory &cDir, const String &cPath, uint32 nFlags, const Messenger &cTarget) | |
NodeMonitor (const FileReference &cRef, uint32 nFlags, const Handler *pcHandler, const Looper *pcLooper=NULL) | |
NodeMonitor (const FileReference &cRef, uint32 nFlags, const Messenger &cTarget) | |
NodeMonitor (const FSNode *pcNode, uint32 nFlags, const Handler *pcHandler, const Looper *pcLooper=NULL) | |
NodeMonitor (const FSNode *pcNode, uint32 nFlags, const Messenger &cTarget) | |
~NodeMonitor () | |
bool | IsValid () const |
status_t | Unset () |
status_t | SetTo (const String &cPath, uint32 nFlags, const Handler *pcHandler, const Looper *pcLooper=NULL) |
status_t | SetTo (const String &cPath, uint32 nFlags, const Messenger &cTarget) |
status_t | SetTo (const Directory &cDir, const String &cPath, uint32 nFlags, const Handler *pcHandler, const Looper *pcLooper=NULL) |
status_t | SetTo (const Directory &cDir, const String &cPath, uint32 nFlags, const Messenger &cTarget) |
status_t | SetTo (const FileReference &cRef, uint32 nFlags, const Handler *pcHandler, const Looper *pcLooper=NULL) |
status_t | SetTo (const FileReference &cRef, uint32 nFlags, const Messenger &cTarget) |
status_t | SetTo (const FSNode *pcNode, uint32 nFlags, const Handler *pcHandler, const Looper *pcLooper=NULL) |
status_t | SetTo (const FSNode *pcNode, uint32 nFlags, const Messenger &cTarget) |
int | GetMonitor () const |
Classes | |
class | Private |
A node monitor will produce asyncronous events that will be sendt to a os::Looper whenever a relevant change is made to the node it is monitoring. When creating a NodeMonitor you must provide a bit-mask telling what event's you are interrested in and what os::Looper/osHandler should receive the event message.
Here is a list of the flags controlling what to monitor:
When a relevant change happens to the filesystem one of the following messages are sendt to the target of the monitor:
All messages contain at least 3 elements:
Field | Type | Description |
"event" | T_INT32 | One of the NWEVENT_* event codes |
"device" | T_INT32 | The dev_t device number of the FS containing the affected node(s) |
"node" | T_INT64 | The ino_t i-node number of the affected node |
NWEVENT_CREATED
Sendt when a file is created in a directory watched with NWATCH_DIR.
Field | Type | Description |
"event" | T_INT32 | NWEVENT_CREATED |
"device" | T_INT32 | The dev_t device number of the FS where the file was created. |
"node" | T_INT64 | The ino_t i-node number of the new node |
"dir_node" | T_INT64 | The ino_t of the directory where the node was created. |
"name" | T_STRING | The name of the new node |
NWEVENT_DELETED
Sendt when a file watched with NWATCH_NAME or that lives in a directory watched with NWATCH_DIR is deleted.
Field | Type | Description |
"event" | T_INT32 | NWEVENT_DELETED |
"device" | T_INT32 | The dev_t device number of the FS where the file was deleted. |
"node" | T_INT64 | The ino_t i-node number of the node that was deleted. |
"dir_node" | T_INT64 | The ino_t of the directory from where the node was deleted. |
"name" | T_STRING | The name of the deleted node |
NWEVENT_MOVED
Sendt when a file watched with NWATCH_NAME or that lives in a directory watched with NWATCH_DIR is deleted.
Field | Type | Description |
"event" | T_INT32 | NWEVENT_MOVED |
"device" | T_INT32 | The dev_t device number of the FS containing the moved/renamed file. |
"node" | T_INT64 | The ino_t i-node number of the node that was moved/renamed. |
"old_dir" | T_INT64 | The ino_t i-node number of the directory the file was moved from. |
"new_dir" | T_INT64 | The ino_t i-node number of the directory the file was moved to. If this is the same as "old_dir" the file was only renamed and not moved. |
"name" | T_STRING | The new file name. |
"old_path" | T_STRING | Only present if the NWATCH_FULL_DST_PATH was set and the file was moved into a directory watched with NWATCH_DIR. The string contain the full path of the directory the file was moved from. |
"new_path" | T_STRING | Only present if the NWATCH_FULL_DST_PATH was set and the file was moved out of a directory watched with NWATCH_DIR or the moved/renamed file itself was watched with NWATCH_NAME (and NWATCH_FULL_DST_PATH) |
NodeMonitor::NodeMonitor | ( | ) |
NodeMonitor::NodeMonitor | ( | const String & | cPath, | |
uint32 | nFlags, | |||
const Handler * | pcHandler, | |||
const Looper * | pcLooper = NULL | |||
) |
NodeMonitor::NodeMonitor | ( | const Directory & | cDir, | |
const String & | cPath, | |||
uint32 | nFlags, | |||
const Handler * | pcHandler, | |||
const Looper * | pcLooper = NULL | |||
) |
NodeMonitor::NodeMonitor | ( | const Directory & | cDir, | |
const String & | cPath, | |||
uint32 | nFlags, | |||
const Messenger & | cTarget | |||
) |
NodeMonitor::NodeMonitor | ( | const FileReference & | cRef, | |
uint32 | nFlags, | |||
const Handler * | pcHandler, | |||
const Looper * | pcLooper = NULL | |||
) |
NodeMonitor::NodeMonitor | ( | const FileReference & | cRef, | |
uint32 | nFlags, | |||
const Messenger & | cTarget | |||
) |
NodeMonitor::NodeMonitor | ( | const FSNode * | pcNode, | |
uint32 | nFlags, | |||
const Handler * | pcHandler, | |||
const Looper * | pcLooper = NULL | |||
) |
NodeMonitor::~NodeMonitor | ( | ) |
bool os::NodeMonitor::IsValid | ( | ) | const |
status_t NodeMonitor::Unset | ( | ) |
status_t NodeMonitor::SetTo | ( | const String & | cPath, | |
uint32 | nFlags, | |||
const Handler * | pcHandler, | |||
const Looper * | pcLooper = NULL | |||
) |
status_t NodeMonitor::SetTo | ( | const Directory & | cDir, | |
const String & | cPath, | |||
uint32 | nFlags, | |||
const Handler * | pcHandler, | |||
const Looper * | pcLooper = NULL | |||
) |
status_t NodeMonitor::SetTo | ( | const Directory & | cDir, | |
const String & | cPath, | |||
uint32 | nFlags, | |||
const Messenger & | cTarget | |||
) |
status_t NodeMonitor::SetTo | ( | const FileReference & | cRef, | |
uint32 | nFlags, | |||
const Handler * | pcHandler, | |||
const Looper * | pcLooper = NULL | |||
) |
status_t NodeMonitor::SetTo | ( | const FileReference & | cRef, | |
uint32 | nFlags, | |||
const Messenger & | cTarget | |||
) |
status_t NodeMonitor::SetTo | ( | const FSNode * | pcNode, | |
uint32 | nFlags, | |||
const Handler * | pcHandler, | |||
const Looper * | pcLooper = NULL | |||
) |
int NodeMonitor::GetMonitor | ( | ) | const |