TAO_EC_Timeout_Adapter Class Reference

Adapt the EC_Filter interface as an Event_Handler. More...

#include <EC_Timeout_Generator.h>

Inheritance diagram for TAO_EC_Timeout_Adapter:

Inheritance graph
[legend]
Collaboration diagram for TAO_EC_Timeout_Adapter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_EC_Timeout_Adapter (void)
 Default construction.


Private Member Functions

virtual int handle_timeout (const ACE_Time_Value &tv, const void *act)
 Casts to EC_Filter and dispatches an event to it.


Detailed Description

Adapt the EC_Filter interface as an Event_Handler.

ACE timer queues (including the reactor) use Event_Handlers to dispatch events, but we want to receive them in EC_Filters, this class is and adaptor for that purpose.

Definition at line 81 of file EC_Timeout_Generator.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_EC_Timeout_Adapter::TAO_EC_Timeout_Adapter void   ) 
 

Default construction.

Definition at line 8 of file EC_Timeout_Generator.i.

00009 {
00010 }


Member Function Documentation

int TAO_EC_Timeout_Adapter::handle_timeout const ACE_Time_Value tv,
const void *  act
[private, virtual]
 

Casts to EC_Filter and dispatches an event to it.

Reimplemented from ACE_Event_Handler.

Definition at line 24 of file EC_Timeout_Generator.cpp.

References ACE_CATCHANY, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TRY_CHECK, ACE_TRY_NEW_ENV, RtecEventComm::EventSet, RtecEventComm::Event::header, TAO_EC_Timeout_Filter::push_to_proxy(), TAO_EC_Timeout_Filter::qos_info(), and TAO_EC_Timeout_Filter::type().

00026 {
00027   //  ACE_DEBUG ((LM_DEBUG,
00028   //              "TAO_EC_Timeout_Adapter::handle_timeout -"
00029   //              " expire at %d:%d\n",
00030   //              tv.sec (), tv.usec ()));
00031 
00032   TAO_EC_Timeout_Filter *filter =
00033     static_cast<TAO_EC_Timeout_Filter*> (const_cast<void*> (vp));
00034 
00035   if (filter == 0)
00036     return 0;
00037 
00038   ACE_TRY_NEW_ENV
00039     {
00040       RtecEventComm::Event e;
00041       e.header.type = filter->type ();
00042       e.header.source = 0;
00043 
00044       RtecEventComm::EventSet single_event (1, 1, &e, 0);
00045 
00046       TAO_EC_QOS_Info qos_info = filter->qos_info ();
00047       filter->push_to_proxy (single_event,
00048                              qos_info
00049                               ACE_ENV_ARG_PARAMETER);
00050       ACE_TRY_CHECK;
00051     }
00052   ACE_CATCHANY
00053     {
00054       return -1;
00055     }
00056   ACE_ENDTRY;
00057 
00058   return 0;
00059 }


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:15:51 2006 for TAO_RTEvent by doxygen 1.3.6