1.1 --- a/libfsserver/include/fsserver/notification.h Mon Jul 12 23:18:16 2021 +0200
1.2 +++ b/libfsserver/include/fsserver/notification.h Tue Jul 13 00:26:11 2021 +0200
1.3 @@ -22,11 +22,29 @@
1.4 #pragma once
1.5
1.6 #include <set>
1.7 +#include <vector>
1.8
1.9 #include <systypes/base.h>
1.10
1.11
1.12
1.13 +/* Collection data types. */
1.14 +
1.15 +typedef std::set<l4_cap_idx_t> NotifierSet;
1.16 +
1.17 +/* Notification endpoint details. */
1.18 +
1.19 +class NotificationEndpoint
1.20 +{
1.21 +public:
1.22 + NotifierSet notifiers;
1.23 + notify_flags_t flags, deferred;
1.24 +};
1.25 +
1.26 +typedef std::vector<NotificationEndpoint> NotificationEndpointList;
1.27 +
1.28 +
1.29 +
1.30 /* Notification support, allowing pipe or file users to receive events due to
1.31 activity on those objects. */
1.32
1.33 @@ -35,20 +53,16 @@
1.34 protected:
1.35 /* Endpoint count. */
1.36
1.37 - unsigned int _max_endpoints;
1.38 + unsigned int _min_endpoints;
1.39
1.40 - /* Notification endpoints and flags, set up at initialisation for the
1.41 - appropriate number of endpoints. */
1.42 + /* Notification endpoint details. */
1.43
1.44 - std::set<l4_cap_idx_t> *_notifiers;
1.45 - notify_flags_t *_flags, *_deferred;
1.46 + NotificationEndpointList _endpoints;
1.47
1.48 virtual void release_notifiers();
1.49
1.50 public:
1.51 - explicit NotificationSupport(unsigned int endpoints);
1.52 -
1.53 - virtual ~NotificationSupport();
1.54 + explicit NotificationSupport(unsigned int endpoints=0);
1.55
1.56 virtual void notify(unsigned int endpoint, notify_flags_t flags);
1.57