1 #ifndef IRIS_NOTIFIER_H_
2 #define IRIS_NOTIFIER_H_
7 // Bitmask at the lowest bits of a long type
8 // representing types of notification.
10 ntf_msg = 1, // first bit for message
11 ntf_queue_deletion = 2, // second bit for queue deletion
21 // send a notification to the receiver
22 void notify(const ntf_t & ntf);
23 // wait for notifications
24 // return false if timed out or on error
25 bool wait(long timeout, std::vector<ntf_t> & ntfs);
26 static inline ntf_t to_ntf_t(long data, ntf_type type) {
27 return data | (int)type;
29 static inline long to_data_t(ntf_t ntf) {
30 return ntf & ~ntf_type_mask;
32 static inline ntf_type to_ntf_type(ntf_t ntf) {
33 return static_cast<ntf_type>(ntf & ntf_type_mask);