HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DOP_Output.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: DOP_Output.h ( DOP Library, C++)
7  *
8  * COMMENTS: Dynamics OPs. These are nodes which are used for setting
9  * up and controlling dynamic simulations.
10  */
11 
12 #ifndef __DOP_Output__
13 #define __DOP_Output__
14 
15 #include "DOP_API.h"
16 #include <SYS/SYS_Math.h>
17 #include <UT/UT_Array.h>
18 #include <SIM/SIM_ObjectArray.h>
19 
20 class DOP_Node;
21 
23 {
24 public:
25  DOP_Output(DOP_Node *node, int outputidx)
26  : myNode(node),
27  myOutputIdx(outputidx)
28  { }
30  : myNode(0),
31  myOutputIdx(-1)
32  { }
33  virtual ~DOP_Output()
34  { }
35 
36  bool operator==(const DOP_Output &cmp) const
37  {
38  return (myNode == cmp.myNode &&
39  myOutputIdx == cmp.myOutputIdx);
40  }
41 
42  DOP_Node *getNode() const
43  { return myNode; }
44  int getOutputIdx() const
45  { return myOutputIdx; }
46 
47 private:
48  DOP_Node *myNode;
49  int myOutputIdx;
50 
51  friend size_t hash_value(const DOP_Output &output);
52 };
53 
54 inline size_t hash_value(const DOP_Output &output)
55 {
56  return SYSpointerHash(output.myNode) ^ SYSwang_inthash(output.myOutputIdx);
57 }
58 
59 #endif
IMATH_HOSTDEVICE constexpr int cmp(T a, T b) IMATH_NOEXCEPT
Definition: ImathFun.h:84
#define DOP_API
Definition: DOP_API.h:10
virtual ~DOP_Output()
Definition: DOP_Output.h:33
bool operator==(const DOP_Output &cmp) const
Definition: DOP_Output.h:36
size_t hash_value(const DOP_Output &output)
Definition: DOP_Output.h:54
DOP_Output(DOP_Node *node, int outputidx)
Definition: DOP_Output.h:25
int getOutputIdx() const
Definition: DOP_Output.h:44
DOP_Node * getNode() const
Definition: DOP_Output.h:42
This is the base class for all DOP nodes.
Definition: DOP_Node.h:77