VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
baseConfigVariable.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 <mtl/environment.h>
13 #include <list>
14 #include <set>
15 
16 #ifdef DtUSE_UTILITIES_NAMESPACE
17 namespace DtUSE_UTILITIES_NAMESPACE
18 {
19 #endif
20 
21 namespace DtCmdLine
22 {
23  class Arg;
24  class CmdLine;
25 }
26 
27 class DtString;
28 class DtVariableGroup;
29 
32 {
33 public:
34 
35  typedef std::set<DtString> TypeSet;
36 
38  {
42  DtScopeBoth
43  };
44 
45 public:
46 
49  DtVariableScope aScope, const DtString& aDescription );
50 
52  virtual ~DtBaseConfigVariable();
53 
57  DtBaseConfigVariable& operator = ( const DtBaseConfigVariable& other );
58 
60  inline DtVariableScope scope() const
61  {
62  return myScope;
63  }
64 
65  inline const DtString& description() const
66  {
67  return myDescription;
68  }
69 
71  inline bool inConfigFile() const
72  {
73  return scope() == DtScopeConfigFile || scope() == DtScopeBoth;
74  }
75 
77  inline bool inCommandLine() const
78  {
79  return scope() == DtScopeCommandLine || scope() == DtScopeBoth;
80  }
81 
83  inline bool isSet() const { return mySetFlag; }
84 
85  //@name Abstract Interface
87 
89  virtual const DtString& name() const = 0;
90 
92  virtual bool isRequired() const = 0;
93 
96  virtual void getCommandLineArg( DtCmdLine::CmdLine& cmdLine ) = 0;
97 
100  virtual void updateFromCommandLineArg() = 0;
101 
105  virtual void getEnvironmentSchemaType( DtEnvironment env,
106  TypeSet& usedTypes ) const = 0;
107 
111  virtual DtEnvValueSP getEnvironmentValue( DtEnvironment env ) = 0;
112 
115  virtual void updateFromEnvironment( DtEnvironment env ) = 0;
116 
118  virtual DtString type() const = 0;
119 
121 
122  static DtEnvValueSP createSchemaDeclaration( DtEnvironment env,
123  const DtString& name,const DtString& type );
124 
126  static DtEnvValueSP createSimpleSchemaType( DtEnvironment env,
127  const DtString& typeName, const DtString& xsType );
128 
130  static DtEnvValueSP createComplexSchemaType( DtEnvironment env,
131  const DtString& typeName, bool ordered,
132  const std::list<DtBaseConfigVariable*>& members );
133 
134 protected:
135 
138 
139 protected:
140 
143 
145  bool mySetFlag;
146 
149 
152 
153 };
154 
155 #ifdef DtUSE_UTILITIES_NAMESPACE
156 }
157 #endif
bool inCommandLine() const
Is this var used in the command line.
Definition: baseConfigVariable.h:77
DtVariableScope scope() const
Get the scope of this variable.
Definition: baseConfigVariable.h:60
DtString myDescription
Stores a description of the variable.
Definition: baseConfigVariable.h:151
Definition: baseConfigVariable.h:41
Bar Var class, used to access variables in a type neutral manner.
Definition: baseConfigVariable.h:31
const DtString & description() const
Definition: baseConfigVariable.h:65
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
DtCmdLine::Arg * myArg
Stores the argument relating with this var.
Definition: baseConfigVariable.h:148
Definition: baseConfigVariable.h:40
bool mySetFlag
Stores a flag to determine if this var has been set yet.
Definition: baseConfigVariable.h:145
DtVariableScope myScope
My scope.
Definition: baseConfigVariable.h:142
bool inConfigFile() const
Is this var used in the config line.
Definition: baseConfigVariable.h:71
A virtual base class that defines the essential data for all arguments.
Definition: cmdArg.h:48
Contains DtEnvironment class.
DtVariableScope
Definition: baseConfigVariable.h:37
Represents a group of variables.
Definition: variableGroup.h:21
#define DT_DLL_MTL
Definition: vlMachineTypes.h:106
Definition: baseConfigVariable.h:39
Instances of DtString are used to represent strings.
Definition: vlString.h:36
bool isSet() const
Check to see if the value has been set.
Definition: baseConfigVariable.h:83
std::shared_ptr< DtEnvValue > DtEnvValueSP
Definition: envValue.h:29

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)