OMNeT++ Simulation Library
6.0.3
|
#include <cconfiguration.h>
Represents the configuration, as accessed by the simulation kernel.
This class provides access to configuration data for components such as scheduler classes, parallel simulation algorithms, etc. Model code (simple modules) should not directly read the configuration, they are expected to rely on module parameters for input.
This class logically belongs to the cEnvir facade, and the configuration instance can be accessed with getEnvir()->getConfig().
Classes | |
class | KeyValue |
Describes a configuration entry. More... | |
struct | RunInfo |
Struct used by unrollConfig() to return information. More... | |
Public Member Functions | |
String-based getters for configuration options | |
virtual const char * | getConfigValue (const char *key) const =0 |
virtual const KeyValue & | getConfigEntry (const char *key) const =0 |
virtual const char * | getPerObjectConfigValue (const char *objectFullPath, const char *keySuffix) const =0 |
virtual const KeyValue & | getPerObjectConfigEntry (const char *objectFullPath, const char *keySuffix) const =0 |
Getters for configuration options | |
virtual const char * | getConfigValue (cConfigOption *option, const char *fallbackValue=nullptr) const |
virtual const char * | getAsCustom (cConfigOption *option, const char *fallbackValue=nullptr) const |
virtual bool | getAsBool (cConfigOption *option, bool fallbackValue=false) const |
virtual long | getAsInt (cConfigOption *option, long fallbackValue=0) const |
virtual double | getAsDouble (cConfigOption *option, double fallbackValue=0) const |
virtual std::string | getAsString (cConfigOption *option, const char *fallbackValue="") const |
virtual std::string | getAsFilename (cConfigOption *option) const |
virtual std::vector< std::string > | getAsFilenames (cConfigOption *option) const |
virtual std::string | getAsPath (cConfigOption *option) const |
Getters for per-object configuration options | |
virtual const char * | getPerObjectConfigValue (const char *objectFullPath, cConfigOption *option, const char *fallbackValue=nullptr) const |
virtual const char * | getAsCustom (const char *objectFullPath, cConfigOption *option, const char *fallbackValue=nullptr) const |
virtual bool | getAsBool (const char *objectFullPath, cConfigOption *option, bool fallbackValue=false) const |
virtual long | getAsInt (const char *objectFullPath, cConfigOption *option, long fallbackValue=0) const |
virtual double | getAsDouble (const char *objectFullPath, cConfigOption *option, double fallbackValue=0) const |
virtual std::string | getAsString (const char *objectFullPath, cConfigOption *option, const char *fallbackValue="") const |
virtual std::string | getAsFilename (const char *objectFullPath, cConfigOption *option) const |
virtual std::vector< std::string > | getAsFilenames (const char *objectFullPath, cConfigOption *option) const |
virtual std::string | getAsPath (const char *objectFullPath, cConfigOption *option) const |
Other methods | |
virtual const char * | substituteVariables (const char *value) const =0 |
Public Member Functions inherited from cObject | |
cObject () | |
cObject (const cObject &other)=default | |
virtual | ~cObject () |
virtual const char * | getClassName () const |
virtual const char * | getName () const |
bool | isName (const char *s) const |
virtual const char * | getFullName () const |
virtual std::string | getFullPath () const |
virtual std::string | getClassAndFullName () const |
virtual std::string | getClassAndFullPath () const |
const cObject * | getThisPtr () const |
virtual std::string | str () const |
virtual std::ostream & | printOn (std::ostream &os) const |
virtual cObject * | dup () const |
virtual void | parsimPack (cCommBuffer *buffer) const |
virtual void | parsimUnpack (cCommBuffer *buffer) |
virtual cObject * | getOwner () const |
virtual bool | isOwnedObject () const |
virtual bool | isSoftOwner () const |
virtual void | forEachChild (cVisitor *v) |
cObject * | findObject (const char *name, bool deep=true) |
virtual cClassDescriptor * | getDescriptor () const |
void | copyNotSupported () const |
Additional Inherited Members | |
Protected Member Functions inherited from cObject | |
virtual void | take (cOwnedObject *obj) |
virtual void | drop (cOwnedObject *obj) |
void | dropAndDelete (cOwnedObject *obj) |
|
pure virtual |
Returns the value for the given key in the configuration. The key should not contain dots or wildcard characters. Returns nullptr if key is not found.
|
pure virtual |
Returns the entry for the given key in the configuration. If the key is not found, a special KeyValue object is returned where both key and value are nullptr.
The lifetime of the returned object might be limited, so clients should not store references to it. Copying the object is not allowed either, because KeyValue is a polymorphic type (object slicing!).
|
pure virtual |
Returns the value for the key "<objectFullPath>.<keySuffix>" in the configuration. keySuffix should not contain dots or wildcard characters. Example keySuffix: "vector-recording-intervals". Returns nullptr if key is not found.
|
pure virtual |
Returns the entry for the key "<objectFullPath>.<keySuffix>" in the configuration. keySuffix should not contain dots or wildcard characters. Example keySuffix: "vector-recording-intervals". If the key is not found, a special KeyValue object is returned where both key and value are nullptr.
The lifetime of the returned object might be limited, so clients should not store references to it. Copying the object is not allowed either, because KeyValue is a polymorphic type (object slicing!).
|
virtual |
Returns the value of the configuration option in string form, independent of its type. fallbackValue is returned if the value is not specified in the configuration, and there is no default value.
|
virtual |
Returns the value of the configuration option without any conversion. The option's type must be CFG_CUSTOM. fallbackValue is returned if the value is not specified in the configuration, and there is no default value.
|
virtual |
Returns the value of the configuration option as bool. The option's type must be CFG_BOOL. fallbackValue is returned if the value is not specified in the configuration, and there is no default value.
|
virtual |
Returns the value of the configuration option as long. The option's type must be CFG_INT. fallbackValue is returned if the value is not specified in the configuration, and there is no default value.
|
virtual |
Returns the value of the configuration option as double. The option's type must be CFG_DOUBLE. fallbackValue is returned if the value is not specified in the configuration, and there is no default value.
|
virtual |
Returns the value of the configuration option as string. The option's type must be CFG_STRING. fallbackValue is returned if the value is not specified in the configuration, and there is no default value.
|
virtual |
Returns the value of the configuration option as a file path. The option's type must be CFG_FILENAME. If it is relative path, then it will be converted to an absolute path, using the base directory (see the getBaseDirectoryFor() method).
|
virtual |
Returns the value of the configuration option as a list of file paths (file or directory names, possibly containing wildcards), separated by spaces. The option's type must be CFG_FILENAMES. The relative paths in the list will be converted to absolute, using the base directory (see getBaseDirectoryFor() method).
|
virtual |
Returns the value of the configuration option as a list of directory names, possibly containing wildcards, and separated by ";" (Windows), or ":" or ";" (other OSes). The option's type must be CFG_PATH. The relative names in the list will be converted to absolute, using the base directory (see getBaseDirectoryFor() method).
|
virtual |
Returns a per-object config value in string form, independent of its type. fallbackValue is returned if the value is not specified in the configuration, and there is no default value.
|
virtual |
Returns a per-object config value without any conversion. The option's type must be CFG_CUSTOM. fallbackValue is returned if the value is not specified in the configuration, and there is no default value.
|
virtual |
Returns a per-object config value as bool. The option's type must be CFG_BOOL. fallbackValue is returned if the value is not specified in the configuration, and there is no default value.
|
virtual |
Returns a per-object config value as long. The option's type must be CFG_INT. fallbackValue is returned if the value is not specified in the configuration, and there is no default value.
|
virtual |
Returns a per-object config value as double. The option's type must be CFG_DOUBLE. fallbackValue is returned if the value is not specified in the configuration, and there is no default value.
|
virtual |
Returns a per-object config value as string. The option's type must be CFG_STRING. fallbackValue is returned if the value is not specified in the configuration, and there is no default value.
|
virtual |
Returns the per-object config value as a file path. The option's type must be CFG_FILENAME. If the value is relative, then it will be converted to an absolute path, using the base directory (see KeyValue::getBaseDirectory()).
|
virtual |
Returns the per-object config value as a list of file paths (file or directory names, possibly containing wildcards), separated by spaces. The option's type must be CFG_FILENAMES. The relative paths in the list will be converted to absolute, using the base directory (see KeyValue::getBaseDirectory()).
|
virtual |
Returns the per-object config value as a list of directory names, possibly containing wildcards, and separated by ";" (Windows), or ":" or ";" (other OSes). The option's type must be CFG_PATH. The relative names in the list will be converted to absolute, using the base directory (see getBaseDirectoryFor() method).
|
pure virtual |
Substitutes ${} variables into the given string. The resulting string is stored inside the configuration object.