HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CH_LocalValue.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: Channel Library (C++)
7  *
8  * COMMENTS: Value class for local variable values.
9  *
10 */
11 
12 #ifndef __CH_LocalValue_h__
13 #define __CH_LocalValue_h__
14 
15 #include "CH_API.h"
16 #include <SYS/SYS_Types.h>
17 
19 {
20 public:
21  CH_LocalValue(fpreal val = 0) { value.val = val; }
22  CH_LocalValue(void *ptr) { value.ptr = ptr; }
23  CH_LocalValue(char *str) { value.str = str; }
24 
25  fpreal getFloat() const { return value.val; }
26  void *getData() const { return value.ptr; }
27  char *getString() const { return value.str; }
28 
30  {
31  value.ptr = d.value.ptr;
32  return *this;
33  }
34  fpreal operator=(fpreal f) { value.val = f; return f; }
35  char *operator=(char *s) { value.str = s; return s; }
36  void *operator=(void *v) { value.ptr = v; return v; }
37  unsigned operator==(const CH_LocalValue &d)
38  {
39  return (value.ptr == d.value.ptr);
40  }
41 
42  // Public data
43  union {
44  void *ptr;
45  char *str;
47  } value;
48 };
49 
50 #endif
51 
void * getData() const
Definition: CH_LocalValue.h:26
const GLdouble * v
Definition: glcorearb.h:837
GLsizei const GLfloat * value
Definition: glcorearb.h:824
CH_LocalValue & operator=(const CH_LocalValue &d)
Definition: CH_LocalValue.h:29
GLdouble s
Definition: glad.h:3009
char * getString() const
Definition: CH_LocalValue.h:27
union CH_LocalValue::@4 value
unsigned operator==(const CH_LocalValue &d)
Definition: CH_LocalValue.h:37
GLfloat f
Definition: glcorearb.h:1926
CH_LocalValue(fpreal val=0)
Definition: CH_LocalValue.h:21
CH_LocalValue(void *ptr)
Definition: CH_LocalValue.h:22
fpreal operator=(fpreal f)
Definition: CH_LocalValue.h:34
CH_LocalValue(char *str)
Definition: CH_LocalValue.h:23
fpreal getFloat() const
Definition: CH_LocalValue.h:25
fpreal64 fpreal
Definition: SYS_Types.h:277
#define CH_API
Definition: CH_API.h:10
auto ptr(T p) -> const void *
Definition: format.h:2448
GLuint GLfloat * val
Definition: glcorearb.h:1608
Definition: core.h:1131
void * operator=(void *v)
Definition: CH_LocalValue.h:36
char * operator=(char *s)
Definition: CH_LocalValue.h:35