HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Thing.h
Go to the documentation of this file.
1 #ifndef __UT_Thing__
2 #define __UT_Thing__
3 
4 #include "UT_API.h"
5 
6 #include <SYS/SYS_Deprecated.h>
7 
9 
11 {
12 public:
13  UT_Thing(void *v=0) { value.voidp = v; }
14  UT_Thing(long v) { value.longv = v; }
15 
16  operator void *() const { return value.voidp; }
17  operator long () const { return value.longv; }
18 
19  template <typename T> T *asPointer() const { return (T *)value.voidp; }
20  long asLong() const { return value.longv; }
21 
22  UT_Thing &operator=(void *v) { value.voidp = v; return *this; }
23  UT_Thing &operator=(long v) { value.longv = v; return *this; }
24 
25  UT_Thing &operator=(const UT_Thing &v)
26  {
27  value.voidp = v.value.voidp;
28  return *this;
29  }
30 
31  union {
32  void *voidp;
33  long longv;
34  } value;
35 
36 private:
37  // This is to prevent accidental assignments of a UT_Thing * to a UT_Thing
38  // parameter, which will happily compile but produce incorrect results.
39  UT_Thing(UT_Thing *) { ; }
40 };
41 
43 
44 #endif
union UT_Thing::@714 value
#define SYS_DEPRECATED(__V__)
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
Definition: thread.h:632
const GLdouble * v
Definition: glcorearb.h:837
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
GLsizei const GLfloat * value
Definition: glcorearb.h:824
#define UT_API
Definition: UT_API.h:14
void * voidp
Definition: UT_Thing.h:32
UT_Thing(void *v=0)
Definition: UT_Thing.h:13
long longv
Definition: UT_Thing.h:33
UT_Thing & operator=(long v)
Definition: UT_Thing.h:23
UT_Thing & operator=(const UT_Thing &v)
Definition: UT_Thing.h:25
UT_Thing(long v)
Definition: UT_Thing.h:14
long asLong() const
Definition: UT_Thing.h:20
T * asPointer() const
Definition: UT_Thing.h:19
UT_Thing & operator=(void *v)
Definition: UT_Thing.h:22