![]() |
VR-Link API Documentation for HLA Evolved
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 00006 #ifndef multiVar_H_ 00007 #define multiVar_H_ 00008 00009 #include "baseConfigVar.h" 00010 #include "varGroup.h" 00011 #include "varType.h" 00012 00013 #include <mtl/env.h> 00014 #include <vlutil/vlExceptions.h> 00015 #include <cmdLine/cmdLine.h> 00016 00017 #include <vector> 00018 00019 template <typename T> 00020 class DtMultiConfigVariable : public DtBaseConfigVariable 00021 { 00022 public: 00023 00025 DtMultiConfigVariable(DtVariableGroup* group, const DtString& aName, 00026 const DtString& itemName, const DtString& aDescription = "", 00027 DtVariableScope aScope = DtBaseConfigVariable::DtScopeBoth, 00028 bool isRequired = false, 00029 const DtString& aShortcut = ""); 00030 00032 DtMultiConfigVariable(DtVariableGroup& group, const DtString& aName, 00033 const DtString& itemName, const DtString& aDescription = "", 00034 DtVariableScope aScope = DtBaseConfigVariable::DtScopeBoth, 00035 bool isRequired = false, 00036 const DtString& aShortcut = ""); 00037 00039 virtual ~DtMultiConfigVariable(); 00040 00042 virtual void getCommandLineArg(DtCmdLine::CmdLine&); 00043 00045 virtual void updateFromCommandLineArg(); 00046 00048 virtual void getEnvironmentSchemaType(DtEnvironment env,TypeSet& usedTypes) const; 00049 00051 virtual DtEnvValueSP getEnvironmentValue(DtEnvironment env); 00052 00054 virtual void updateFromEnvironment(DtEnvironment env); 00055 00057 virtual DtString type() const; 00058 00060 virtual bool isRequired() const; 00061 00062 // \brief Get/Set the variable name. 00064 virtual const DtString& name() const; 00065 00066 void setName(const DtString& name); 00068 00069 // \brief Get/Set the variable value. 00071 const std::vector<T>& values() const; 00072 void setValues(const std::vector<T>& aValue); 00073 void addValue(T aValue); 00074 void removeValue(T aValue); 00076 00077 // \brief Get/Set the variable's shortcut 00079 const DtString& shortcut() const; 00080 void setShortcut(const DtString& aShortcut); 00082 00083 protected: 00084 00085 //Internal Type 00086 typedef typename DtVarType<T>::ArgType ArgType; 00087 00088 DtString myName; 00089 DtString myItemName; 00090 DtString myShortcut; 00091 bool myRequiredFlag; 00092 00093 DtVariableGroup* myGroup; 00094 00095 std::vector<T> myValues; 00096 }; 00097 00098 #include "multiVar.inl" 00099 00100 #endif 00101 00102 00103 //#endif