EC_Kokyu_Filter.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 /**
00003  *  @file   EC_Kokyu_Filter.h
00004  *
00005  *  $Id: EC_Kokyu_Filter.h 76589 2007-01-25 18:04:11Z elliott_c $
00006  *
00007  *  @author Carlos O'Ryan (coryan@cs.wustl.edu)
00008  *
00009  * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
00010  * other members of the DOC group. More details can be found in:
00011  *
00012  * http://doc.ece.uci.edu/~coryan/EC/index.html
00013  */
00014 
00015 #ifndef TAO_EC_KOKYU_FILTER_H
00016 #define TAO_EC_KOKYU_FILTER_H
00017 #include /**/ "ace/pre.h"
00018 
00019 #include "orbsvcs/Event/EC_Filter.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #include "orbsvcs/RtecSchedulerC.h"
00026 #include "orbsvcs/Event/rtkokyu_event_export.h"
00027 #include "ace/SString.h"
00028 
00029 //#define EC_KOKYU_LOGGING
00030 
00031 /**
00032  * @class TAO_EC_Kokyu_Filter
00033  *
00034  * @brief Decorate a filter with scheduling information
00035  *
00036  * This filter decorates a regular filter with scheduling
00037  * information. It creates a new RT_Info entry for the filter and
00038  * it adds the dependencies between the filter and any childrens
00039  * it may have.
00040  *
00041  * <H2>Memory Management</H2>
00042  * It assumes ownership of the children.
00043  */
00044 class TAO_RTKokyuEvent_Export TAO_EC_Kokyu_Filter : public TAO_EC_Filter
00045 {
00046 public:
00047   /**
00048    * Constructor.
00049    * It assumes ownership of the @a body, makes a copy of the other
00050    * parameters
00051    */
00052   TAO_EC_Kokyu_Filter (const char* name,
00053                        RtecScheduler::handle_t rt_info,
00054                        RtecScheduler::Scheduler_ptr scheduler,
00055                        TAO_EC_Filter* body,
00056                        RtecScheduler::handle_t body_info,
00057                        RtecScheduler::handle_t parent_info,
00058                        RtecScheduler::Info_Type_t info_type);
00059 
00060   /// Destructor
00061   virtual ~TAO_EC_Kokyu_Filter (void);
00062 
00063   // = The TAO_EC_Filter methods, please check the documentation in
00064   // TAO_EC_Filter.
00065   virtual ChildrenIterator begin (void) const;
00066   virtual ChildrenIterator end (void) const;
00067   virtual int size (void) const;
00068   virtual int filter (const RtecEventComm::EventSet& event,
00069                       TAO_EC_QOS_Info& qos_info);
00070   virtual int filter_nocopy (RtecEventComm::EventSet& event,
00071                              TAO_EC_QOS_Info& qos_info);
00072   virtual void push (const RtecEventComm::EventSet& event,
00073                      TAO_EC_QOS_Info& qos_info);
00074   virtual void push_nocopy (RtecEventComm::EventSet& event,
00075                             TAO_EC_QOS_Info& qos_info);
00076   virtual void clear (void);
00077   virtual CORBA::ULong max_event_size (void) const;
00078   virtual int can_match (const RtecEventComm::EventHeader& header) const;
00079   virtual int add_dependencies (const RtecEventComm::EventHeader& header,
00080                                 const TAO_EC_QOS_Info &qos_info);
00081   virtual void get_qos_info (TAO_EC_QOS_Info& qos_info);
00082 
00083 private:
00084   TAO_EC_Kokyu_Filter (const TAO_EC_Kokyu_Filter&);
00085   TAO_EC_Kokyu_Filter& operator= (const TAO_EC_Kokyu_Filter&);
00086 
00087   /// Initialize our RT_Info handle and dependencies
00088   void init_rt_info (void);
00089 
00090   /// Compute a new qos_info to push up.
00091   void compute_qos_info (TAO_EC_QOS_Info& qos_info);
00092 
00093 private:
00094   /// The RT_Info handle for this object
00095   RtecScheduler::handle_t rt_info_;
00096 
00097   /// Has the Scheduler been updated?
00098   int rt_info_computed_;
00099 
00100   /// Our operation name
00101   ACE_CString name_;
00102 
00103   /// The scheduler we are going to use
00104   RtecScheduler::Scheduler_var scheduler_;
00105 
00106   /// The implementation
00107   TAO_EC_Filter* body_;
00108 
00109   /// The RT_Info handle for the body
00110   RtecScheduler::handle_t body_info_;
00111 
00112   /// The RT_Info handle for the parent
00113   RtecScheduler::handle_t parent_info_;
00114 
00115   /// Required for the scheduling service
00116   RtecScheduler::Info_Type_t info_type_;
00117 };
00118 
00119 #include /**/ "ace/post.h"
00120 #endif /* TAO_EC_KOKYU_FILTER_H */

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