Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Static Protected Member Functions
mrpt::utils::CLoadableOptions Class Reference

Detailed Description

This is a virtual base class for sets of options than can be loaded from and/or saved to configuration plain-text files.

Todo:
Automatize this class thru a proxy auxiliary class where variables are registered from pointers, etc...

#include <mrpt/utils/CLoadableOptions.h>

Inheritance diagram for mrpt::utils::CLoadableOptions:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void loadFromConfigFile (const mrpt::utils::CConfigFileBase &source, const std::string &section)=0
 This method load the options from a ".ini"-like file or memory-stored string list.
void loadFromConfigFileName (const std::string &config_file, const std::string &section)
 Behaves like loadFromConfigFile, but you can pass directly a file name and a temporary CConfigFile object will be created automatically to load the file.
virtual void saveToConfigFile (mrpt::utils::CConfigFileBase &source, const std::string &section)
 This method saves the options to a ".ini"-like file or memory-stored string list.
void saveToConfigFileName (const std::string &config_file, const std::string &section)
 Behaves like saveToConfigFile, but you can pass directly a file name and a temporary CConfigFile object will be created automatically to save the file.
void dumpToConsole () const
 This method must display clearly all the contents of the structure in textual form, sending it to a CStream.
virtual void dumpToTextStream (CStream &out) const =0
 This method must display clearly all the contents of the structure in textual form, sending it to a CStream.
virtual ~CLoadableOptions ()
 Virtual destructor.

Static Protected Member Functions

static void dumpVar_int (CStream &out, const char *varName, int v)
 Used to print variable info from dumpToTextStream with the macro LOADABLEOPTS_DUMP_VAR.
static void dumpVar_float (CStream &out, const char *varName, float v)
static void dumpVar_double (CStream &out, const char *varName, double v)
static void dumpVar_bool (CStream &out, const char *varName, bool v)
static void dumpVar_string (CStream &out, const char *varName, const std::string &v)

Constructor & Destructor Documentation

virtual mrpt::utils::CLoadableOptions::~CLoadableOptions ( ) [inline, virtual]

Virtual destructor.

Definition at line 112 of file CLoadableOptions.h.


Member Function Documentation

void mrpt::utils::CLoadableOptions::dumpToConsole ( ) const

This method must display clearly all the contents of the structure in textual form, sending it to a CStream.

virtual void mrpt::utils::CLoadableOptions::dumpToTextStream ( CStream out) const [pure virtual]

This method must display clearly all the contents of the structure in textual form, sending it to a CStream.

Implemented in mrpt::slam::TSetOfMetricMapInitializers, mrpt::slam::COccupancyGridMap2D::TLikelihoodOptions, mrpt::slam::COccupancyGridMap2D::TInsertionOptions, mrpt::vision::TMultiResDescOptions, mrpt::hmtslam::CHMTSLAM::TOptions, mrpt::vision::TMultiResDescMatchOptions, mrpt::vision::TMatchingOptions, mrpt::slam::CLandmarksMap::TLikelihoodOptions, mrpt::slam::CColouredPointsMap::TColourOptions, mrpt::slam::CLandmarksMap::TInsertionOptions, mrpt::slam::CPointsMap::TLikelihoodOptions, mrpt::vision::TStereoSystemParams, mrpt::slam::CBeaconMap::TInsertionOptions, mrpt::slam::CPointsMap::TInsertionOptions, mrpt::slam::CRangeBearingKFSLAM::TOptions, mrpt::slam::CBeaconMap::TLikelihoodOptions, mrpt::slam::CHeightGridMap2D::TInsertionOptions, mrpt::slam::CMultiMetricMapPDF::TPredictionParams, mrpt::reactivenav::CPRRTNavigator::TOptions, mrpt::slam::CMultiMetricMap::TOptions, mrpt::slam::CRangeBearingKFSLAM2D::TOptions, mrpt::slam::CReflectivityGridMap2D::TInsertionOptions, mrpt::bayes::CParticleFilter::TParticleFilterOptions, mrpt::slam::CMetricMapBuilderRBPF::TConstructionOptions, mrpt::slam::CGridMapAligner::TConfigParams, mrpt::slam::CWirelessPowerGridMap2D::TInsertionOptions, mrpt::vision::CFeatureExtraction::TOptions, mrpt::slam::CGasConcentrationGridMap2D::TInsertionOptions, mrpt::hmtslam::CTopLCDetector_GridMatching::TOptions, mrpt::hmtslam::CTopLCDetector_FabMap::TOptions, mrpt::slam::CIncrementalMapPartitioner::TOptions, mrpt::bayes::TKF_options, mrpt::slam::CICP::TConfigParams, mrpt::slam::CMetricMapBuilderICP::TConfigParams, mrpt::vision::CCamModel, and mrpt::slam::TKLDParams.

