summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Event/EC_Negation_Filter.cpp
blob: 073ebbba692ef301a516c37e69b55e4b8b373dcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// $Id$

#include "EC_Negation_Filter.h"

#if ! defined (__ACE_INLINE__)
#include "EC_Negation_Filter.i"
#endif /* __ACE_INLINE__ */

ACE_RCSID(Event, EC_Negation_Filter, "$Id$")

TAO_EC_Negation_Filter::
    TAO_EC_Negation_Filter (TAO_EC_Filter* child)
  :  child_ (child)
{
  this->adopt_child (this->child_);
}

TAO_EC_Negation_Filter::~TAO_EC_Negation_Filter (void)
{
  delete this->child_;
}

TAO_EC_Filter::ChildrenIterator
TAO_EC_Negation_Filter::begin (void) const
{
  return ACE_const_cast(TAO_EC_Filter**,&this->child_);
}

TAO_EC_Filter::ChildrenIterator
TAO_EC_Negation_Filter::end (void) const
{
  return ACE_const_cast(TAO_EC_Filter**,&this->child_) + 1;
}

ACE_INLINE int
TAO_EC_Negation_Filter::size (void) const
{
  return 1;
}

int
TAO_EC_Negation_Filter::filter (const RtecEventComm::EventSet& event,
                                TAO_EC_QOS_Info& qos_info,
                                CORBA::Environment& ACE_TRY_ENV)
{
  int n =
    this->child_->filter (event, qos_info, ACE_TRY_ENV);
  ACE_CHECK_RETURN (0);
  if (this->parent () != 0 && n == 0)
    {
      this->parent ()->push (event, qos_info, ACE_TRY_ENV);
      ACE_CHECK_RETURN (0);
    }
  return 1;
}

int
TAO_EC_Negation_Filter::filter_nocopy (RtecEventComm::EventSet& event,
                                   TAO_EC_QOS_Info& qos_info,
                                   CORBA::Environment& ACE_TRY_ENV)
{
  int n =
    this->child_->filter_nocopy (event, qos_info, ACE_TRY_ENV);
  ACE_CHECK_RETURN (0);
  if (this->parent () != 0 && n == 0)
    {
      this->parent ()->push_nocopy (event, qos_info, ACE_TRY_ENV);
      ACE_CHECK_RETURN (0);
    }
  return 1;
}

void
TAO_EC_Negation_Filter::push (const RtecEventComm::EventSet&,
                                 TAO_EC_QOS_Info&,
                                 CORBA::Environment&)
{
}

void
TAO_EC_Negation_Filter::push_nocopy (RtecEventComm::EventSet&,
                                        TAO_EC_QOS_Info&,
                                        CORBA::Environment&)
{
}

void
TAO_EC_Negation_Filter::clear (void)
{
  this->child_->clear ();
}

CORBA::ULong
TAO_EC_Negation_Filter::max_event_size (void) const
{
  return this->child_->max_event_size ();
}

int
TAO_EC_Negation_Filter::can_match (
      const RtecEventComm::EventHeader& header) const
{
  return !this->child_->can_match (header);
}

int
TAO_EC_Negation_Filter::add_dependencies (
      const RtecEventComm::EventHeader&,
      const TAO_EC_QOS_Info &,
      CORBA::Environment &)
{
  return 0;
}