HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OH_OpEventHandler.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_OpEventHandler.h ( Op Handler Library, C++)
7  *
8  * COMMENTS: Read the documentation in DOCS/index.html
9  */
10 
11 #ifndef __OH_OpEventHandler__
12 #define __OH_OpEventHandler__
13 
14 #include "OH_API.h"
15 #include "OH_EventHandler.h"
16 #include <OP/OP_Value.h>
17 #include <UT/UT_Array.h>
18 #include <UT/UT_NonCopyable.h>
19 #include <SYS/SYS_Types.h>
20 
21 class OH_OpInfo;
22 class OP_Node;
23 
25 {
26 public:
28  ~OH_OpEventHandler() override;
29 
31 
32  const char *ohClassName() const override
33  { return "OH_OpEventHandler"; }
34 
35  // These methods are used to add interests to the nodes that you
36  // want this object to watch. When you add an interest in a node,
37  // an OH_OpInfo corresponding to your node will be added to this
38  // OH gadget to track that node.
39  OH_OpInfo *ohAddOpInterest(OP_Node *node);
40  void ohRemoveOpInterest(OP_Node *node);
41  void ohRemoveOpInterest(exint index);
42  void ohRemoveAllOpInterests();
43 
44  // You override this method so that you can respond to the events
45  // that are sent out by the nodes in which you are interested.
46  //
47  // Typically, your response is to use ohFindOpInfo to get the OH_OpInfo
48  // for the specified node, and then set the OpInfo's UpdatePendingFlag,
49  // and call ohRequestDeferredUpdate() on this object.
50  virtual void ohHandleOpEvent(OP_Node *node, OP_EventType type,
51  void *data) = 0;
52 
53  // OH_OpEventHandler overrides the base-class ohHandleDeferredUpdate
54  // so that it splits the "Update" task into a per Node operation and
55  // calls ohHandleDeferredNodeUpdate on each node. You will typically
56  // only override the latter.
57  void ohHandleDeferredUpdate() override;
58  virtual void ohHandleDeferredNodeUpdate(OH_OpInfo *nodeinfo);
59 
60  // These are the low-level OpInfo Management methods. You override
61  // ohCreateOpInfo to create a subclass of OH_OpInfo if you want to
62  // extend the OH_OpInfo structure.
63  virtual OH_OpInfo *ohCreateOpInfo(OP_Node *node);
65  { return myOpInfos.entries(); }
66  int ohFindOpInfoIndex(OP_Node *node);
67  OH_OpInfo *ohFindOpInfo(OP_Node *node);
69  { return myOpInfos(index); }
70 
71 
72 private:
73  static void ohHandleOpEvent(OP_Node *caller, void *callee,
74  OP_EventType type, void *data);
75 
76  UT_Array<OH_OpInfo *> myOpInfos;
77 };
78 
79 #endif
#define OH_API
Definition: OH_API.h:10
OH_OpInfo * ohGetOpInfo(exint index)
int64 exint
Definition: SYS_Types.h:125
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLuint index
Definition: glcorearb.h:786
OP_EventType
Definition: OP_Value.h:22
virtual void ohHandleDeferredUpdate()
Definition: format.h:1821