OpenDDS  Snapshot(2023/04/28-20:55)
ReactorSynch.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_TRANSPORT_FRAMEWORK_REACTORSYNCH_H
9 #define OPENDDS_DCPS_TRANSPORT_FRAMEWORK_REACTORSYNCH_H
10 
11 #include "ThreadSynch.h"
12 #include "ScheduleOutputHandler.h"
13 
15 
16 namespace OpenDDS { namespace DCPS {
17 
18 /**
19  * @class ReactorSynch
20  *
21  * @brief Send thread synchronization utilizing a reactor.
22  *
23  * This class implements sending thread synchronization by scheduling
24  * qeueued data sending to be handled by a reactor. The initial
25  * implementation will share the TransportReactorTask reactor for all
26  * sending threads; which means that all receiving and queued sends will
27  * be sharing the same thread. Or thread pool.
28  *
29  * Calls to enable and disable sending on queued data by the reactor are
30  * scheduled to be enabled and disabled on the reactor by notifying the
31  * reactor to make the update. This ensures that no locks will be held
32  * (other than the Reactor::token_) when the call into the reactor is
33  * made.
34  *
35  * References to the containing TransportSendStrategy and the reactor are
36  * held as raw pointers since they are guaranteed to be valid for the
37  * lifetime of this object (this is held in the same containing object).
38  */
39 class ReactorSynch : public ThreadSynch {
40 public:
41  /// Construct with raw pointers from the containing
42  /// TransportSendStrategy.
43  ReactorSynch(ThreadSynchResource* synch_resource,
44  TransportSendStrategy* strategy,
45  ACE_Reactor* reactor);
46 
47  virtual ~ReactorSynch();
48 
49  virtual void work_available();
50 
51 private:
52  /// Notification event handler.
54 
55  /// Memory management using the provided (kluge) var type.
57 };
58 
59 }} // End namespace OpenDDS::DCPS
60 
62 
63 #if defined (__ACE_INLINE__)
64 #include "ReactorSynch.inl"
65 #endif /* __ACE_INLINE__ */
66 
67 #endif /* OPENDDS_DCPS_REACTORSYNCH_H */
ScheduleOutputHandler * scheduleOutputHandler_
Notification event handler.
Definition: ReactorSynch.h:53
ReactorSynch(ThreadSynchResource *synch_resource, TransportSendStrategy *strategy, ACE_Reactor *reactor)
ACE_Event_Handler_var safeHandler_
Memory management using the provided (kluge) var type.
Definition: ReactorSynch.h:56
Send thread synchronization utilizing a reactor.
Definition: ReactorSynch.h:39
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
event handler used to enable and disable output processing.
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28