HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CMD_Variable.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: CMD library (C++)
7  *
8  * COMMENTS: Variable for the command library
9  *
10  */
11 
12 #ifndef __CMD_Variable_h__
13 #define __CMD_Variable_h__
14 
15 #include "CMD_API.h"
16 #include "CMD_SymbolList.h"
17 #include <UT/UT_Functor.h>
18 #include <iosfwd>
19 
20 
22 {
23 public:
25  ~CMD_VariableTable() override;
26 
27  bool hasVariable(const char *name)
28  { return hasValue(name); }
29 
30  bool getVariable(const char *name, UT_String &value)
31  { return getValue(name, value); }
32  bool getVariable(const char *name, fpreal32 &value)
33  { return getValue(name, value); }
34  bool getVariable(const char *name, fpreal64 &value)
35  { return getValue(name, value); }
36  bool getVariable(const char *name, int32 &value)
37  { return getValue(name, value); }
38  bool getVariable(const char *name, int64 &value)
39  { return getValue(name, value); }
40 
41  void setVariable(const char *name, const char *value,
42  bool xport = true)
43  { setValue(name, value, xport); }
44 
45  bool destroyVariable(const char *name)
46  {
47  return destroySymbol(name);
48  }
49  int getVariableNames(UT_StringArray &nameList,
50  int dirty=0);
51  int clearDirtyFlags();
52 
53  bool destroySymbol(const char *name) override;
54 
55 private:
56  void save(CMD_Manager *, std::ostream &, const char *loc="");
57  friend class CMD_Manager;
58 
59 private:
60  int myExportFlag;
61 };
62 
63 #endif
bool getValue(const char *name, UT_String &value)
int int32
Definition: SYS_Types.h:39
bool getVariable(const char *name, int64 &value)
Definition: CMD_Variable.h:38
bool destroyVariable(const char *name)
Definition: CMD_Variable.h:45
float fpreal32
Definition: SYS_Types.h:200
bool getVariable(const char *name, fpreal32 &value)
Definition: CMD_Variable.h:32
double fpreal64
Definition: SYS_Types.h:201
bool setValue(const char *name, const char *value, bool export_var)
bool getVariable(const char *name, UT_String &value)
Definition: CMD_Variable.h:30
long long int64
Definition: SYS_Types.h:116
GLuint const GLchar * name
Definition: glcorearb.h:786
#define CMD_API
Definition: CMD_API.h:10
bool hasVariable(const char *name)
Definition: CMD_Variable.h:27
virtual bool destroySymbol(const char *name)
Definition: core.h:1131
bool hasValue(const char *name) const
bool getVariable(const char *name, fpreal64 &value)
Definition: CMD_Variable.h:34
void setVariable(const char *name, const char *value, bool xport=true)
Definition: CMD_Variable.h:41
bool getVariable(const char *name, int32 &value)
Definition: CMD_Variable.h:36