summaryrefslogtreecommitdiff
path: root/ACE/apps/Gateway/Gateway/Event_Forwarding_Discriminator.h
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2008-03-04 14:51:23 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2008-03-04 14:51:23 +0000
commit99aa8c60282c7b8072eb35eb9ac815702f5bf586 (patch)
treebda96bf8c3a4c2875a083d7b16720533c8ffeaf4 /ACE/apps/Gateway/Gateway/Event_Forwarding_Discriminator.h
parentc4078c377d74290ebe4e66da0b4975da91732376 (diff)
downloadATCD-99aa8c60282c7b8072eb35eb9ac815702f5bf586.tar.gz
undoing accidental deletion
Diffstat (limited to 'ACE/apps/Gateway/Gateway/Event_Forwarding_Discriminator.h')
-rw-r--r--ACE/apps/Gateway/Gateway/Event_Forwarding_Discriminator.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/ACE/apps/Gateway/Gateway/Event_Forwarding_Discriminator.h b/ACE/apps/Gateway/Gateway/Event_Forwarding_Discriminator.h
new file mode 100644
index 00000000000..2a83a53a584
--- /dev/null
+++ b/ACE/apps/Gateway/Gateway/Event_Forwarding_Discriminator.h
@@ -0,0 +1,65 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// gateway
+//
+// = FILENAME
+// Event_Forwarding_Discriminator.h
+//
+// = AUTHOR
+// Doug Schmidt
+//
+// ============================================================================
+
+#ifndef _CONSUMER_MAP_H
+#define _CONSUMER_MAP_H
+
+#include "ace/Map_Manager.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Null_Mutex.h"
+#include "Event.h"
+#include "Consumer_Dispatch_Set.h"
+
+class Event_Forwarding_Discriminator
+{
+ // = TITLE
+ // Map events to the set of Consumer_Proxies that have subscribed
+ // to receive the event.
+public:
+ int bind (Event_Key event, Consumer_Dispatch_Set *cds);
+ // Associate Event with the Consumer_Dispatch_Set.
+
+ int unbind (Event_Key event);
+ // Locate EXID and pass out parameter via INID. If found,
+ // return 0, else -1.
+
+ int find (Event_Key event, Consumer_Dispatch_Set *&cds);
+ // Break any association of EXID.
+
+public:
+ ACE_Map_Manager<Event_Key, Consumer_Dispatch_Set *, ACE_Null_Mutex> map_;
+ // Map that associates <Event_Key>s (external ids) with
+ // <Consumer_Dispatch_Set> *'s <internal IDs>.
+};
+
+class Event_Forwarding_Discriminator_Iterator
+{
+ // = TITLE
+ // Define an iterator for the Consumer Map.
+public:
+ Event_Forwarding_Discriminator_Iterator (Event_Forwarding_Discriminator &mm);
+ int next (Consumer_Dispatch_Set *&);
+ int advance (void);
+
+private:
+ ACE_Map_Iterator<Event_Key, Consumer_Dispatch_Set *, ACE_Null_Mutex> map_iter_;
+ // Map we are iterating over.
+};
+#endif /* _CONSUMER_MAP_H */