Main MRPT website > C++ reference
MRPT logo
List of all members | Public Member Functions | Static Protected Member Functions
mrpt::utils::CLoadableOptions Class Referenceabstract

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...

Definition at line 28 of file CLoadableOptions.h.

#include <mrpt/utils/CLoadableOptions.h>

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

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. More...
 
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. More...
 
virtual void saveToConfigFile (mrpt::utils::CConfigFileBase &target, const std::string &section) const
 This method saves the options to a ".ini"-like file or memory-stored string list. More...
 
void saveToConfigFileName (const std::string &config_file, const std::string &section) const
 Behaves like saveToConfigFile, but you can pass directly a file name and a temporary CConfigFile object will be created automatically to save the file. More...
 
void dumpToConsole () const
 Just like dumpToTextStream() but sending the text to the console (std::cout) More...
 
virtual void dumpToTextStream (CStream &out) const
 This method should clearly display all the contents of the structure in textual form, sending it to a CStream. More...
 
virtual ~CLoadableOptions ()
 Virtual destructor. More...
 

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. More...
 
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

◆ ~CLoadableOptions()

virtual mrpt::utils::CLoadableOptions::~CLoadableOptions ( )
inlinevirtual

Virtual destructor.

Definition at line 92 of file CLoadableOptions.h.

Member Function Documentation

◆ dumpToConsole()

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

Just like dumpToTextStream() but sending the text to the console (std::cout)

◆ dumpToTextStream()

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

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

The default implementation in this base class relies on saveToConfigFile() to generate a plain text representation of all the parameters.

Reimplemented in mrpt::slam::TSetOfMetricMapInitializers, mrpt::slam::COccupancyGridMap2D::TLikelihoodOptions, mrpt::slam::COccupancyGridMap2D::TInsertionOptions, mrpt::vision::TMultiResDescOptions, mrpt::vision::TMultiResDescMatchOptions, mrpt::slam::CLandmarksMap::TLikelihoodOptions, mrpt::slam::CColouredPointsMap::TColourOptions, mrpt::slam::CPointsMap::TLikelihoodOptions, mrpt::slam::CLandmarksMap::TInsertionOptions, mrpt::slam::CPointsMap::TInsertionOptions, mrpt::slam::CBeaconMap::TInsertionOptions, mrpt::slam::COctoMapBase< OCTREE, OCTREE_NODE >::TLikelihoodOptions, mrpt::slam::CRangeBearingKFSLAM::TOptions, mrpt::slam::CBeaconMap::TLikelihoodOptions, mrpt::slam::CHeightGridMap2D::TInsertionOptions, mrpt::slam::CMultiMetricMapPDF::TPredictionParams, mrpt::slam::CRangeBearingKFSLAM2D::TOptions, mrpt::slam::CMultiMetricMap::TOptions, mrpt::slam::CReflectivityGridMap2D::TInsertionOptions, mrpt::bayes::CParticleFilter::TParticleFilterOptions, mrpt::slam::COctoMapBase< OCTREE, OCTREE_NODE >::TInsertionOptions, mrpt::slam::CGridMapAligner::TConfigParams, mrpt::slam::CMetricMapBuilderRBPF::TConstructionOptions, mrpt::slam::CGasConcentrationGridMap2D::TInsertionOptions, mrpt::slam::CWirelessPowerGridMap2D::TInsertionOptions, mrpt::slam::CIncrementalMapPartitioner::TOptions, mrpt::slam::CICP::TConfigParams, mrpt::slam::CMetricMapBuilderICP::TConfigParams, and mrpt::slam::TKLDParams.

◆ dumpVar_bool()

static void mrpt::utils::CLoadableOptions::dumpVar_bool ( CStream out,
const char *  varName,
bool  v 
)
staticprotected

◆ dumpVar_double()

static void mrpt::utils::CLoadableOptions::dumpVar_double ( CStream out,
const char *  varName,
double  v 
)
staticprotected

◆ dumpVar_float()

static void mrpt::utils::CLoadableOptions::dumpVar_float ( CStream out,
const char *  varName,
float  v 
)
staticprotected

◆ dumpVar_int()

static void mrpt::utils::CLoadableOptions::dumpVar_int ( CStream out,
const char *  varName,
int  v 
)
staticprotected

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

◆ dumpVar_string()

static void mrpt::utils::CLoadableOptions::dumpVar_string ( CStream out,
const char *  varName,
const std::string &  v 
)
staticprotected

◆ loadFromConfigFile()

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::srba::RbaEngine< KF2KF_POSE_TYPE, LM_TYPE, OBS_TYPE, RBA_OPTIONS >::TSRBAParameters, mrpt::vision::TMatchingOptions, mrpt::slam::CLandmarksMap::TLikelihoodOptions, mrpt::slam::CColouredPointsMap::TColourOptions, mrpt::slam::CPointsMap::TLikelihoodOptions, mrpt::slam::CLandmarksMap::TInsertionOptions, mrpt::vision::TStereoSystemParams, mrpt::slam::CPointsMap::TInsertionOptions, mrpt::slam::CBeaconMap::TInsertionOptions, mrpt::slam::COctoMapBase< OCTREE, OCTREE_NODE >::TLikelihoodOptions, mrpt::slam::CRangeBearingKFSLAM::TOptions, mrpt::slam::CBeaconMap::TLikelihoodOptions, mrpt::slam::CHeightGridMap2D::TInsertionOptions, mrpt::slam::CMultiMetricMapPDF::TPredictionParams, mrpt::reactivenav::CPRRTNavigator::TOptions, mrpt::reactivenav::CHolonomicND::TOptions, mrpt::slam::CRangeBearingKFSLAM2D::TOptions, mrpt::slam::CMultiMetricMap::TOptions, mrpt::slam::CReflectivityGridMap2D::TInsertionOptions, mrpt::bayes::CParticleFilter::TParticleFilterOptions, mrpt::slam::COctoMapBase< OCTREE, OCTREE_NODE >::TInsertionOptions, mrpt::reactivenav::CHolonomicVFF::TOptions, mrpt::slam::CGridMapAligner::TConfigParams, mrpt::slam::CMetricMapBuilderRBPF::TConstructionOptions, mrpt::vision::CFeatureExtraction::TOptions, mrpt::slam::CGasConcentrationGridMap2D::TInsertionOptions, mrpt::bayes::TKF_options, mrpt::hmtslam::CTopLCDetector_GridMatching::TOptions, mrpt::slam::CWirelessPowerGridMap2D::TInsertionOptions, mrpt::hmtslam::CTopLCDetector_FabMap::TOptions, mrpt::slam::CIncrementalMapPartitioner::TOptions, mrpt::slam::CICP::TConfigParams, mrpt::slam::CMetricMapBuilderICP::TConfigParams, mrpt::vision::CCamModel, and mrpt::slam::TKLDParams.

◆ loadFromConfigFileName()

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

◆ saveToConfigFile()

virtual void mrpt::utils::CLoadableOptions::saveToConfigFile ( mrpt::utils::CConfigFileBase target,
const std::string &  section 
) const
inlinevirtual

◆ saveToConfigFileName()

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

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.8.14 for MRPT 1.1.0 SVN: at lun oct 28 00:54:49 CET 2019 Hosted on:
SourceForge.net Logo