Simox
2.3.74.0
|
Static Public Member Functions | |
static EIGEN_MAKE_ALIGNED_OPERATOR_NEW std::vector< std::string > | getDataPaths () |
Return vector of all data paths. More... | |
static void | setCaption (const std::string &caption) |
Set the runtime environment caption. More... | |
static bool | addDataPath (const std::string &path, bool quiet=false) |
static void | considerKey (const std::string &key, const std::string &description="") |
Enable the command line search for given key. Only keys that are enabled can later be accessed with the getValue() method. More... | |
static void | considerFlag (const std::string &flag, const std::string &description="") |
Enable the command line search for given flag. A flag does not take an argument but is either present or not. More... | |
static bool | getDataFileAbsolute (std::string &fileName) |
static void | processCommandLine (int argc, char *argv[]) |
static void | addKeyValuePair (const std::string &key, const std::string &value) |
Manually add a key/value pair. More... | |
static std::string | getValue (const std::string &key, const std::string &defaultValue="") |
Return the corresponding vale to key. If key cannot be found, defaultValue is returned. More... | |
static bool | hasValue (const std::string &key) |
static bool | hasFlag (const std::string &flag) |
Indicate whether the given flag was specified. More... | |
static bool | hasHelpFlag () |
Indicate whether the 'help' flag was specified. More... | |
static std::map< std::string, std::string > | getKeyValuePairs () |
Return all key value pairs. More... | |
static std::vector< std::string > | getUnrecognizedOptions () |
Return all unrecognized options. More... | |
static bool | toVector3f (const std::string &s, Eigen::Vector3f &storeResult) |
Convert strings as '(a,b,c)' to a 3 dimensional vector. More... | |
static float | toFloat (const std::string &s) |
Get the given string as float. More... | |
static int | toInt (const std::string &s) |
Get the given string as int. More... | |
static std::string | checkValidFileParameter (const std::string &key, const std::string &standardFilename) |
static std::string | checkParameter (const std::string &key, const std::string &standardValue="") |
static void | print () |
Print status. More... | |
static void | printOptions (std::ostream &os=std::cout) |
Print the command line options (as printed by boost::program_options) to os. More... | |
static void | cleanup () |
Free all resources. Usually not not needed, since on application exit all resources are freed automatically. More... | |
Protected Member Functions | |
RuntimeEnvironment () | |
virtual | ~RuntimeEnvironment () |
Static Protected Member Functions | |
static void | init () |
The runtime environment holds data paths and program arguments. Data files can be located by the getDataFileAbsolute method. Here, the environment variable SIMOX_DATA_PATH and VIRTUAL_ROBOT_DATA_PATH are considered. In addition, the install data directory is added at the end of the list of data paths for convenient access.
|
inlineprotected |
|
inlineprotectedvirtual |
|
static |
Add a path to global data path vector. These paths are searched within the getDataFileAbsolute() method. Only valid paths are processed.
path | The path to add. |
quiet | If set, invalid paths are quietly ignored. Otherwise an error is printed. |
|
static |
Manually add a key/value pair.
|
static |
Checks command line arguments for parameter key. If present the corresponding value is returned, otherwise standardValue will be returned.
|
static |
Check if command line parameters specify a valid filename and in case the key is not present in the command line arguments or the file was not found, the standardFilename is used. Additionally the absolute filenames are considered by calling getDataFileAbsolute().
key | The key which is checked for a filename. It is checked if the key is present and if so, it is tried to construct a valid filename with getDataFileAbsolute(). |
standardFilename | In case a valid file could not be determined, this file will be returned (additionally it is made absolute by calling getDataFileAbsolute(). Hence, a filename with a relative path can be passed and all datapaths are searched for it. |
|
static |
Free all resources. Usually not not needed, since on application exit all resources are freed automatically.
|
static |
Enable the command line search for given flag. A flag does not take an argument but is either present or not.
|
static |
Enable the command line search for given key. Only keys that are enabled can later be accessed with the getValue() method.
|
static |
Tries to find a file with name fileName. Therefore the working directory followed by all data paths are checked if the file can be found.
fileName | Could be a filename or a relative path. In case the file could be located, the absolute path is stored in place. |
|
static |
Return vector of all data paths.
|
static |
Return all key value pairs.
|
static |
Return all unrecognized options.
|
static |
Return the corresponding vale to key. If key cannot be found, defaultValue is returned.
|
static |
Indicate whether the given flag was specified.
|
static |
Indicate whether the 'help' flag was specified.
|
static |
|
staticprotected |
|
static |
Print status.
|
static |
Print the command line options (as printed by boost::program_options) to os.
|
static |
The command line parameters can be passed in order to generate a map of key/value pairs. All "--key value" pairs for which the key was enabled with the allowCommandLineOption() method are processed and stored as std::strings in a std::map. In addition, all "--data-path <path>" entries are extracted and the according data paths are stored. All unrecognized options are also stored.
|
static |
Set the runtime environment caption.
|
static |
Get the given string as float.
|
static |
Get the given string as int.
|
static |
Convert strings as '(a,b,c)' to a 3 dimensional vector.