#include <EC_Timeout_Filter.h>
Inheritance diagram for TAO_EC_Timeout_Filter:
Public Member Functions | |
TAO_EC_Timeout_Filter (TAO_EC_Event_Channel_Base *event_channel, TAO_EC_ProxyPushSupplier *supplier, const TAO_EC_QOS_Info &qos_info, RtecEventComm::EventType type, RtecEventComm::Time period) | |
Constructor. | |
virtual | ~TAO_EC_Timeout_Filter (void) |
Destructor. | |
const TAO_EC_QOS_Info & | qos_info (void) const |
Return the QOS_Info for this Timeout filter. | |
RtecEventComm::EventType | type (void) const |
The type of timeout event that we generate. | |
void | push_to_proxy (const RtecEventComm::EventSet &event, TAO_EC_QOS_Info &qos_info) |
Callback from the Timeout_Generator. | |
virtual int | filter (const RtecEventComm::EventSet &event, TAO_EC_QOS_Info &qos_info) |
virtual int | filter_nocopy (RtecEventComm::EventSet &event, TAO_EC_QOS_Info &qos_info) |
virtual void | push (const RtecEventComm::EventSet &event, TAO_EC_QOS_Info &qos_info) |
virtual void | push_nocopy (RtecEventComm::EventSet &event, TAO_EC_QOS_Info &qos_info) |
virtual void | clear (void) |
virtual CORBA::ULong | max_event_size (void) const |
Returns the maximum size of the events pushed by this filter. | |
virtual int | can_match (const RtecEventComm::EventHeader &header) const |
virtual int | add_dependencies (const RtecEventComm::EventHeader &header, const TAO_EC_QOS_Info &qos_info) |
Private Member Functions | |
TAO_EC_Timeout_Filter (const TAO_EC_Timeout_Filter &) | |
TAO_EC_Timeout_Filter & | operator= (const TAO_EC_Timeout_Filter &) |
Private Attributes | |
TAO_EC_Event_Channel_Base * | event_channel_ |
The event channel. | |
TAO_EC_ProxyPushSupplier * | supplier_ |
The supplier that finally receives the timeout event. | |
TAO_EC_QOS_Info | qos_info_ |
Events "generated" by this filter use this QOS_Info. | |
RtecEventComm::EventType | type_ |
The type of timeout event... | |
RtecEventComm::Time | period_ |
The period for deadline timeouts... | |
long | id_ |
This filter only accept events with a predefined type/source, both the source and the type can be wildcards.
Definition at line 42 of file EC_Timeout_Filter.h.
|
Constructor.
Definition at line 20 of file EC_Timeout_Filter.cpp. References ACE_ES_EVENT_DEADLINE_TIMEOUT, ACE_ES_EVENT_INTERVAL_TIMEOUT, TAO_EC_Timeout_Generator::schedule_timer(), RtecEventComm::Time, and TAO_EC_Event_Channel_Base::timeout_generator().
00026 : event_channel_ (event_channel), 00027 supplier_ (supplier), 00028 qos_info_ (qos_info), 00029 type_ (type), 00030 period_ (period), 00031 id_ (-1) 00032 { 00033 ACE_Time_Value tv_delta; 00034 ORBSVCS_Time::TimeT_to_Time_Value (tv_delta, period); 00035 00036 TAO_EC_Timeout_Generator *tg = 00037 this->event_channel_->timeout_generator (); 00038 00039 if (this->type_ == ACE_ES_EVENT_INTERVAL_TIMEOUT 00040 || this->type_ == ACE_ES_EVENT_DEADLINE_TIMEOUT) 00041 { 00042 ACE_Time_Value tv_interval; 00043 ORBSVCS_Time::TimeT_to_Time_Value (tv_interval, this->period_); 00044 00045 this->id_ = 00046 tg->schedule_timer (this, 00047 tv_delta, 00048 tv_interval); 00049 } 00050 else 00051 { 00052 this->id_ = 00053 tg->schedule_timer (this, 00054 tv_delta, 00055 ACE_Time_Value::zero); 00056 } 00057 00058 // ACE_DEBUG ((LM_DEBUG, 00059 // "EC_Timeout_Filter - interval = %d:%d, ID = %d\n", 00060 // tv_interval.sec (), tv_interval.usec (), 00061 // this->id_)); 00062 } |
|
Destructor.
Definition at line 64 of file EC_Timeout_Filter.cpp. References TAO_EC_Timeout_Generator::cancel_timer(), and TAO_EC_Event_Channel_Base::timeout_generator().
00065 { 00066 this->event_channel_->timeout_generator ()->cancel_timer (this->qos_info_, 00067 this->id_); 00068 } |
|
|
|
This is used for computing the scheduling dependencies: Leaf filters check if the header could be matched, similar to the can_match() method; if it does they return 1, and 0 otherwise. Intermediate nodes always return 0. This is used to build precise dependencies between the suppliers and the leaf of the filters that accept that event. Notice that only the nodes doing scheduling recurse through the list, so in configurations that do no require scheduling the recursion stops fairly soon. Implements TAO_EC_Filter. Definition at line 155 of file EC_Timeout_Filter.cpp.
00158 {
00159 return 0;
00160 }
|
|
Returns 0 if an event with that header could never be accepted. This can used by the suppliers to filter out consumers that couldn't possibly be interested in their events. The rt_info and Implements TAO_EC_Filter. Definition at line 148 of file EC_Timeout_Filter.cpp.
00150 {
00151 return 0;
00152 }
|
|
Clear any saved state, must reset and assume no events have been received. Implements TAO_EC_Filter. Definition at line 120 of file EC_Timeout_Filter.cpp. References ACE_ES_EVENT_DEADLINE_TIMEOUT, TAO_EC_Timeout_Generator::cancel_timer(), TAO_EC_Timeout_Generator::schedule_timer(), and TAO_EC_Event_Channel_Base::timeout_generator().
00121 { 00122 if (this->type_ == ACE_ES_EVENT_DEADLINE_TIMEOUT) 00123 { 00124 TAO_EC_Timeout_Generator *tg = 00125 this->event_channel_->timeout_generator (); 00126 00127 tg->cancel_timer (this->qos_info_, 00128 this->id_); 00129 00130 ACE_Time_Value tv_interval; 00131 ORBSVCS_Time::TimeT_to_Time_Value (tv_interval, this->period_); 00132 ACE_Time_Value tv_delta = tv_interval; 00133 00134 this->id_ = 00135 tg->schedule_timer (this, 00136 tv_delta, 00137 tv_interval); 00138 } 00139 } |
|
Filter this event, returns 1 if the event is accepted, 0 otherwise. Notice that there are two versions of the method, if the event is not const then filter can take ownership of the event.
Implements TAO_EC_Filter. Definition at line 82 of file EC_Timeout_Filter.cpp. References RtecEventComm::EventSet, TAO_EC_Filter::parent(), TAO_EC_Filter::push(), and TAO_EC_QOS_Info::timer_id_.
|
|
Implements TAO_EC_Filter. Definition at line 95 of file EC_Timeout_Filter.cpp. References RtecEventComm::EventSet, TAO_EC_Filter::parent(), TAO_EC_Filter::push_nocopy(), and TAO_EC_QOS_Info::timer_id_.
00097 { 00098 if (qos_info.timer_id_ == this->id_ 00099 && this->parent () != 0) 00100 { 00101 this->parent ()->push_nocopy (event, qos_info); 00102 return 1; 00103 } 00104 return 0; 00105 } |
|
Returns the maximum size of the events pushed by this filter.
Implements TAO_EC_Filter. Definition at line 142 of file EC_Timeout_Filter.cpp.
00143 {
00144 return 1;
00145 }
|
|
|
|
This is called by the children when they accept an event and which to pass it up. Notice that there are two versions of the method, if the event is not const then filter can take ownership of the event. Implements TAO_EC_Filter. Definition at line 108 of file EC_Timeout_Filter.cpp. References RtecEventComm::EventSet.
00110 { 00111 } |
|
Implements TAO_EC_Filter. Definition at line 114 of file EC_Timeout_Filter.cpp. References RtecEventComm::EventSet.
00116 { 00117 } |
|
Callback from the Timeout_Generator.
Definition at line 71 of file EC_Timeout_Filter.cpp. References RtecEventComm::EventSet, TAO_EC_ProxyPushSupplier::filter(), and TAO_EC_QOS_Info::timer_id_. Referenced by TAO_EC_Timeout_Adapter::handle_timeout().
|
|
Return the QOS_Info for this Timeout filter.
Definition at line 8 of file EC_Timeout_Filter.inl. References qos_info_. Referenced by TAO_EC_Timeout_Adapter::handle_timeout().
00009 { 00010 return this->qos_info_; 00011 } |
|
The type of timeout event that we generate.
Definition at line 14 of file EC_Timeout_Filter.inl. Referenced by TAO_EC_Timeout_Adapter::handle_timeout().
00015 { 00016 return this->type_; 00017 } |
|
The event channel.
Definition at line 87 of file EC_Timeout_Filter.h. |
|
The ID of the timeout in the Timeout_Generator, for cancellation. Definition at line 103 of file EC_Timeout_Filter.h. |
|
The period for deadline timeouts...
Definition at line 99 of file EC_Timeout_Filter.h. |
|
Events "generated" by this filter use this QOS_Info.
Definition at line 93 of file EC_Timeout_Filter.h. Referenced by qos_info(). |
|
The supplier that finally receives the timeout event.
Definition at line 90 of file EC_Timeout_Filter.h. |
|
The type of timeout event...
Definition at line 96 of file EC_Timeout_Filter.h. |