This file is indexed.

/usr/include/omniEvents/Filter.h is in libomnievents-dev 1:2.6.2-2ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
//                            Package   : omniEvents
// Filter.h                   Created   : 2004/04/30
//                            Author    : Alex Tingle
//
//    Copyright (C) 2004 Alex Tingle.
//
//    This file is part of the omniEvents application.
//
//    omniEvents is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    omniEvents is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with this library; if not, write to the Free Software
//    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//

#ifndef OMNIEVENTS__FILTER_H
#define OMNIEVENTS__FILTER_H

#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif

#include "Orb.h"

#include <string.h>

#ifdef HAVE_IOSTREAM
#  include <iostream>
#else
#  include <iostream.h>
#endif

#ifdef HAVE_STD_IOSTREAM
using namespace std;
#endif


namespace OmniEvents {

/** Event filter interface. */
class Filter
{
public:
  Filter(){}
  virtual ~Filter(){}

  /** Returns TRUE if the event passes the filter and FALSE if the event should
   * be discarded. Called by filter() once for each event.
   */
  virtual bool keep(const CORBA::Any& event) const =0;

  virtual void output(ostream& os) const =0;
};

/** The most basic event filter allows only events of a certain CORBA TCKind to
 * pass. Usually used to filter basic types.
 */
class FilterByTCKind: public Filter
{
public:
  FilterByTCKind(CORBA::TCKind kind):_kind(kind){}
  virtual ~FilterByTCKind(){}
  bool keep(const CORBA::Any& event) const
  {
    CORBA::TypeCode_var tc=event.type();
    return( tc->kind()==_kind );
  }
  void output(ostream& os) const { os<<"\n FilterKind="<<_kind; }
private:
  CORBA::TCKind _kind;
};

/** Allows only events of a certain CORBA RepositoryId to pass. Only passes
 *  events whose type matches exactly.
 */
class FilterByRepositoryId: public Filter
{
public:
  FilterByRepositoryId(const char* rid):_rid(rid){}
  virtual ~FilterByRepositoryId(){}
  bool keep(const CORBA::Any& event) const;
  void output(ostream& os) const { os<<"\n FilterId="<<_rid; }
private:
  CORBA::RepositoryId_var _rid;
};

}; // end namespace OmniEvents

#endif // OMNIEVENTS__FILTER_H