VR-Link API Documentation for DIS
configVar.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 ******************************************************************************/
5 
6 
8 
9 #ifndef configVar_H_
10 #define configVar_H_
11 
12 #include "baseConfigVar.h"
13 #include "varGroup.h"
14 #include "varType.h"
15 
16 #include <mtl/env.h>
17 #include <vlutil/vlExceptions.h>
18 #include <cmdLine/cmdLine.h>
19 
20 #ifdef DtUSE_UTILITIES_NAMESPACE
21 namespace DtUSE_UTILITIES_NAMESPACE
22 {
23 #endif
24 
25 
26 class DtVector;
27 class DtTaitBryan;
28 
30 DtDeclareVarType(int,int)
31 DtDeclareVarType(unsigned int,unsigned int)
32 DtDeclareVarType(double,double)
33 DtDeclareVarType(float,float)
35 DtDeclareVarType(bool,bool)
37 
38 template <typename T>
40 {
41 public:
42 
44  DtConfigVariable(DtVariableGroup* group, const DtString& aName,T aDefault,
45  const DtString& aDescription = "",
47  bool isRequired = false,
48  const DtString& aShortcut = "");
49 
51  DtConfigVariable(DtVariableGroup& group, const DtString& aName, T aDefault,
52  const DtString& aDescription = "",
54  bool isRequired = false,
55  const DtString& aShortcut = "");
56 
58  virtual ~DtConfigVariable();
59 
61  virtual void getCommandLineArg(DtCmdLine::CmdLine&);
62 
64  virtual void updateFromCommandLineArg();
65 
67  virtual void getEnvironmentSchemaType(DtEnvironment env,TypeSet& usedTypes) const;
68 
70  virtual DtEnvValueSP getEnvironmentValue(DtEnvironment env);
71 
73  virtual void updateFromEnvironment(DtEnvironment env);
74 
76  virtual DtString type() const;
77 
79  virtual bool isRequired() const;
80 
81  // \brief Get/Set the variable name.
83  virtual const DtString& name() const;
84 
85  void setName(const DtString& name);
87 
88  // \brief Get/Set the variable value.
90  T value() const;
91  void setValue(T aValue);
93 
94  // \brief Get/Set the variable's shortcut
96  const DtString& shortcut() const;
97  void setShortcut(const DtString& aShortcut);
99 
101 
102  T defaultValue() const;
103  void setDefaultValue(T aDefault);
105 
106  T* getInternalPtrValue();
107 
108 protected:
109 
110  //Internal Type
111  typedef typename DtVarType<T>::ArgType ArgType;
112 
116 
118 
121 };
122 
123 template <>
125 
126 template <>
128 
129 #include "configVar.inl"
130 
131 #ifdef DtUSE_UTILITIES_NAMESPACE
132 }
133 #endif
134 
135 #endif

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)