* Cleared up a misconception in the notification mechanism. We already had

methods that used an "event mask" field. There was no need to introduce
  a "flags" field for the same purpose.
* Renamed protected DefaultNotificationService methods (removed "_" prefix).
* Adjusted the code providing a notification service accordingly.
* Changed the event message several notification services generated by renaming
  the "opcode" field to "event".
* Implemented the TEAM_ADDED event and also added a TEAM_EXEC event.
* Added notifications for threads and images.
* Added visitor-like iteration functions for teams, threads, and images.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30126 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-04-11 21:45:25 +00:00
parent 78c00a4a53
commit efd536ff89
12 changed files with 242 additions and 113 deletions
+8 -8
View File
@@ -118,7 +118,7 @@ private:
struct default_listener : public DoublyLinkedListLinkImpl<default_listener> {
~default_listener();
uint32 flags;
uint32 eventMask;
team_id team;
NotificationListener* listener;
};
@@ -131,7 +131,7 @@ public:
DefaultNotificationService(const char* name);
virtual ~DefaultNotificationService();
void Notify(const KMessage& event, uint32 flags);
void Notify(const KMessage& event, uint32 eventMask);
virtual status_t AddListener(const KMessage* eventSpecifier,
NotificationListener& listener);
@@ -143,10 +143,10 @@ public:
virtual const char* Name() { return fName; }
protected:
virtual status_t _ToFlags(const KMessage& eventSpecifier,
uint32& flags);
virtual void _FirstAdded();
virtual void _LastRemoved();
virtual status_t ToEventMask(const KMessage& eventSpecifier,
uint32& eventMask);
virtual void FirstAdded();
virtual void LastRemoved();
recursive_lock fLock;
DefaultListenerList fListeners;
@@ -168,7 +168,7 @@ public:
NotificationListener& listener);
status_t RemoveUserListeners(port_id port, uint32 token);
status_t UpdateUserListener(uint32 flags,
status_t UpdateUserListener(uint32 eventMask,
port_id port, uint32 token);
private:
@@ -176,7 +176,7 @@ private:
const KMessage* event);
virtual void AllListenersNotified(
NotificationService& service);
status_t _AddListener(uint32 flags,
status_t _AddListener(uint32 eventMask,
NotificationListener& listener);
UserMessagingMessageSender fSender;