summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroci <oci@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-04-09 19:56:26 +0000
committeroci <oci@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-04-09 19:56:26 +0000
commitcb766fb6df9d0217f395a8ca7e396e7f6458d24e (patch)
tree26f9c90ae88e0f85ca9a6c9afce9de9574e35a3e
parent5b1cc7f653042ffdde79f48b8499c10bd0cc1919 (diff)
downloadATCD-cb766fb6df9d0217f395a8ca7e396e7f6458d24e.tar.gz
Mon Apr 9 14:52:07 2001 Paul Calabrese <calabrese_p@ociweb.com>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a15
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.cpp48
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.h6
3 files changed, 64 insertions, 5 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index 358ec0c4076..3d9de5f7ce5 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,18 @@
+Mon Apr 9 14:52:07 2001 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.h:
+ * orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.cpp:
+
+ Improve the basic (default) filter builder so that it
+ works with logical AND and bitmask filters. Note that
+ the nesting of filters in the basic filter builder is
+ still limited, but this allows more of the "new" filters
+ to be used with this builder.
+
+ I tested this by running the Complex and Bitmask tests
+ from orbsvcs/tests/Event/Basic using the -ECFiltering basic
+ option.
+
Mon Apr 9 13:54:15 2001 Jeff Parsons <parsons@cs.wustl.edu>
* tao/IFR_Client/TAO_IFR_Client_Static.dsp:
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.cpp
index d715dcfdd0d..fc1ad7f3432 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.cpp
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.cpp
@@ -5,6 +5,7 @@
#include "EC_Type_Filter.h"
#include "EC_Conjunction_Filter.h"
#include "EC_Disjunction_Filter.h"
+#include "EC_And_Filter.h"
#include "EC_Negation_Filter.h"
#include "EC_Bitmask_Filter.h"
#include "EC_Masked_Type_Filter.h"
@@ -69,6 +70,20 @@ TAO_EC_Basic_Filter_Builder:: recursive_build (
}
return new TAO_EC_Disjunction_Filter (children, n);
}
+ else if (e.header.type == ACE_ES_LOGICAL_AND_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+ CORBA::ULong n = this->count_children (qos, pos);
+
+ TAO_EC_Filter** children;
+ ACE_NEW_RETURN (children, TAO_EC_Filter*[n], 0);
+ CORBA::ULong i = 0;
+ for (; i != n; ++i)
+ {
+ children[i] = this->recursive_build (supplier, qos, pos);
+ }
+ return new TAO_EC_And_Filter (children, n);
+ }
else if (e.header.type == ACE_ES_NEGATION_DESIGNATOR)
{
pos++; // Consume the designator
@@ -143,12 +158,41 @@ TAO_EC_Basic_Filter_Builder::
{
CORBA::ULong l = qos.dependencies.length ();
CORBA::ULong i;
+ int count = 0;
for (i = pos; i != l; ++i)
{
const RtecEventComm::Event& e = qos.dependencies[i].event;
if (e.header.type == ACE_ES_CONJUNCTION_DESIGNATOR
- || e.header.type == ACE_ES_DISJUNCTION_DESIGNATOR)
+ || e.header.type == ACE_ES_DISJUNCTION_DESIGNATOR
+ || e.header.type == ACE_ES_LOGICAL_AND_DESIGNATOR)
+ // We won't let these be nested by the basic filter builder.
+ // Assume these are the end of the group
break;
+ else if (e.header.type == ACE_ES_BITMASK_DESIGNATOR)
+ // These take up an extra element
+ i++;
+ else if (e.header.type == ACE_ES_MASKED_TYPE_DESIGNATOR)
+ // These take up two extra elements
+ i += 2;
+ else if (e.header.type == ACE_ES_NEGATION_DESIGNATOR) {
+ // These enclose another filter.
+ // Lets try to figure out how many elements the enclosed
+ // filter takes up (but don't count it in the group).
+ // Only allow basic filter types and bitmasks within
+ // a negation (when it is nested within a group).
+ // This is isn't perfect, but its about the best we can
+ // do without prefixes.
+ i++;
+ switch (qos.dependencies[i].event.header.type) {
+ case ACE_ES_BITMASK_DESIGNATOR:
+ i++;
+ break;
+ case ACE_ES_MASKED_TYPE_DESIGNATOR:
+ i += 2;
+ break;
+ }
+ }
+ count++;
}
- return i - pos;
+ return count;
}
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.h b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.h
index ea95c0f36e6..36f12e666de 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.h
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.h
@@ -32,8 +32,8 @@ class TAO_EC_Event_Channel;
* @brief Implement a builder for the fundamental filters.
*
* The basic filtering mechanisms in the Event channel
- * (source/type based filtering + disjunctions and conjunctions)
- * are constructed using this class.
+ * (source/type based filtering + disjunctions, conjunctions, logical ands,
+ * negations, and bitmasks) are constructed using this class.
*/
class TAO_RTEvent_Export TAO_EC_Basic_Filter_Builder : public TAO_EC_Filter_Builder
{
@@ -56,7 +56,7 @@ private:
CORBA::ULong& pos) const;
/// Count the number of children of the current node, i.e. until a
- /// conjunction or disjunction starts.
+ /// conjunction, disjunction, logical and, bitmask, or negation occurs.
CORBA::ULong count_children (RtecEventChannelAdmin::ConsumerQOS& qos,
CORBA::ULong pos) const;