HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_OpTypeIdFilter.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: OP_OpTypeIdFilter.h, OP Library (C++)
7  *
8  * COMMENTS: This is a filter class which filters nodes by their
9  * operator type ids.
10  *
11  */
12 
13 #ifndef __OP_OpTypeIdFilter_h__
14 #define __OP_OpTypeIdFilter_h__
15 
16 #include "OP_API.h"
17 
18 #include "OP_Node.h"
19 
20 /// This is a filter class which filters nodes by their
21 /// operator type ids.
23 {
24 public:
25 
26  /// Constructor.
28 
29  /// Copy constructor.
31 
32  /// Destructor.
33  virtual ~OP_OpTypeIdFilter();
34 
35  /// Returns true if the given node is accepted by the filter.
36  /// Returns false otherwise.
37  bool isAcceptableNode(OP_Node *node) const;
38  /// Returns true if the children of this node would be accepted.
39  bool isAcceptableNetwork(OP_Node *node) const;
40 
41  /// Returns true if the the filter has the operator type id.
42  /// Returns false otherwise.
43  bool hasOpTypeId(OP_OpTypeId opType) const;
44 
45  /// Sets whether we should be checking a network's child op type
46  /// when determining if it is accepted by this filter.
47  /// This logic is used in isAcceptableNode().
48  void setCheckChildOpTypeId(bool doChildCheck)
49  { myDoChildCheck = doChildCheck; }
50 
51  /// Sets the mask for the operator type id.
52  void setFilterMask(OP_OpTypeId opType,
53  bool doMask=true);
54 
55  /// Resets the filter by setting each mask to the reset value.
56  void resetFilter(bool resetValue=true);
57 
58  /// Only accepts real cops, not image filter lists.
59  void setOnlyRealCops(bool onlyreal) { myOnlyRealCops = onlyreal; }
60  bool onlyRealCops() const { return myOnlyRealCops; }
61 
62  /// Assignment operator.
64 
65 private:
66 
67  /// Operator type id masks.
68  /// If myOpTypeIdMasks[id] is true, then it means that nodes with
69  /// "id" type should be kept, otherwise, they should be filtered out.
70  bool myOpTypeIdMasks[NUM_MANAGERS];
71 
72  /// If true, then we also check a network's child op type
73  /// when determining whether a node is accepted by this filter.
74  bool myDoChildCheck = false;
75 
76  /// If true, we do not accept filter lists when we filter cops
77  bool myOnlyRealCops = false;
78 };
79 
80 #endif
bool onlyRealCops() const
void setOnlyRealCops(bool onlyreal)
Only accepts real cops, not image filter lists.
OP_OpTypeId
Definition: OP_OpTypeId.h:18
LeafData & operator=(const LeafData &)=delete
#define OP_API
Definition: OP_API.h:10
void setCheckChildOpTypeId(bool doChildCheck)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297