HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_ConnectorId.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: OP_Input.h (C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef _OP_ConnectorId_h_
13 #define _OP_ConnectorId_h_
14 
15 #include "OP_API.h"
16 
17 #include <string>
18 
20 {
21 public:
22 
24  {
25  set(id);
26  }
27 
29  {
30  reset();
31  }
32 
33  int toBaseType() const
34  {
35  return myId;
36  }
37 
38  void set(int id)
39  {
40  myId = id;
41  }
42 
43  void reset()
44  {
45  myId = -1;
46  }
47 
48  bool isValid() const
49  {
50  return myId >= 0;
51  }
52 
53  bool operator==(const OP_ConnectorId& other_id) const
54  {
55  return myId == other_id.myId;
56  }
57 
58  bool operator!=(const OP_ConnectorId& other_id) const
59  {
60  return !(*this == other_id);
61  }
62 
63  bool operator<(const OP_ConnectorId& other) const
64  {
65  return myId < other.myId;
66  }
67 
68 private:
69 
70  int myId;
71 };
72 
73 // For UT::ArraySet.
74 namespace UT
75 {
76 template <typename T>
77 struct DefaultClearer;
78 
79 template <>
81 {
82  static void clear(OP_ConnectorId &v) { v.reset(); }
83  static bool isClear(const OP_ConnectorId &v) { return !v.isValid(); }
85  {
86  new ((void *)p) OP_ConnectorId();
87  }
88  static const bool clearNeedsDestruction = false;
89 };
90 } // namespace UT
91 
92 #endif
GLuint id
Definition: glew.h:1679
static void clear(OP_ConnectorId &v)
int toBaseType() const
const GLdouble * v
Definition: glew.h:1391
GLboolean reset
Definition: glew.h:4959
bool isValid() const
bool operator!=(const OP_ConnectorId &other_id) const
static bool isClear(const OP_ConnectorId &v)
GLfloat GLfloat p
Definition: glew.h:16321
bool operator==(const OP_ConnectorId &other_id) const
static void clearConstruct(OP_ConnectorId *p)
#define OP_API
Definition: OP_API.h:10
bool operator<(const OP_ConnectorId &other) const
void set(int id)
OP_ConnectorId(int id)