00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef CLoadableOptions_H
00029 #define CLoadableOptions_H
00030
00031 #include <mrpt/utils/utils_defs.h>
00032 #include <mrpt/utils/CConfigFileBase.h>
00033 #include <mrpt/utils/CStream.h>
00034 #include <mrpt/system/os.h>
00035
00036
00037
00038
00039 namespace mrpt
00040 {
00041 namespace utils
00042 {
00045 class MRPTDLLIMPEXP CLoadableOptions
00046 {
00047 protected:
00048
00050 static void dumpVar_int( CStream &out, const char *varName, int v );
00051 static void dumpVar_float( CStream &out, const char *varName, float v );
00052 static void dumpVar_double( CStream &out, const char *varName, double v );
00053 static void dumpVar_bool( CStream &out, const char *varName, bool v );
00054 static void dumpVar_string( CStream &out, const char *varName, const std::string &v );
00055
00056
00057 public:
00069 virtual void loadFromConfigFile(
00070 const mrpt::utils::CConfigFileBase &source,
00071 const std::string §ion) = 0;
00072
00075 void dumpToConsole();
00076
00079 virtual void dumpToTextStream(
00080 CStream &out) = 0;
00081
00084 virtual ~CLoadableOptions()
00085 {
00086 }
00087
00088 };
00089
00091 #define LOADABLEOPTS_DUMP_VAR(variableName,variableType) { dumpVar_##variableType(out, #variableName,static_cast<variableType>(variableName)); }
00092
00093 }
00094 }
00095 #endif