summaryrefslogtreecommitdiff
path: root/TAO/CIAO/ciao/CCM_Event.idl
blob: 73804f53aba7b342a96cacd8204b476d3be1ef2a (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// $Id$

/**
 * @@ Compile this file with:
 *
 *     tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \
 *          -Wb,export_macro=CIAO_Export \
 *          -Wb,export_include=CIAO_export.h \
 *          -Wb,pre_include="ace/pre.h" \
 *          -Wb,post_include="ace/post.h" \
 *          CCM_Event.idl
 */

//#define CIAO_HAS_IMPORT_KEYWORD

#if !defined (CCM_EVENT_IDL)
#define CCM_EVENT_IDL

#include "CCM_Base.idl"

module Components
{
  typeprefix Components "omg.org";

  abstract valuetype EventBase {};

  interface EventConsumerBase
  {
    void push_event (in EventBase evt) raises (BadEventType);

    // CIAO-specific operation to help support the capability
    // to subscribe to eventtypes more derived than the type
    // consumed.
    boolean ciao_is_substitutable (in string event_repo_id);
  };

  valuetype ConsumerDescription : PortDescription
  {
    public EventConsumerBase consumer;
  };
  typedef sequence<ConsumerDescription> ConsumerDescriptions;

  valuetype EmitterDescription : PortDescription
  {
    public EventConsumerBase consumer;
  };
  typedef sequence<EmitterDescription> EmitterDescriptions;

  valuetype SubscriberDescription
  {
    public Cookie ck;
    public EventConsumerBase consumer;
  };
  typedef sequence<SubscriberDescription> SubscriberDescriptions;

  valuetype PublisherDescription : PortDescription
  {
    public SubscriberDescriptions consumer;
  };
  typedef sequence<PublisherDescription> PublisherDescriptions;

  interface Events
  {
    EventConsumerBase get_consumer (in FeatureName sink_name)
      raises (InvalidName);

    Cookie subscribe (in FeatureName publisher_name,
                      in EventConsumerBase subscriber)
      raises (InvalidName,
              AlreadyConnected,
              InvalidConnection,
              ExceededConnectionLimit);

    EventConsumerBase unsubscribe (in FeatureName publisher_name,
                                   in Cookie ck)
      raises (InvalidName,
              InvalidConnection);

    // CIAO specific operations to connect a component to
    // CIAO_Event_Service
    // We have to use generic "Object" interface instead of the
    // CIAO_Event_Service interface type, since CIAO_Event_Service
    // relies on EventConsumerBase defined within this file, which
    // causes circular dependencies. -Gan
    Cookie ciao_connect_es (in FeatureName publisher_name,
                            in Object es)
      raises (InvalidName,
              AlreadyConnected,
              InvalidConnection,
              ExceededConnectionLimit);

    Object
    ciao_disconnect_es (in FeatureName publisher_name,
                        in Cookie ck)
      raises (InvalidName,
              InvalidConnection);

    void connect_consumer (in FeatureName emitter_name,
                           in EventConsumerBase consumer)
      raises (InvalidName,
              AlreadyConnected,
              InvalidConnection);

    EventConsumerBase disconnect_consumer (in FeatureName source_name)
      raises (InvalidName,
              NoConnection);

    ConsumerDescriptions get_all_consumers ();

    ConsumerDescriptions get_named_consumers (in NameList names)
      raises (InvalidName);

    EmitterDescriptions get_all_emitters ();

    EmitterDescriptions get_named_emitters (in NameList names)
      raises (InvalidName);

    PublisherDescriptions get_all_publishers ();

    PublisherDescriptions get_named_publishers (in NameList names)
      raises (InvalidName);
  };
};
#endif /* CCM_EVENT_IDL */