summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/Notify_Collection.h
blob: 046ed275efd2587602ecd1d93a089318e8b5c711 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// $Id$
// ==========================================================================
//
// = LIBRARY
//   Orbsvcs
//
// = FILENAME
//   Notify_Collection.h
//
// = DESCRIPTION
//   Collection types used by Notify
//
// = AUTHOR
//    Pradeep Gore <pradeep@cs.wustl.edu>
//
// ==========================================================================

#ifndef TAO_NOTIFY_COLLECTION_H
#define TAO_NOTIFY_COLLECTION_H

#include "ace/pre.h"
#include "orbsvcs/CosNotifyCommC.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "orbsvcs/ESF/ESF_Worker.h"
#include "notify_export.h"
#include "Notify_Event.h"

template<class PROXY> class TAO_ESF_Proxy_Collection;
template<class T> class ACE_Unbounded_Set;

class TAO_Notify_EventListener;
class TAO_Notify_UpdateListener;
class TAO_Notify_EventType;

typedef TAO_ESF_Proxy_Collection<TAO_Notify_EventListener> TAO_Notify_EventListener_List;
// A list of event listeners that are looking for the same event type.

typedef TAO_ESF_Proxy_Collection<TAO_Notify_UpdateListener> TAO_Notify_UpdateListener_List;
// A list of update listeners who want to be notified about publish/subscribe changes.

class TAO_Notify_Export TAO_Notify_EventType_List : public ACE_Unbounded_Set <TAO_Notify_EventType>
{
  // = TITLE
  //   TAO_Notify_EventType_List
  //
  // = DESCRIPTION
  //   Allows operations using the CosNotification::EventTypeSeq type.
  //

  typedef ACE_Unbounded_Set <TAO_Notify_EventType> inherited;

public:
  void populate (CosNotification::EventTypeSeq& event_type_seq);
  // Populate <event_type_seq> with the contents of this object.

  void insert_seq (const CosNotification::EventTypeSeq& event_type_seq);
  // insert the contents of <event_type_seq> into this object.

  void remove_seq (const CosNotification::EventTypeSeq& event_type_seq);
  // remove the contents of <event_type_seq> from this object.
};

// ****************************************************************

// = Collection Iterators.

class TAO_Notify_Export TAO_Notify_Shutdown_Worker : public TAO_ESF_Worker<TAO_Notify_EventListener>
{
  // = TITLE
  //   TAO_Notify_Shutdown_Worker
  //
  // = DESCRIPTION
  //   Shutdown each listener
  //
 public:
  TAO_Notify_Shutdown_Worker (void);

  // = TAO_ESF_Worker method
  void work (TAO_Notify_EventListener* listener TAO_ENV_ARG_DECL);
};

// ****************************************************************
#include "ace/post.h"
#endif /* TAO_NOTIFY_COLLECTION_H */