00001 // -*- C++ -*- 00002 00003 /** 00004 * @file EC_Masked_Type_Filter.h 00005 * 00006 * $Id: EC_Masked_Type_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_MASKED_TYPE_FILTER_H 00017 #define TAO_EC_MASKED_TYPE_FILTER_H 00018 #include /**/ "ace/pre.h" 00019 00020 #include "orbsvcs/Event/EC_Filter.h" 00021 00022 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00023 # pragma once 00024 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00025 00026 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00027 00028 /** 00029 * @class TAO_EC_Masked_Type_Filter 00030 * 00031 * @brief A masked type filter. 00032 * 00033 * This filter only accepts events whose type and/or source have 00034 * a given value when a bitmask is applied to them. 00035 * In short the filter checks that: 00036 * (event.header.type & type_mask) == type_value 00037 * and that: 00038 * (event.header.source & source_mask) == source_value 00039 */ 00040 class TAO_RTEvent_Serv_Export TAO_EC_Masked_Type_Filter : public TAO_EC_Filter 00041 { 00042 public: 00043 /// Constructor. 00044 TAO_EC_Masked_Type_Filter (CORBA::ULong source_mask, 00045 CORBA::ULong type_mask, 00046 CORBA::ULong source_value, 00047 CORBA::ULong type_value); 00048 00049 /// Destructor 00050 virtual ~TAO_EC_Masked_Type_Filter (void); 00051 00052 // = The TAO_EC_Filter methods, please check the documentation in 00053 // TAO_EC_Filter. 00054 virtual ChildrenIterator begin (void) const; 00055 virtual ChildrenIterator end (void) const; 00056 virtual int size (void) const; 00057 virtual int filter (const RtecEventComm::EventSet& event, 00058 TAO_EC_QOS_Info& qos_info); 00059 virtual int filter_nocopy (RtecEventComm::EventSet& event, 00060 TAO_EC_QOS_Info& qos_info); 00061 virtual void push (const RtecEventComm::EventSet& event, 00062 TAO_EC_QOS_Info& qos_info); 00063 virtual void push_nocopy (RtecEventComm::EventSet& event, 00064 TAO_EC_QOS_Info& qos_info); 00065 virtual void clear (void); 00066 virtual CORBA::ULong max_event_size (void) const; 00067 virtual int can_match (const RtecEventComm::EventHeader& header) const; 00068 virtual int add_dependencies (const RtecEventComm::EventHeader& header, 00069 const TAO_EC_QOS_Info &qos_info); 00070 00071 private: 00072 TAO_EC_Masked_Type_Filter (const TAO_EC_Masked_Type_Filter&); 00073 TAO_EC_Masked_Type_Filter& operator= (const TAO_EC_Masked_Type_Filter&); 00074 00075 private: 00076 /// The bitmasks 00077 CORBA::ULong source_mask_; 00078 CORBA::ULong type_mask_; 00079 00080 /// The values 00081 CORBA::ULong source_value_; 00082 CORBA::ULong type_value_; 00083 }; 00084 00085 TAO_END_VERSIONED_NAMESPACE_DECL 00086 00087 #include /**/ "ace/post.h" 00088 #endif /* TAO_EC_MASKED_TYPE_FILTER_H */