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 <UT/UT_ValArray.h>
17 #include <OP/OP_Node.h>
18 
19 class OH_OpInfo;
20 
22 {
23 public:
25  ~OH_OpEventHandler() override;
26 
27  const char *ohClassName() const override
28  { return "OH_OpEventHandler"; }
29 
30  // These methods are used to add interests to the nodes that you
31  // want this object to watch. When you add an interest in a node,
32  // an OH_OpInfo corresponding to your node will be added to this
33  // OH gadget to track that node.
34  OH_OpInfo *ohAddOpInterest(OP_Node *node);
35  void ohRemoveOpInterest(OP_Node *node);
36  void ohRemoveOpInterest(long index);
37  void ohRemoveAllOpInterests();
38 
39  // You override this method so that you can respond to the events
40  // that are sent out by the nodes in which you are interested.
41  //
42  // Typically, your response is to use ohFindOpInfo to get the OH_OpInfo
43  // for the specified node, and then set the OpInfo's UpdatePendingFlag,
44  // and call ohRequestDeferredUpdate() on this object.
45  virtual void ohHandleOpEvent(OP_Node *node, OP_EventType type,
46  void *data) = 0;
47 
48  // OH_OpEventHandler overrides the base-class ohHandleDeferredUpdate
49  // so that it splits the "Update" task into a per Node operation and
50  // calls ohHandleDeferredNodeUpdate on each node. You will typically
51  // only override the latter.
52  void ohHandleDeferredUpdate() override;
53  virtual void ohHandleDeferredNodeUpdate(OH_OpInfo *nodeinfo);
54 
55  // These are the low-level OpInfo Management methods. You override
56  // ohCreateOpInfo to create a subclass of OH_OpInfo if you want to
57  // extend the OH_OpInfo structure.
58  virtual OH_OpInfo *ohCreateOpInfo(OP_Node *node);
60  { return myOpInfos.entries(); }
61  int ohFindOpInfoIndex(OP_Node *node);
62  OH_OpInfo *ohFindOpInfo(OP_Node *node);
64  { return myOpInfos(index); }
65 
66 
67 private:
68  static void ohHandleOpEvent(OP_Node *caller, void *callee,
69  OP_EventType type, void *data);
70 
71  UT_ValArray<OH_OpInfo *> myOpInfos;
72 };
73 
74 #endif
#define OH_API
Definition: OH_API.h:10
OH_OpInfo * ohGetOpInfo(long index)
GLuint index
Definition: glcorearb.h:786
const char * ohClassName() const override
OP_EventType
Definition: OP_Value.h:22
virtual void ohHandleDeferredUpdate()
type
Definition: core.h:1059
Definition: format.h:895