summaryrefslogtreecommitdiff
path: root/TAO/examples/Simulator/Event_Supplier/DOVE_Supplier.h
blob: e3c0e1cd99614d8699c945bf16b41ffd62a21228 (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
// $Id$

// ============================================================================
//
// = FILENAME
//    DOVE_Supplier.cpp
//
// = DESCRIPTION
//    A wrapper around the event servie initialization and marshalling.
//
// = AUTHOR
//    Michael Kircher (mk1@cs.wustl.edu)
//
// ============================================================================

#include "ace/OS.h"

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

#include "tao/corba.h"
#include "orbsvcs/RtecEventChannelAdminC.h"
#include "orbsvcs/RtecEventCommS.h"
#include "orbsvcs/Event_Utilities.h"
#include "orbsvcs/Event_Service_Constants.h"
#include "orbsvcs/Scheduler_Factory.h"


#ifndef DOVE_SUPPLIER_H
#define DOVE_SUPPLIER_H

#define SOURCE_ID 123

class DOVE_Supplier
{
public:
  DOVE_Supplier ();

  ~DOVE_Supplier (void);

  int connect (const char * MIB_name);

  void disconnect ();

  void notify (CORBA::Any& message);

  // The following Supplier is needed because DOVE_Supplier has not
  // inherited from PushSupplier.

private:
  class Internal_DOVE_Supplier : public POA_RtecEventComm::PushSupplier
  {
    friend class DOVE_Supplier;
  public:
    virtual void disconnect_push_supplier (CORBA::Environment &)
    {
    }

  private:
    Internal_DOVE_Supplier (DOVE_Supplier* impl_ptr);

    DOVE_Supplier* impl_ptr_;
  };

private:
  int get_EventChannel ();
  // get a reference to the event channel

  int connect_Supplier ();
  // connect the the supplier with the event channel

  // = Event Channel adminstration references.
  RtecEventChannelAdmin::EventChannel_var eventChannel_var_;
  RtecEventChannelAdmin::SupplierAdmin_var supplierAdmin_var_;
  RtecEventChannelAdmin::ProxyPushConsumer_var proxyPushConsumer_var_;
  RtecScheduler::Scheduler_var scheduler_var_;

  Internal_DOVE_Supplier* internal_DOVE_Supplier_ptr_;

  const char * MIB_name_;
  // keep the name of the MIB around
};

#endif /* DOVE_SUPPLIER_H */