EC_Timeout_Filter.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 /**
00004  *  @file   EC_Timeout_Filter.h
00005  *
00006  *  $Id: EC_Timeout_Filter.h 76589 2007-01-25 18:04:11Z elliott_c $
00007  *
00008  *  @author Carlos O'Ryan (coryan@cs.wustl.edu)
00009  *
00010  * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
00011  * other members of the DOC group. More details can be found in:
00012  *
00013  * http://doc.ece.uci.edu/~coryan/EC/index.html
00014  */
00015 
00016 #ifndef TAO_EC_TIMEOUT_FILTER_H
00017 #define TAO_EC_TIMEOUT_FILTER_H
00018 
00019 #include /**/ "ace/pre.h"
00020 
00021 #include "orbsvcs/Event/EC_Filter.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 #include "orbsvcs/Event/EC_QOS_Info.h"
00028 
00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00030 
00031 class TAO_EC_Event_Channel_Base;
00032 class TAO_EC_ProxyPushSupplier;
00033 
00034 /**
00035  * @class TAO_EC_Timeout_Filter
00036  *
00037  * @brief A filter based on event type/source
00038  *
00039  * This filter only accept events with a predefined type/source,
00040  * both the source and the type can be wildcards.
00041  */
00042 class TAO_RTEvent_Serv_Export TAO_EC_Timeout_Filter : public TAO_EC_Filter
00043 {
00044 public:
00045   /// Constructor.
00046   TAO_EC_Timeout_Filter (TAO_EC_Event_Channel_Base *event_channel,
00047                          TAO_EC_ProxyPushSupplier *supplier,
00048                          const TAO_EC_QOS_Info& qos_info,
00049                          RtecEventComm::EventType type,
00050                          RtecEventComm::Time period);
00051 
00052   /// Destructor.
00053   virtual ~TAO_EC_Timeout_Filter (void);
00054 
00055   /// Return the QOS_Info for this Timeout filter.
00056   const TAO_EC_QOS_Info& qos_info (void) const;
00057 
00058   /// The type of timeout event that we generate.
00059   RtecEventComm::EventType type (void) const;
00060 
00061   /// Callback from the Timeout_Generator
00062   void push_to_proxy (const RtecEventComm::EventSet& event,
00063                       TAO_EC_QOS_Info& qos_info);
00064 
00065   // = The TAO_EC_Filter methods, please check the documentation in
00066   // TAO_EC_Filter.
00067   virtual int filter (const RtecEventComm::EventSet& event,
00068                       TAO_EC_QOS_Info& qos_info);
00069   virtual int filter_nocopy (RtecEventComm::EventSet& event,
00070                              TAO_EC_QOS_Info& qos_info);
00071   virtual void push (const RtecEventComm::EventSet& event,
00072                      TAO_EC_QOS_Info& qos_info);
00073   virtual void push_nocopy (RtecEventComm::EventSet& event,
00074                             TAO_EC_QOS_Info& qos_info);
00075   virtual void clear (void);
00076   virtual CORBA::ULong max_event_size (void) const;
00077   virtual int can_match (const RtecEventComm::EventHeader& header) const;
00078   virtual int add_dependencies (const RtecEventComm::EventHeader& header,
00079                                 const TAO_EC_QOS_Info &qos_info);
00080 
00081 private:
00082   TAO_EC_Timeout_Filter (const TAO_EC_Timeout_Filter&);
00083   TAO_EC_Timeout_Filter& operator= (const TAO_EC_Timeout_Filter&);
00084 
00085 private:
00086   /// The event channel.
00087   TAO_EC_Event_Channel_Base* event_channel_;
00088 
00089   /// The supplier that finally receives the timeout event.
00090   TAO_EC_ProxyPushSupplier *supplier_;
00091 
00092   /// Events "generated" by this filter use this QOS_Info.
00093   TAO_EC_QOS_Info qos_info_;
00094 
00095   /// The type of timeout event...
00096   RtecEventComm::EventType type_;
00097 
00098   /// The period for deadline timeouts...
00099   RtecEventComm::Time period_;
00100 
00101   /// The ID of the timeout in the Timeout_Generator, for
00102   /// cancellation.
00103   long id_;
00104 };
00105 
00106 TAO_END_VERSIONED_NAMESPACE_DECL
00107 
00108 #if defined (__ACE_INLINE__)
00109 #include "orbsvcs/Event/EC_Timeout_Filter.inl"
00110 #endif /* __ACE_INLINE__ */
00111 
00112 #include /**/ "ace/post.h"
00113 
00114 #endif /* TAO_EC_TIMEOUT_FILTER_H */

Generated on Tue Feb 2 17:44:06 2010 for TAO_RTEvent by  doxygen 1.4.7