OpenDDS  Snapshot(2023/04/07-19:43)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OpenDDS::DCPS::ThreadSynchResource Class Referenceabstract

#include <ThreadSynchResource.h>

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

Public Member Functions

virtual ~ThreadSynchResource ()
 
virtual int wait_to_unclog ()
 
void set_handle (ACE_HANDLE handle)
 

Protected Member Functions

virtual void notify_lost_on_backpressure_timeout ()=0
 
 ThreadSynchResource ()
 

Protected Attributes

ACE_HANDLE handle_
 
TimeDurationtimeout_
 

Detailed Description

Definition at line 19 of file ThreadSynchResource.h.

Constructor & Destructor Documentation

◆ ~ThreadSynchResource()

OpenDDS::DCPS::ThreadSynchResource::~ThreadSynchResource ( )
virtual

Definition at line 15 of file ThreadSynchResource.cpp.

References DBG_ENTRY_LVL, and timeout_.

16 {
17  DBG_ENTRY_LVL("ThreadSynchResource","~ThreadSynchResource",6);
18  delete this->timeout_;
19 }
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ ThreadSynchResource()

ACE_INLINE OpenDDS::DCPS::ThreadSynchResource::ThreadSynchResource ( )
protected

Definition at line 12 of file ThreadSynchResource.inl.

References ACE_INLINE, and DBG_ENTRY_LVL.

13  : handle_(ACE_INVALID_HANDLE)
14  , timeout_(0)
15 {
16  DBG_ENTRY_LVL("ThreadSynchResource","ThreadSynchResource",6);
17 }
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

Member Function Documentation

◆ notify_lost_on_backpressure_timeout()

virtual void OpenDDS::DCPS::ThreadSynchResource::notify_lost_on_backpressure_timeout ( )
protectedpure virtual

Implemented in OpenDDS::DCPS::TcpSynchResource.

Referenced by wait_to_unclog().

◆ set_handle()

ACE_INLINE void OpenDDS::DCPS::ThreadSynchResource::set_handle ( ACE_HANDLE  handle)

Definition at line 42 of file ThreadSynchResource.inl.

References handle_.

43 {
44  handle_ = handle;
45 }

◆ wait_to_unclog()

ACE_INLINE int OpenDDS::DCPS::ThreadSynchResource::wait_to_unclog ( )
virtual

Definition at line 20 of file ThreadSynchResource.inl.

References ACE_ERROR, ACE_INLINE, ACE_TEXT(), DBG_ENTRY_LVL, ETIME, handle_, ACE::handle_write_ready(), LM_ERROR, notify_lost_on_backpressure_timeout(), timeout_, and OpenDDS::DCPS::TimeDuration::value().

21 {
22  DBG_ENTRY_LVL("ThreadSynchResource","wait_to_unclog",6);
23 
24  if (ACE::handle_write_ready(handle_, timeout_ ? &timeout_->value() : 0) == -1) {
25  if (errno == ETIME) {
26  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: handle_write_ready timed out\n"));
28 
29  } else {
30  ACE_ERROR((LM_ERROR,
31  "(%P|%t) ERROR: ACE::handle_write_ready return -1 while waiting "
32  " to unclog. %p\n", ACE_TEXT("handle_write_ready")));
33  }
34 
35  return -1;
36  }
37 
38  return 0;
39 }
#define ACE_ERROR(X)
virtual void notify_lost_on_backpressure_timeout()=0
const ACE_Time_Value & value() const
ACE_TEXT("TCP_Factory")
int handle_write_ready(ACE_HANDLE handle, const ACE_Time_Value *timeout)
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

Member Data Documentation

◆ handle_

ACE_HANDLE OpenDDS::DCPS::ThreadSynchResource::handle_
protected

Definition at line 32 of file ThreadSynchResource.h.

Referenced by set_handle(), and wait_to_unclog().

◆ timeout_

TimeDuration* OpenDDS::DCPS::ThreadSynchResource::timeout_
protected

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