EC_Masked_Type_Filter.cpp

Go to the documentation of this file.
00001 // $Id: EC_Masked_Type_Filter.cpp 76589 2007-01-25 18:04:11Z elliott_c $
00002 
00003 #include "orbsvcs/Event/EC_Masked_Type_Filter.h"
00004 
00005 ACE_RCSID(Event, EC_Masked_Type_Filter, "$Id: EC_Masked_Type_Filter.cpp 76589 2007-01-25 18:04:11Z elliott_c $")
00006 
00007 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00008 
00009 TAO_EC_Masked_Type_Filter::
00010     TAO_EC_Masked_Type_Filter (CORBA::ULong source_mask,
00011                                CORBA::ULong type_mask,
00012                                CORBA::ULong source_value,
00013                                CORBA::ULong type_value)
00014   :  source_mask_ (source_mask),
00015      type_mask_ (type_mask),
00016      source_value_ (source_value),
00017      type_value_ (type_value)
00018 {
00019 }
00020 
00021 TAO_EC_Masked_Type_Filter::~TAO_EC_Masked_Type_Filter (void)
00022 {
00023 }
00024 
00025 TAO_EC_Filter::ChildrenIterator
00026 TAO_EC_Masked_Type_Filter::begin (void) const
00027 {
00028   return 0;
00029 }
00030 
00031 TAO_EC_Filter::ChildrenIterator
00032 TAO_EC_Masked_Type_Filter::end (void) const
00033 {
00034   return 0;
00035 }
00036 
00037 int
00038 TAO_EC_Masked_Type_Filter::size (void) const
00039 {
00040   return 0;
00041 }
00042 
00043 int
00044 TAO_EC_Masked_Type_Filter::filter (const RtecEventComm::EventSet& event,
00045                                    TAO_EC_QOS_Info& qos_info)
00046 {
00047   if (event.length () != 1)
00048     return 0;
00049 
00050   if ((event[0].header.type & this->type_mask_) != this->type_value_
00051       || (event[0].header.source & this->source_mask_) != this->source_value_)
00052     return 0;
00053 
00054   if (this->parent () != 0)
00055     {
00056       this->parent ()->push (event, qos_info);
00057     }
00058   return 1;
00059 }
00060 
00061 int
00062 TAO_EC_Masked_Type_Filter::filter_nocopy (RtecEventComm::EventSet& event,
00063                                           TAO_EC_QOS_Info& qos_info)
00064 {
00065   if (event.length () != 1)
00066     return 0;
00067 
00068   if ((event[0].header.type & this->type_mask_) != this->type_value_
00069       || (event[0].header.source & this->source_mask_) != this->source_value_)
00070     return 0;
00071 
00072   if (this->parent () != 0)
00073     {
00074       this->parent ()->push_nocopy (event, qos_info);
00075     }
00076   return 1;
00077 }
00078 
00079 void
00080 TAO_EC_Masked_Type_Filter::push (const RtecEventComm::EventSet &,
00081                                  TAO_EC_QOS_Info &)
00082 {
00083 }
00084 
00085 void
00086 TAO_EC_Masked_Type_Filter::push_nocopy (RtecEventComm::EventSet &,
00087                                         TAO_EC_QOS_Info &)
00088 {
00089 }
00090 
00091 void
00092 TAO_EC_Masked_Type_Filter::clear (void)
00093 {
00094 }
00095 
00096 CORBA::ULong
00097 TAO_EC_Masked_Type_Filter::max_event_size (void) const
00098 {
00099   return 1;
00100 }
00101 
00102 int
00103 TAO_EC_Masked_Type_Filter::can_match (
00104       const RtecEventComm::EventHeader& header) const
00105 {
00106   if ((header.type & this->type_mask_) == this->type_value_
00107       && (header.source & this->source_mask_) == this->source_value_)
00108     return 1;
00109 
00110   return 0;
00111 }
00112 
00113 int
00114 TAO_EC_Masked_Type_Filter::add_dependencies (
00115       const RtecEventComm::EventHeader&,
00116       const TAO_EC_QOS_Info &)
00117 {
00118   return 0;
00119 }
00120 
00121 TAO_END_VERSIONED_NAMESPACE_DECL

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