OpenDDS  Snapshot(2023/04/07-19:43)
Public Member Functions | Private Attributes | List of all members
OpenDDS::DCPS::ReactorSynchStrategy Class Reference

strategy to construct ReactorSynch implementations of ThreadSynch. More...

#include <ReactorSynchStrategy.h>

Inheritance diagram for OpenDDS::DCPS::ReactorSynchStrategy:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::ReactorSynchStrategy:
Collaboration graph
[legend]

Public Member Functions

 ReactorSynchStrategy (TransportSendStrategy *strategy, ACE_Reactor *reactor)
 
virtual ~ReactorSynchStrategy ()
 
virtual ThreadSynchcreate_synch_object (ThreadSynchResource *synch_resource, long priority=0, long scheduler=0)
 
- Public Member Functions inherited from OpenDDS::DCPS::ThreadSynchStrategy
virtual ~ThreadSynchStrategy ()
 
- Public Member Functions inherited from OpenDDS::DCPS::RcObject
virtual ~RcObject ()
 
virtual void _add_ref ()
 
virtual void _remove_ref ()
 
long ref_count () const
 
WeakObject_get_weak_object () const
 

Private Attributes

TransportSendStrategystrategy_
 
ACE_Reactorreactor_
 

Additional Inherited Members

- Protected Member Functions inherited from OpenDDS::DCPS::ThreadSynchStrategy
 ThreadSynchStrategy ()
 
- Protected Member Functions inherited from OpenDDS::DCPS::RcObject
 RcObject ()
 

Detailed Description

strategy to construct ReactorSynch implementations of ThreadSynch.

This class is used as a factory for ReactorSynch objects that can be used to scheduled queued output for processing on a reactor. The initial implementation will share the Transport reactor for all of the sending and receiving processing to be performed. If the reactor is upgraded to a thread pool reactor, then this processing can be split between those threads using the default leader-follower dispatching.

The usage idiom for ThreadSynchStrategy ensures that his object will have valid raw pointer values during its lifetime.

Definition at line 39 of file ReactorSynchStrategy.h.

Constructor & Destructor Documentation

◆ ReactorSynchStrategy()

ACE_INLINE OpenDDS::DCPS::ReactorSynchStrategy::ReactorSynchStrategy ( TransportSendStrategy strategy,
ACE_Reactor reactor 
)

Construct with strategy, reactor, and handle to configure the ReactorSynch with.

Definition at line 11 of file ReactorSynchStrategy.inl.

References DBG_ENTRY_LVL.

15  : strategy_( strategy),
16  reactor_( reactor)
17 {
18  DBG_ENTRY_LVL("ReactorSynchStrategy","ReactorSynchStrategy",6);
19 }
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ ~ReactorSynchStrategy()

OpenDDS::DCPS::ReactorSynchStrategy::~ReactorSynchStrategy ( )
virtual

Definition at line 16 of file ReactorSynchStrategy.cpp.

References DBG_ENTRY_LVL.

17 {
18  DBG_ENTRY_LVL("ReactorSynchStrategy","~ReactorSynchStrategy",6);
19 }
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

Member Function Documentation

◆ create_synch_object()

OpenDDS::DCPS::ThreadSynch * OpenDDS::DCPS::ReactorSynchStrategy::create_synch_object ( ThreadSynchResource synch_resource,
long  priority = 0,
long  scheduler = 0 
)
virtual

Implements OpenDDS::DCPS::ThreadSynchStrategy.

Definition at line 22 of file ReactorSynchStrategy.cpp.

References DBG_ENTRY_LVL, reactor_, and strategy_.

24 {
25  DBG_ENTRY_LVL("ReactorSynchStrategy","create_synch_object",6);
26  return new ReactorSynch(
27  synch_resource, strategy_, reactor_);
28 }
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

Member Data Documentation

◆ reactor_

ACE_Reactor* OpenDDS::DCPS::ReactorSynchStrategy::reactor_
private

Raw pointer to reactor. This is ok since the strategy will pass the pointer on to the ReactorSynch, which is guaranteed to span the lifetime of both the strategy and the reactor.

Definition at line 63 of file ReactorSynchStrategy.h.

Referenced by create_synch_object().

◆ strategy_

TransportSendStrategy* OpenDDS::DCPS::ReactorSynchStrategy::strategy_
private

Raw pointer to the strategy. This is the strategy that contains the TreadSynch (which will receive this pointer) so the lifetime is assured.

Definition at line 58 of file ReactorSynchStrategy.h.

Referenced by create_synch_object().


The documentation for this class was generated from the following files: