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 
39  /// Returns true if the the filter has the operator type id.
40  /// Returns false otherwise.
41  bool hasOpTypeId(OP_OpTypeId opType) const;
42 
43  /// Sets whether we should be checking a network's child op type
44  /// when determining if it is accepted by this filter.
45  /// This logic is used in isAcceptableNode().
46  void setCheckChildOpTypeId(bool doChildCheck)
47  { myDoChildCheck = doChildCheck; }
48 
49  /// Sets the mask for the operator type id.
50  void setFilterMask(OP_OpTypeId opType,
51  bool doMask=true);
52 
53  /// Resets the filter by setting each mask to the reset value.
54  void resetFilter(bool resetValue=true);
55 
56  /// Assignment operator.
57  OP_OpTypeIdFilter &operator=(const OP_OpTypeIdFilter &str);
58 
59 private:
60 
61  /// Operator type id masks.
62  /// If myOpTypeIdMasks[id] is true, then it means that nodes with
63  /// "id" type should be kept, otherwise, they should be filtered out.
64  bool myOpTypeIdMasks[NUM_MANAGERS];
65 
66  /// If true, then we also check a network's child op type
67  /// when determining whether a node is accepted by this filter.
68  bool myDoChildCheck;
69 };
70 
71 #endif
OP_OpTypeId
Definition: OP_OpTypeId.h:15
#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:1296