16 #ifndef __OMNETPP_CCONFIGURATION_H 17 #define __OMNETPP_CCONFIGURATION_H 22 #include "simkerneldefs.h" 32 #define CFGNAME_GENERAL "General" 39 #define CFGVAR_RUNID "runid" 40 #define CFGVAR_INIFILE "inifile" 41 #define CFGVAR_CONFIGNAME "configname" 42 #define CFGVAR_RUNNUMBER "runnumber" 43 #define CFGVAR_NETWORK "network" 44 #define CFGVAR_EXPERIMENT "experiment" 45 #define CFGVAR_MEASUREMENT "measurement" 46 #define CFGVAR_REPLICATION "replication" 47 #define CFGVAR_PROCESSID "processid" 48 #define CFGVAR_DATETIME "datetime" 49 #define CFGVAR_RESULTDIR "resultdir" 50 #define CFGVAR_REPETITION "repetition" 51 #define CFGVAR_SEEDSET "seedset" 52 #define CFGVAR_ITERATIONVARS "iterationvars" // without $repetition 53 #define CFGVAR_ITERATIONVARSF "iterationvarsf" // same, sanitized for use in file names 79 virtual const char *getKey()
const = 0;
80 virtual const char *getValue()
const = 0;
81 virtual const char *getBaseDirectory()
const = 0;
89 std::map<std::string,std::string> runAttrs;
90 std::string configBrief;
100 virtual const char *getConfigValue(
const char *key)
const = 0;
112 virtual const KeyValue& getConfigEntry(
const char *key)
const = 0;
119 virtual const char *getPerObjectConfigValue(
const char *objectFullPath,
const char *keySuffix)
const = 0;
131 virtual const KeyValue& getPerObjectConfigEntry(
const char *objectFullPath,
const char *keySuffix)
const = 0;
136 static bool parseBool(
const char *s,
const char *defaultValue,
bool fallbackValue=
false);
137 static long parseLong(
const char *s,
const char *defaultValue,
long fallbackValue=0);
138 static double parseDouble(
const char *s,
const char *unit,
const char *defaultValue,
double fallbackValue=0);
139 static std::string parseString(
const char *s,
const char *defaultValue,
const char *fallbackValue=
"");
140 static std::string parseFilename(
const char *s,
const char *baseDir,
const char *defaultValue);
141 static std::vector<std::string> parseFilenames(
const char *s,
const char *baseDir,
const char *defaultValue);
142 static std::string adjustPath(
const char *s,
const char *baseDir,
const char *defaultValue);
152 virtual const char *getAsCustom(
cConfigOption *option,
const char *fallbackValue=
nullptr)
const;
158 virtual bool getAsBool(
cConfigOption *option,
bool fallbackValue=
false)
const;
164 virtual long getAsInt(
cConfigOption *option,
long fallbackValue=0)
const;
170 virtual double getAsDouble(
cConfigOption *option,
double fallbackValue=0)
const;
176 virtual std::string getAsString(
cConfigOption *option,
const char *fallbackValue=
"")
const;
183 virtual std::string getAsFilename(
cConfigOption *option)
const;
191 virtual std::vector<std::string> getAsFilenames(
cConfigOption *option)
const;
208 virtual const char *getAsCustom(
const char *objectFullPath,
cConfigOption *option,
const char *fallbackValue=
nullptr)
const;
214 virtual bool getAsBool(
const char *objectFullPath,
cConfigOption *option,
bool fallbackValue=
false)
const;
220 virtual long getAsInt(
const char *objectFullPath,
cConfigOption *option,
long fallbackValue=0)
const;
226 virtual double getAsDouble(
const char *objectFullPath,
cConfigOption *option,
double fallbackValue=0)
const;
232 virtual std::string getAsString(
const char *objectFullPath,
cConfigOption *option,
const char *fallbackValue=
"")
const;
239 virtual std::string getAsFilename(
const char *objectFullPath,
cConfigOption *option)
const;
247 virtual std::vector<std::string> getAsFilenames(
const char *objectFullPath,
cConfigOption *option)
const;
255 virtual std::string getAsPath(
const char *objectFullPath,
cConfigOption *option)
const;
264 virtual const char *substituteVariables(
const char *value)
const = 0;
299 virtual const char *getFileName()
const = 0;
313 virtual void validate(
const char *ignorableConfigKeys=
nullptr)
const = 0;
320 virtual std::vector<std::string> getConfigNames() = 0;
327 virtual void activateConfig(
const char *configName,
int runNumber=0) = 0;
332 virtual std::string getConfigDescription(
const char *configName)
const = 0;
341 virtual std::vector<std::string> getBaseConfigs(
const char *configName)
const = 0;
348 virtual std::vector<std::string> getConfigChain(
const char * configName)
const = 0;
355 virtual int getNumRunsInConfig(
const char *configName)
const = 0;
366 virtual std::vector<RunInfo> unrollConfig(
const char *configName)
const = 0;
371 virtual const char *getActiveConfigName()
const = 0;
377 virtual int getActiveRunNumber()
const = 0;
390 virtual const char *getVariable(
const char *varname)
const = 0;
395 virtual std::vector<const char *> getIterationVariableNames()
const = 0;
401 virtual std::vector<const char *> getPredefinedVariableNames()
const = 0;
407 virtual const char *getVariableDescription(
const char *varname)
const = 0;
412 virtual void dump()
const = 0;
422 virtual std::vector<const char *> getMatchingConfigKeys(
const char *pattern)
const = 0;
430 virtual const char *getParameterValue(
const char *moduleFullPath,
const char *paramName,
bool hasDefaultValue)
const = 0;
442 virtual const KeyValue& getParameterEntry(
const char *moduleFullPath,
const char *paramName,
bool hasDefaultValue)
const = 0;
449 virtual std::vector<const char *> getKeyValuePairs()
const = 0;
457 virtual std::vector<const char *> getParameterKeyValuePairs()
const = 0;
466 virtual std::vector<const char *> getMatchingPerObjectConfigKeys(
const char *objectFullPath,
const char *keySuffixPattern)
const = 0;
473 virtual std::vector<const char *> getMatchingPerObjectConfigKeySuffixes(
const char *objectFullPath,
const char *keySuffixPattern)
const = 0;
Root of the OMNeT++ class hierarchy. cObject is a lightweight class without any data members...
Definition: cobject.h:58
Describes a configuration entry.
Definition: cconfiguration.h:76
Represents a configuration suitable for use with the Envir library.
Definition: cconfiguration.h:282
Describes a configuration option.
Definition: cconfigoption.h:34
Definition: cabstracthistogram.h:21
Struct used by unrollConfig() to return information.
Definition: cconfiguration.h:87
Represents the configuration, as accessed by the simulation kernel.
Definition: cconfiguration.h:70