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