VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
multiConfigVariable.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2013 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 
20 #include <vector>
21 
22 template <typename T>
24 {
25 public:
26 
28  DtMultiConfigVariable( DtVariableGroup* group, const DtString& aName,
29  const DtString& itemName, const DtString& aDescription = "",
31  bool isRequired = false, const DtString& aShortcut = "" );
32 
34  DtMultiConfigVariable( DtVariableGroup& group, const DtString& aName,
35  const DtString& itemName, const DtString& aDescription = "",
37  bool isRequired = false, const DtString& aShortcut = "" );
38 
41  const DtMultiConfigVariable<T>& orig );
42 
45  const DtMultiConfigVariable<T>& orig );
46 
48  virtual ~DtMultiConfigVariable();
49 
54 
57 
59  virtual void updateFromCommandLineArg();
60 
62  virtual void getEnvironmentSchemaType(DtEnvironment env,TypeSet& usedTypes) const;
63 
66 
68  virtual void updateFromEnvironment(DtEnvironment env);
69 
71  virtual DtString type() const;
72 
74  virtual bool isRequired() const;
75 
78 
79  virtual const DtString& name() const;
80  void setName( const DtString& name );
81 
83 
86 
87  const std::vector<T>& values() const;
88  void setValues(const std::vector<T>& aValue);
89  void addValue(T aValue);
90  void removeValue(T aValue);
91  void clearValues();
93 
95 
98 
99  const DtString& shortcut() const;
100  void setShortcut( const DtString& aShortcut );
101 
103 
104 protected:
105 
108 
109 protected:
110 
111  //Internal Type
112  typedef typename DtVarType<T>::ArgType ArgType;
113 
118 
120 
121  std::vector<T> myValues;
122 
123 };
124 
125 #include "multiConfigVariable.inl"
This file declares vlException.
virtual DtString type() const
Get the Var&#39;s type.
DtBoost::shared_ptr< DtEnvValue > DtEnvValueSP
Definition: envValue.h:29
Contains the DtBaseConfigVariable class declaration.
virtual bool isRequired() const
Get if the var is required.
void setName(const DtString &name)
DtString myItemName
Definition: multiConfigVariable.h:115
Bar Var class, used to access variables in a type neutral manner.
Definition: baseConfigVariable.h:31
DtString myName
Definition: multiConfigVariable.h:114
Definition: baseConfigVariable.h:42
const std::vector< T > & values() const
virtual void updateFromCommandLineArg()
Update the native value from the command line argument.
virtual void updateFromEnvironment(DtEnvironment env)
Update the native value from the Environment Value.
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
DtVariableGroup * myGroup
Definition: multiConfigVariable.h:119
bool myRequiredFlag
Definition: multiConfigVariable.h:117
DtString myShortcut
Definition: multiConfigVariable.h:116
DtVarType< T >::ArgType ArgType
Definition: multiConfigVariable.h:112
virtual const DtString & name() const
Get the Var&#39;s name.
void addValue(T aValue)
This file declares the class DtCmdLine::CmdLine.
DtMultiConfigVariable(DtVariableGroup *group, const DtString &aName, const DtString &itemName, const DtString &aDescription="", DtVariableScope aScope=DtBaseConfigVariable::DtScopeBoth, bool isRequired=false, const DtString &aShortcut="")
Var CTOR, using Group pointer.
virtual DtEnvValueSP getEnvironmentValue(DtEnvironment env)
Create an Environment Value from the native value.
void setShortcut(const DtString &aShortcut)
const DtString & shortcut() const
Contains DtEnvironment class.
Contains the DtVariableGroup class declaration.
DtVariableScope
Definition: baseConfigVariable.h:37
Represents a group of variables.
Definition: variableGroup.h:21
void removeValue(T aValue)
virtual ~DtMultiConfigVariable()
DTOR.
DtMultiConfigVariable & operator=(const DtMultiConfigVariable &other)
Assignment operator.
virtual void getCommandLineArg(DtCmdLine::CmdLine &)
Create a command line argument for the native value.
Instances of DtString are used to represent strings.
Definition: vlString.h:29
virtual void getEnvironmentSchemaType(DtEnvironment env, TypeSet &usedTypes) const
Get Environment schema type.
void setValues(const std::vector< T > &aValue)
std::vector< T > myValues
Definition: multiConfigVariable.h:121
Definition: multiConfigVariable.h:23

Document ID: Generated on Thu Sep 19 02:12:35 EDT 2024 from SVN revision 269601
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)