OpenDDS::DCPS::RemoveAssociationSweeper< T > Class Template Reference

#include <RemoveAssociationSweeper.h>

Inheritance diagram for OpenDDS::DCPS::RemoveAssociationSweeper< T >:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::RemoveAssociationSweeper< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RemoveAssociationSweeper (ACE_Reactor *reactor, ACE_thread_t owner, T *reader)
void schedule_timer (OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::WriterInfo > &info, bool callback)
void cancel_timer (OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::WriterInfo > &info)
int handle_timeout (const ACE_Time_Value &current_time, const void *arg)
virtual bool reactor_is_shut_down () const

Private Member Functions

 ~RemoveAssociationSweeper ()

Private Attributes

T * reader_

Classes

class  CancelCommand
class  CommandBase
class  ScheduleCommand

Detailed Description

template<typename T>
class OpenDDS::DCPS::RemoveAssociationSweeper< T >

Definition at line 28 of file RemoveAssociationSweeper.h.


Constructor & Destructor Documentation

template<typename T>
OpenDDS::DCPS::RemoveAssociationSweeper< T >::RemoveAssociationSweeper ( ACE_Reactor *  reactor,
ACE_thread_t  owner,
T *  reader 
)

Definition at line 83 of file RemoveAssociationSweeper.h.

00086   : ReactorInterceptor (reactor, owner)
00087   , reader_(reader)
00088 { }

template<typename T>
OpenDDS::DCPS::RemoveAssociationSweeper< T >::~RemoveAssociationSweeper (  )  [private]

Definition at line 91 of file RemoveAssociationSweeper.h.

00092 { }


Member Function Documentation

template<typename T>
void OpenDDS::DCPS::RemoveAssociationSweeper< T >::cancel_timer ( OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::WriterInfo > &  info  ) 

Definition at line 106 of file RemoveAssociationSweeper.h.

References OpenDDS::DCPS::ReactorInterceptor::execute_or_enqueue().

00107 {
00108   info->scheduled_for_removal_ = false;
00109   info->removal_deadline_ = ACE_Time_Value::zero;
00110   CancelCommand c(this, info);
00111   execute_or_enqueue(c);
00112 }

template<typename T>
int OpenDDS::DCPS::RemoveAssociationSweeper< T >::handle_timeout ( const ACE_Time_Value &  current_time,
const void *  arg 
)

Definition at line 115 of file RemoveAssociationSweeper.h.

References OpenDDS::DCPS::DCPS_debug_level, OPENDDS_STRING, and OpenDDS::DCPS::RemoveAssociationSweeper< T >::reader_.

00118 {
00119   PublicationId pub_id = reinterpret_cast<const WriterInfo*>(arg)->writer_id_;
00120 
00121   if (DCPS_debug_level >= 1) {
00122     GuidConverter sub_repo(reader_->get_repo_id());
00123     GuidConverter pub_repo(pub_id);
00124     ACE_DEBUG((LM_INFO, "((%P|%t)) RemoveAssociationSweeper::handle_timeout reader: %C waiting on writer: %C\n",
00125                OPENDDS_STRING(sub_repo).c_str(),
00126                OPENDDS_STRING(pub_repo).c_str()));
00127   }
00128 
00129   reader_->remove_or_reschedule(pub_id);
00130   return 0;
00131 }

template<typename T>
virtual bool OpenDDS::DCPS::RemoveAssociationSweeper< T >::reactor_is_shut_down (  )  const [inline, virtual]

Implements OpenDDS::DCPS::ReactorInterceptor.

Definition at line 40 of file RemoveAssociationSweeper.h.

00041   {
00042     return TheServiceParticipant->is_shut_down();
00043   }

template<typename T>
void OpenDDS::DCPS::RemoveAssociationSweeper< T >::schedule_timer ( OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::WriterInfo > &  info,
bool  callback 
)

Definition at line 95 of file RemoveAssociationSweeper.h.

References OpenDDS::DCPS::ReactorInterceptor::execute_or_enqueue().

00096 {
00097   info->scheduled_for_removal_ = true;
00098   info->notify_lost_ = callback;
00099   ACE_Time_Value ten_seconds(10);
00100   info->removal_deadline_ = ACE_OS::gettimeofday() + ten_seconds;
00101   ScheduleCommand c(this, info);
00102   execute_or_enqueue(c);
00103 }


Member Data Documentation

template<typename T>
T* OpenDDS::DCPS::RemoveAssociationSweeper< T >::reader_ [private]

Definition at line 48 of file RemoveAssociationSweeper.h.

Referenced by OpenDDS::DCPS::RemoveAssociationSweeper< T >::handle_timeout().


The documentation for this class was generated from the following file:
Generated on Fri Feb 12 20:06:23 2016 for OpenDDS by  doxygen 1.4.7