HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OH_OpInfo.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: OH_OpInfo.h (C++, OPUI library)
7  *
8  * COMMENTS:
9  * This structure is used to store info about nodes.
10  */
11 
12 #ifndef __OH_OpInfo__
13 #define __OH_OpInfo__
14 
15 #include "OH_API.h"
16 class OP_Node;
17 
18 #define OH_DEFINE_GET_FLAG( __FLAG__ ) { return myFlags & __FLAG__; }
19 #define OH_DEFINE_SET_FLAG( __FLAG__ ) \
20 { \
21  if (v) \
22  myFlags |= __FLAG__; \
23  else \
24  myFlags &= ~__FLAG__; \
25 }
26 
28 {
29 public:
30  OH_OpInfo(OP_Node *node);
31  virtual ~OH_OpInfo();
32 
33  OP_Node *getNode() { return myNode; }
34 
35  // The UpdatePending flag must be set by the OH_OpEventHandler derived
36  // class before calling ohRequestDeferredUpdate
37 
38  bool getUpdatePendingFlag()
39  OH_DEFINE_GET_FLAG( OH_UPDATE_PENDING )
40  void setUpdatePendingFlag(bool v)
41  OH_DEFINE_SET_FLAG( OH_UPDATE_PENDING )
42 
43  // This flag is provided for the use of derived classes. You
44  // would typically use it to flag any nodes that contain other
45  // nodes in which you are interested.
46  bool getContainerNodeFlag()
47  OH_DEFINE_GET_FLAG( OH_CONTAINER_NODE )
48  void setContainerNodeFlag(bool v)
49  OH_DEFINE_SET_FLAG( OH_CONTAINER_NODE )
50 
51  // This flag is provided for the use of derived classes as well.
52  // You could use it to flag the one node that is the top level
53  // node in which you are interested.
54  bool getMasterNodeFlag()
55  OH_DEFINE_GET_FLAG( OH_MASTER_NODE )
56  void setMasterNodeFlag(bool v)
57  OH_DEFINE_SET_FLAG( OH_MASTER_NODE )
58 protected:
59  enum
60  {
61  OH_UPDATE_PENDING = 0x1,
62  OH_MASTER_NODE = 0x2,
63  OH_CONTAINER_NODE = 0x4,
64  OH_OPINFO_BITLIMIT = 0x8 // This should always be last & largest
65  // subclasses can use the rest of myFlags by using
66  // OH_OPINFO_BITLIMIT, OH_OPINFO_BITLIMIT << 1, etc.
67  };
68 
69  unsigned int myFlags;
70 
71 private:
72  OP_Node *myNode;
73 };
74 
75 
77 {
78 public:
80  virtual ~OH_RefCountOpInfo();
81 
82  void bumpRefCount(int dir) { myRefCount += dir; }
83  int getRefCount() const { return myRefCount; }
84 
85 private:
86  int myRefCount;
87 };
88 
89 
90 #endif
#define OH_API
Definition: OH_API.h:10
const GLdouble * v
Definition: glcorearb.h:836
#define OH_DEFINE_GET_FLAG(__FLAG__)
Definition: OH_OpInfo.h:18
void bumpRefCount(int dir)
Definition: OH_OpInfo.h:82
OP_Node * getNode()
Definition: OH_OpInfo.h:33
int getRefCount() const
Definition: OH_OpInfo.h:83
#define OH_DEFINE_SET_FLAG(__FLAG__)
Definition: OH_OpInfo.h:19