VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
configVariable.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2013 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include "baseConfigVariable.h"
13 #include "variableGroup.h"
14 #include "varType.h"
15 
16 #include <mtl/environment.h>
17 #include <vlutil/vlExceptions.h>
18 #include <cmdLine/cmdLine.h>
19 #include <matrix/vlVector.h>
20 
21 #ifdef DtUSE_UTILITIES_NAMESPACE
22 namespace DtUSE_UTILITIES_NAMESPACE
23 {
24 #endif
25 
26 class DtTaitBryan;
27 
29 DtDeclareVarType( int, int )
30 DtDeclareVarType( unsigned int, unsigned int )
31 DtDeclareVarType( double, double )
32 DtDeclareVarType( float, float )
34 DtDeclareVarType( bool, bool )
36 DtDeclareVarType( std::string, std::string );
37 
38 template <typename T>
40 {
41 public:
42 
44  DtConfigVariable( DtVariableGroup* group, const DtString& aName, T aDefault,
45  const DtString& aDescription = "", DtVariableScope aScope = DtBaseConfigVariable::DtScopeBoth,
46  bool isRequired = false, const DtString& aShortcut = "" );
47 
49  DtConfigVariable( DtVariableGroup& group, const DtString& aName, T aDefault,
50  const DtString& aDescription = "", DtVariableScope aScope = DtBaseConfigVariable::DtScopeBoth,
51  bool isRequired = false, const DtString& aShortcut = "" );
52 
55 
58 
60  virtual ~DtConfigVariable();
61 
64 
66  virtual void getCommandLineArg(DtCmdLine::CmdLine&);
67 
69  virtual void updateFromCommandLineArg();
70 
72  virtual void getEnvironmentSchemaType(DtEnvironment env,TypeSet& usedTypes) const;
73 
75  virtual DtEnvValueSP getEnvironmentValue(DtEnvironment env);
76 
78  virtual void updateFromEnvironment(DtEnvironment env);
79 
81  virtual DtString type() const;
82 
84  virtual bool isRequired() const;
85 
88 
89  virtual const DtString& name() const;
90  void setName(const DtString& name);
91 
93 
96 
97  T value() const;
98  void setValue(T aValue);
99 
101 
104  const DtString& shortcut() const;
105  void setShortcut(const DtString& aShortcut);
107 
110 
111  T defaultValue() const;
112  void setDefaultValue(T aDefault);
113 
115 
116  T* getInternalPtrValue();
117 
118 protected:
119 
121  DtConfigVariable( const DtConfigVariable& other );
122 
123 protected:
124 
125  //Internal Type
126  typedef typename DtVarType<T>::ArgType ArgType;
127 
131 
133 
136 };
137 
138 template <>
140 
141 template <>
143 
144 #include "configVariable.inl"
145 
146 #ifdef DtUSE_UTILITIES_NAMESPACE
147 }
148 #endif

Document ID: Generated on Mon Jun 22 21:18:40 EDT 2020 from SVN revision 213785
Copyright © 2005-2018 MAK Technologies. All Rights Reserved (www.mak.com)