summaryrefslogtreecommitdiff
path: root/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.h
blob: 90b9f872ca63e7d1d0662177ae230af7fc4eac28 (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// -*- C++ -*-

//=============================================================================
/**
 *  @file CIAO_EventServiceBase.h
 *
 *  $Id$
 *
 *  @author Gan Deng <dengg@dre.vanderbilt.edu>
 *  @author George Edwards <g.edwards@vanderbilt.edu>
 */
//=============================================================================

#ifndef CIAO_EVENTSERVICEBASE_H
#define CIAO_EVENTSERVICEBASE_H
#include /**/ "ace/pre.h"

#include "CIAO_EventsS.h"

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

namespace CIAO
{
  /**
   * @class EventServiceBase
   *
   * An abstract base servant class to implement the CIAO_Event_Service
   * interface. The derived classes will provide appropriate
   * implementations of the connect, disconnect, and push methods depending on
   * the event mechanism used.
   */
  class CIAO_EVENTS_Export EventServiceBase :
    public virtual POA_CIAO::CIAO_Event_Service
  {
  public:
    EventServiceBase (void);

    virtual ~EventServiceBase (void);

    /// A factory method for Supplier_Config objects
    virtual Supplier_Config_ptr
    create_supplier_config (void)
      ACE_THROW_SPEC ((CORBA::SystemException)) = 0;

    /// A factory method for Consumer_Config objects
    virtual Consumer_Config_ptr
    create_consumer_config (void)
      ACE_THROW_SPEC ((CORBA::SystemException)) = 0;

    /**
     * @fn void connect_event_supplier (Supplier_Config_ptr supplier_config)
     *
     * Connects an event supplier using the options specified by
     * @c supplier_config.
     */
    virtual void connect_event_supplier (
        Supplier_Config_ptr supplier_config
        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
        CORBA::SystemException)) = 0;

    /**
     * @fn void connect_event_consumer (Consumer_Config_ptr consumer_config)
     *
     * Connects an event consumer using the options specified by
     * @c consumer_config.
     */
    virtual void connect_event_consumer (
        Consumer_Config_ptr consumer_config
        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
        CORBA::SystemException)) = 0;

    /**
     * @fn void disconnect_event_supplier ()
     *
     * Disconnects the event supplier associated with this object.
     */
    virtual void disconnect_event_supplier (
        const char * consumer_id
        ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
        CORBA::SystemException,
        Components::InvalidConnection)) = 0;

    /**
     * @fn void disconnect_event_consumer (CONNECTION_ID consumer_id)
     *
     * Disconnects the event consumer with UUID @c consumer_id.
     */
    virtual void disconnect_event_consumer (
        const char * consumer_id
        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
        CORBA::SystemException,
        Components::InvalidConnection)) = 0;

    /**
     * @fn void push_event (Components::EventBase * ev)
     *
     * Pushes event @c ev to all consumers.
     */
    virtual void push_event (
        Components::EventBase * ev
        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
        CORBA::SystemException)) = 0;
  };

  class Event_Consumer_Config_Base :
    public virtual POA_CIAO::Consumer_Config
  {
  public:
    virtual void start_conjunction_group (
        ::CORBA::Long size
        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((::CORBA::SystemException)) = 0;

    virtual void start_disjunction_group (
        ::CORBA::Long size
        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((::CORBA::SystemException)) = 0;

    virtual void insert_source (
        const char * source_id
        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((::CORBA::SystemException)) = 0;

    virtual void insert_type (
        ::CORBA::Long  event_type
        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((::CORBA::SystemException)) = 0;
  };
}

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