2 //=============================================================================
4 * @file DOVE_Supplier.h
6 * A wrapper around the event service initialization and marshalling.
8 * @author Michael Kircher (mk1@cs.wustl.edu) Chris Gill (cdgill@cs.wustl.edu)
10 //=============================================================================
13 #include "orbsvcs/RtecEventChannelAdminC.h"
15 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 #endif /* ACE_LACKS_PRAGMA_ONCE */
19 #include "orbsvcs/RtecEventCommS.h"
20 #include "orbsvcs/Event_Utilities.h"
21 #include "orbsvcs/Event_Service_Constants.h"
22 #include "orbsvcs/Scheduler_Factory.h"
25 #ifndef DOVE_SUPPLIER_H
26 #define DOVE_SUPPLIER_H
39 /// Initialize the ORB and the connection to the Name Service
42 /// Connect to the event service.
43 int connect (const char * MIB_name
= 0,
44 const char* es_name
= 0,
45 const char * ss_name
= 0,
46 ACE_Scheduler_Factory::POD_RT_Info
* pod_rt_info
= 0);
48 /// Perform all post-connection-establishment processing.
51 /// Disconnect from the event service.
54 /// Notify the consumer proxy that we have events
55 void notify (CORBA::Any
& message
);
57 /// Use the next connection in the list of established connections.
58 void use_next_connection ();
60 /// Use the previous connection in the list of established connections.
61 void use_prev_connection ();
64 // The following Supplier is needed because DOVE_Supplier has not
65 // inherited from PushSupplier.
67 class Internal_DOVE_Supplier
: public POA_RtecEventComm::PushSupplier
69 friend class DOVE_Supplier
;
72 virtual void disconnect_push_supplier ()
77 Internal_DOVE_Supplier (DOVE_Supplier
* impl_ptr
);
79 DOVE_Supplier
* impl_ptr_
;
83 struct Connection_Params
85 const char * es_name_
;
86 const char * ss_name_
;
87 RtecEventChannelAdmin::EventChannel_var eventChannel_var_
;
88 RtecEventChannelAdmin::SupplierAdmin_var supplierAdmin_var_
;
89 RtecEventChannelAdmin::ProxyPushConsumer_var proxyPushConsumer_var_
;
90 RtecScheduler::Scheduler_var scheduler_var_
;
91 RtecScheduler::handle_t rt_info_
;
92 ACE_Scheduler_Factory::POD_RT_Info pod_rt_info_
;
95 /// Get the event channel reference.
96 int get_EventChannel ();
98 /// Get the scheduler reference.
101 /// Connect the the supplier with the event channel.
102 int connect_Supplier ();
104 /// Access the default rt_info singleton.
105 static ACE_Scheduler_Factory::POD_RT_Info
* pod_rt_info_instance ();
107 static ACE_Scheduler_Factory::POD_RT_Info
* pod_rt_info_instance_
;
109 // Object initialization flags
113 Connection_Params
** connection_params_list_
;
114 Connection_Params
* current_connection_params_
;
115 int connection_count_
;
116 int current_connection_index_
;
118 // = ORB, ORB Services adminstration references.
119 CosNaming::NamingContext_var namingContext_var_
;
120 PortableServer::POA_var root_POA_var_
;
121 PortableServer::POAManager_var poa_manager_
;
123 Internal_DOVE_Supplier
* internal_DOVE_Supplier_ptr_
;
125 /// Keep the name of the MIB around.
126 const char * MIB_name_
;
129 #endif /* DOVE_SUPPLIER_H */