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) 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
Definition: configVariable.h:39
This file declares vlException.
DtBoost::shared_ptr< DtEnvValue > DtEnvValueSP
Definition: envValue.h:29
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:129
Definition: vlVector.h:224
T myDefault
Definition: configVariable.h:134
bool myRequiredFlag
Definition: configVariable.h:130
DtVariableGroup * myGroup
Definition: configVariable.h:132
DtString myName
Definition: configVariable.h:128
T myValue
Definition: configVariable.h:135
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:29
DtVarType< T >::ArgType ArgType
Definition: configVariable.h:126

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)