#include <EC_Masked_Type_Filter.h>
Inheritance diagram for TAO_EC_Masked_Type_Filter:
This filter only accepts events whose type and/or source have a given value when a bitmask is applied to them. In short the filter checks that: (event.header.type & type_mask) == type_value and that: (event.header.source & source_mask) == source_value
Definition at line 40 of file EC_Masked_Type_Filter.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_EC_Masked_Type_Filter::TAO_EC_Masked_Type_Filter | ( | CORBA::ULong | source_mask, | |
CORBA::ULong | type_mask, | |||
CORBA::ULong | source_value, | |||
CORBA::ULong | type_value | |||
) |
Constructor.
Definition at line 10 of file EC_Masked_Type_Filter.cpp.
00014 : source_mask_ (source_mask), 00015 type_mask_ (type_mask), 00016 source_value_ (source_value), 00017 type_value_ (type_value) 00018 { 00019 }
TAO_EC_Masked_Type_Filter::~TAO_EC_Masked_Type_Filter | ( | void | ) | [virtual] |
TAO_EC_Masked_Type_Filter::TAO_EC_Masked_Type_Filter | ( | const TAO_EC_Masked_Type_Filter & | ) | [private] |
int TAO_EC_Masked_Type_Filter::add_dependencies | ( | const RtecEventComm::EventHeader & | header, | |
const TAO_EC_QOS_Info & | qos_info | |||
) | [virtual] |
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 114 of file EC_Masked_Type_Filter.cpp.
TAO_EC_Filter::ChildrenIterator TAO_EC_Masked_Type_Filter::begin | ( | void | ) | const [virtual] |
STL-like iterators Filters follow the Composite pattern. All filters expose the same interface as if they all had children, but for simple filters the iterators return an empty range.
Reimplemented from TAO_EC_Filter.
Definition at line 26 of file EC_Masked_Type_Filter.cpp.
int TAO_EC_Masked_Type_Filter::can_match | ( | const RtecEventComm::EventHeader & | header | ) | const [virtual] |
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 103 of file EC_Masked_Type_Filter.cpp.
References RtecEventComm::EventHeader::source, and RtecEventComm::EventHeader::type.
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 }
void TAO_EC_Masked_Type_Filter::clear | ( | void | ) | [virtual] |
Clear any saved state, must reset and assume no events have been received.
Implements TAO_EC_Filter.
Definition at line 92 of file EC_Masked_Type_Filter.cpp.
TAO_EC_Filter::ChildrenIterator TAO_EC_Masked_Type_Filter::end | ( | void | ) | const [virtual] |
int TAO_EC_Masked_Type_Filter::filter | ( | const RtecEventComm::EventSet & | event, | |
TAO_EC_QOS_Info & | qos_info | |||
) | [virtual] |
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 44 of file EC_Masked_Type_Filter.cpp.
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 }
int TAO_EC_Masked_Type_Filter::filter_nocopy | ( | RtecEventComm::EventSet & | event, | |
TAO_EC_QOS_Info & | qos_info | |||
) | [virtual] |
Implements TAO_EC_Filter.
Definition at line 62 of file EC_Masked_Type_Filter.cpp.
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 }
CORBA::ULong TAO_EC_Masked_Type_Filter::max_event_size | ( | void | ) | const [virtual] |
Returns the maximum size of the events pushed by this filter.
Implements TAO_EC_Filter.
Definition at line 97 of file EC_Masked_Type_Filter.cpp.
TAO_EC_Masked_Type_Filter& TAO_EC_Masked_Type_Filter::operator= | ( | const TAO_EC_Masked_Type_Filter & | ) | [private] |
void TAO_EC_Masked_Type_Filter::push | ( | const RtecEventComm::EventSet & | event, | |
TAO_EC_QOS_Info & | qos_info | |||
) | [virtual] |
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 80 of file EC_Masked_Type_Filter.cpp.
void TAO_EC_Masked_Type_Filter::push_nocopy | ( | RtecEventComm::EventSet & | event, | |
TAO_EC_QOS_Info & | qos_info | |||
) | [virtual] |
int TAO_EC_Masked_Type_Filter::size | ( | void | ) | const [virtual] |
Definition at line 78 of file EC_Masked_Type_Filter.h.
Definition at line 82 of file EC_Masked_Type_Filter.h.