static void mrpt::utils::CLoadableOptions::dumpVar_bool ( CStream out,
const char *  varName,
bool  v 
) [static, protected]
static void mrpt::utils::CLoadableOptions::dumpVar_double ( CStream out,
const char *  varName,
double  v 
) [static, protected]
static void mrpt::utils::CLoadableOptions::dumpVar_float ( CStream out,
const char *  varName,
float  v 
) [static, protected]
static void mrpt::utils::CLoadableOptions::dumpVar_int ( CStream out,
const char *  varName,
int  v 
) [static, protected]

Used to print variable info from dumpToTextStream with the macro LOADABLEOPTS_DUMP_VAR.

static void mrpt::utils::CLoadableOptions::dumpVar_string ( CStream out,
const char *  varName,
const std::string v 
) [static, protected]
virtual void mrpt::utils::CLoadableOptions::loadFromConfigFile ( const mrpt::utils::CConfigFileBase source,
const std::string section 
) [pure virtual]

This method load the options from a ".ini"-like file or memory-stored string list.

Only those parameters found in the given "section" and having the same name that the variable are loaded. Those not found in the file will stay with their previous values (usually the default values loaded at initialization). An example of an ".ini" file:

  [section]
        resolution=0.10         ; blah blah...
        modeSelection=1         ; 0=blah, 1=blah,...
See also:
loadFromConfigFileName, saveToConfigFile

Implemented in mrpt::slam::TSetOfMetricMapInitializers, mrpt::slam::COccupancyGridMap2D::TLikelihoodOptions, mrpt::slam::COccupancyGridMap2D::TInsertionOptions, mrpt::vision::TMultiResDescOptions, mrpt::hmtslam::CHMTSLAM::TOptions, mrpt::vision::TMultiResDescMatchOptions, mrpt::vision::TMatchingOptions, mrpt::slam::CLandmarksMap::TLikelihoodOptions, mrpt::slam::CColouredPointsMap::TColourOptions, mrpt::slam::CLandmarksMap::TInsertionOptions, mrpt::slam::CPointsMap::TLikelihoodOptions, mrpt::vision::TStereoSystemParams, mrpt::slam::CBeaconMap::TInsertionOptions, mrpt::slam::CPointsMap::TInsertionOptions, mrpt::slam::CRangeBearingKFSLAM::TOptions, mrpt::slam::CBeaconMap::TLikelihoodOptions, mrpt::slam::CHeightGridMap2D::TInsertionOptions, mrpt::slam::CMultiMetricMapPDF::TPredictionParams, mrpt::reactivenav::CPRRTNavigator::TOptions, mrpt::slam::CMultiMetricMap::TOptions, mrpt::slam::CRangeBearingKFSLAM2D::TOptions, mrpt::slam::CReflectivityGridMap2D::TInsertionOptions, mrpt::bayes::CParticleFilter::TParticleFilterOptions, mrpt::slam::CMetricMapBuilderRBPF::TConstructionOptions, mrpt::slam::CWirelessPowerGridMap2D::TInsertionOptions, mrpt::slam::CGridMapAligner::TConfigParams, mrpt::slam::CGasConcentrationGridMap2D::TInsertionOptions, mrpt::vision::CFeatureExtraction::TOptions, mrpt::hmtslam::CTopLCDetector_GridMatching::TOptions, mrpt::hmtslam::CTopLCDetector_FabMap::TOptions, mrpt::bayes::TKF_options, mrpt::slam::CIncrementalMapPartitioner::TOptions, mrpt::slam::CICP::TConfigParams, mrpt::slam::CMetricMapBuilderICP::TConfigParams, mrpt::vision::CCamModel, and mrpt::slam::TKLDParams.

void mrpt::utils::CLoadableOptions::loadFromConfigFileName ( const std::string config_file,
const std::string section 
)

Behaves like loadFromConfigFile, but you can pass directly a file name and a temporary CConfigFile object will be created automatically to load the file.

See also:
loadFromConfigFile
virtual void mrpt::utils::CLoadableOptions::saveToConfigFile ( mrpt::utils::CConfigFileBase source,
const std::string section 
) [inline, virtual]

This method saves the options to a ".ini"-like file or memory-stored string list.

See also:
loadFromConfigFile, saveToConfigFileName

Reimplemented in mrpt::vision::TMultiResDescOptions, and mrpt::vision::TMultiResDescMatchOptions.

Definition at line 87 of file CLoadableOptions.h.

References THROW_EXCEPTION.

void mrpt::utils::CLoadableOptions::saveToConfigFileName ( const std::string config_file,
const std::string section 
)

Behaves like saveToConfigFile, but you can pass directly a file name and a temporary CConfigFile object will be created automatically to save the file.

See also:
saveToConfigFile, loadFromConfigFileName



Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011