1 // NodeMonitor.h 2 3 #ifndef NET_FS_NODE_MONITOR_H 4 #define NET_FS_NODE_MONITOR_H 5 6 #include <Looper.h> 7 8 struct node_ref; 9 class NodeMonitoringEvent; 10 class NodeMonitorListener; 11 12 // NodeMonitor 13 class NodeMonitor : public BLooper { 14 public: 15 NodeMonitor(NodeMonitorListener* listener); 16 virtual ~NodeMonitor(); 17 18 virtual void MessageReceived(BMessage* message); 19 20 status_t StartWatching(const node_ref& ref); 21 status_t StopWatching(const node_ref& ref); 22 23 private: 24 status_t _IncreaseLimit(); 25 26 private: 27 NodeMonitorListener* fListener; 28 int32 fCurrentNodeMonitorLimit; 29 }; 30 31 // NodeMonitorListener 32 class NodeMonitorListener { 33 public: 34 NodeMonitorListener(); 35 virtual ~NodeMonitorListener(); 36 37 virtual void ProcessNodeMonitoringEvent( 38 NodeMonitoringEvent* event) = 0; 39 }; 40 41 #endif // NET_FS_NODE_MONITOR_H 42