VR-Link API Documentation for DIS
 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) 1992-2025 MAK Technologies, Inc
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  DtConfigVariable(DtVariableGroup& group, T aDefault,
56  const DtString& aDescription = "", DtVariableScope aScope = DtBaseConfigVariable::DtScopeBoth,
57  bool isRequired = false);
58 
61 
64 
66  virtual ~DtConfigVariable();
67 
70 
72  virtual void getCommandLineArg(DtCmdLine::CmdLine&);
73 
75  virtual void updateFromCommandLineArg();
76 
78  virtual void getEnvironmentSchemaType(DtEnvironment env,TypeSet& usedTypes) const;
79 
81  virtual DtEnvValueSP getEnvironmentValue(DtEnvironment env);
82 
84  virtual void updateFromEnvironment(DtEnvironment env);
85 
87  virtual DtString type() const;
88 
90  virtual bool isRequired() const;
91 
94 
95  virtual const DtString& name() const;
96  void setName(const DtString& name);
97 
99 
102 
103  T value() const;
104  void setValue(T aValue);
105 
107 
110  const DtString& shortcut() const;
111  void setShortcut(const DtString& aShortcut);
113 
114 
119  void setNameAndShortcut(const DtString& aName);
121 
124 
125  T defaultValue() const;
126  void setDefaultValue(T aDefault);
127 
129 
130  T* getInternalPtrValue();
131 
132 protected:
133 
135  DtConfigVariable( const DtConfigVariable& other );
136 
137 protected:
138 
139  //Internal Type
140  typedef typename DtVarType<T>::ArgType ArgType;
141 
145 
147 
150 };
151 
152 template <>
154 
155 template <>
157 
158 #include "configVariable.inl"
159 
160 #ifdef DtUSE_UTILITIES_NAMESPACE
161 }
162 #endif
Definition: configVariable.h:39
This file declares vlException.
Contains the DtBaseConfigVariable class declaration.
Bar Var class, used to access variables in a type neutral manner.
Definition: baseConfigVariable.h:31
DtTaitBryan & operator=(const DtTaitBryan &tait)
assignment operator
Definition: baseConfigVariable.h:42
DtDeclareVarType(std::string, std::string)
virtual void updateFromCommandLineArg()
Update the native value from the command line argument.
DtTaitBryans are used to represent orientation of an object, using a set of three Euler angles...
Definition: vlTaitBryan.h:43
The base class that manages the command line definition and passes along the parsing to the appropria...
Definition: cmdLine.h:64
A Flyweight class for manipulating objects and their hierarchy The DtEnvironment wraps a DtEnvValuSP ...
Definition: environment.h:29
std::set< DtString > TypeSet
Definition: baseConfigVariable.h:35
This file declares DtVector and DtVector32.
DtString myShortcut
Definition: configVariable.h:143
Definition: vlVector.h:224
T myDefault
Definition: configVariable.h:148
bool myRequiredFlag
Definition: configVariable.h:144
DtVariableGroup * myGroup
Definition: configVariable.h:146
DtString myName
Definition: configVariable.h:142
T myValue
Definition: configVariable.h:149
This file declares the class DtCmdLine::CmdLine.
virtual void getCommandLineArg(DtCmdLine::CmdLine &)
Create a command line argument for the native value.
Contains DtEnvironment class.
Contains the DtVariableGroup class declaration.
DtVariableScope
Definition: baseConfigVariable.h:37
Represents a group of variables.
Definition: variableGroup.h:21
#define DT_DLL_MTL
Definition: vlMachineTypes.h:106
Instances of DtString are used to represent strings.
Definition: vlString.h:36
std::shared_ptr< DtEnvValue > DtEnvValueSP
Definition: envValue.h:29
DtVarType< T >::ArgType ArgType
Definition: configVariable.h:140

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)