MRPT  1.9.9
mrpt::config::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 26 of file config/CLoadableOptions.h.

#include <mrpt/config/CLoadableOptions.h>

Inherited by mrpt::bayes::CParticleFilter::TParticleFilterOptions, mrpt::bayes::TKF_options, mrpt::graphslam::deciders::CFixedIntervalsNRD< GRAPH_T >::TParams, mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::TParams, mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::TParams, mrpt::graphslam::deciders::CIncrementalNodeRegistrationDecider< GRAPH_T >::TParams, mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::TLaserParams, mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::TLoopClosureParams, mrpt::graphslam::deciders::CRangeScanOps< GRAPH_T >::TParams, mrpt::graphslam::optimizers::CLevMarqGSO< GRAPH_T >::GraphVisualizationParams, mrpt::graphslam::optimizers::CLevMarqGSO< GRAPH_T >::OptimizationParams, mrpt::graphslam::TSlidingWindow, mrpt::graphslam::TUncertaintyPath< GRAPH_T >, mrpt::hmtslam::CHMTSLAM::TOptions, mrpt::hmtslam::CTopLCDetector_FabMap::TOptions, mrpt::hmtslam::CTopLCDetector_GridMatching::TOptions, mrpt::maps::CBeaconMap::TInsertionOptions, mrpt::maps::CBeaconMap::TLikelihoodOptions, mrpt::maps::CColouredPointsMap::TColourOptions, mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions, mrpt::maps::CHeightGridMap2D::TInsertionOptions, mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions, mrpt::maps::CLandmarksMap::TInsertionOptions, mrpt::maps::CLandmarksMap::TLikelihoodOptions, mrpt::maps::CMultiMetricMapPDF::TPredictionParams, mrpt::maps::COccupancyGridMap2D::TInsertionOptions, mrpt::maps::COccupancyGridMap2D::TLikelihoodOptions, mrpt::maps::COctoMapBase< octree_t, octree_node_t >::TInsertionOptions, mrpt::maps::COctoMapBase< octree_t, octree_node_t >::TLikelihoodOptions, mrpt::maps::CPointCloudFilterByDistance::TOptions, mrpt::maps::CPointsMap::TInsertionOptions, mrpt::maps::CPointsMap::TLikelihoodOptions, mrpt::maps::CPointsMap::TRenderOptions, mrpt::maps::CRandomFieldGridMap3D::TInsertionOptions, mrpt::maps::CReflectivityGridMap2D::TInsertionOptions, mrpt::maps::CWirelessPowerGridMap2D::TInsertionOptions, mrpt::maps::TMapGenericParams, mrpt::maps::TMetricMapInitializer, mrpt::maps::TSetOfMetricMapInitializers, mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams, mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams, mrpt::nav::CHolonomicFullEval::TOptions, mrpt::nav::CHolonomicND::TOptions, mrpt::nav::CHolonomicVFF::TOptions, mrpt::nav::CMultiObjectiveMotionOptimizerBase::TParamsBase, mrpt::nav::CParameterizedTrajectoryGenerator, mrpt::nav::CReactiveNavigationSystem::TReactiveNavigatorParams, mrpt::nav::CWaypointsNavigator::TWaypointsNavigatorParams, mrpt::slam::CGridMapAligner::TConfigParams, mrpt::slam::CICP::TConfigParams, mrpt::slam::CIncrementalMapPartitioner::TOptions, mrpt::slam::CMetricMapBuilderICP::TConfigParams, mrpt::slam::CMetricMapBuilderRBPF::TConstructionOptions, mrpt::slam::CRangeBearingKFSLAM2D::TOptions, mrpt::slam::CRangeBearingKFSLAM::TOptions, mrpt::slam::TKLDParams, mrpt::vision::CCamModel, mrpt::vision::CFeatureExtraction::TOptions, mrpt::vision::TMatchingOptions, mrpt::vision::TMultiResDescMatchOptions, mrpt::vision::TMultiResDescOptions, and mrpt::vision::TStereoSystemParams.

Public Member Functions

virtual void loadFromConfigFile (const mrpt::config::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::config::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 (std::ostream &out) const
 This method should clearly display all the contents of the structure in textual form, sending it to a std::ostream. More...
 
virtual ~CLoadableOptions ()
 Virtual destructor. More...
 

Static Protected Member Functions

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

Constructor & Destructor Documentation

◆ ~CLoadableOptions()

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

Virtual destructor.

Definition at line 95 of file config/CLoadableOptions.h.

Member Function Documentation

◆ dumpToConsole()

void CLoadableOptions::dumpToConsole ( ) const

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

Definition at line 44 of file CLoadableOptions.cpp.

References dumpToTextStream().

Referenced by mrpt::hmtslam::CTopLCDetector_GridMatching::computeTopologicalObservationModel().

◆ dumpToTextStream()

void CLoadableOptions::dumpToTextStream ( std::ostream &  out) const
virtual

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

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

Reimplemented in mrpt::vision::TMultiResDescOptions, mrpt::vision::TMultiResDescMatchOptions, mrpt::maps::COccupancyGridMap2D::TLikelihoodOptions, mrpt::maps::COccupancyGridMap2D::TInsertionOptions, mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::TLoopClosureParams, mrpt::vision::TMatchingOptions, mrpt::hmtslam::CHMTSLAM::TOptions, mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::TLaserParams, mrpt::maps::CLandmarksMap::TLikelihoodOptions, mrpt::maps::TSetOfMetricMapInitializers, mrpt::maps::CPointsMap::TRenderOptions, mrpt::maps::CPointsMap::TLikelihoodOptions, mrpt::vision::TStereoSystemParams, mrpt::maps::CColouredPointsMap::TColourOptions, mrpt::maps::CLandmarksMap::TInsertionOptions, mrpt::maps::COctoMapBase< octree_t, octree_node_t >::TLikelihoodOptions, mrpt::maps::CPointsMap::TInsertionOptions, mrpt::graphslam::optimizers::CLevMarqGSO< GRAPH_T >::GraphVisualizationParams, mrpt::slam::CRangeBearingKFSLAM::TOptions, mrpt::graphslam::optimizers::CLevMarqGSO< GRAPH_T >::OptimizationParams, mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::TParams, mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::TParams, mrpt::graphslam::deciders::CRangeScanOps< GRAPH_T >::TParams, mrpt::maps::CRandomFieldGridMap3D::TInsertionOptions, mrpt::maps::CBeaconMap::TInsertionOptions, mrpt::graphslam::deciders::CFixedIntervalsNRD< GRAPH_T >::TParams, mrpt::maps::CMultiMetricMapPDF::TPredictionParams, mrpt::maps::CBeaconMap::TLikelihoodOptions, mrpt::slam::CRangeBearingKFSLAM2D::TOptions, mrpt::maps::CHeightGridMap2D::TInsertionOptions, mrpt::vision::CFeatureExtraction::TOptions, mrpt::maps::COctoMapBase< octree_t, octree_node_t >::TInsertionOptions, mrpt::graphslam::deciders::CIncrementalNodeRegistrationDecider< GRAPH_T >::TParams, mrpt::slam::CMetricMapBuilderRBPF::TConstructionOptions, mrpt::bayes::TKF_options, mrpt::slam::CGridMapAligner::TConfigParams, mrpt::graphslam::TSlidingWindow, mrpt::maps::CReflectivityGridMap2D::TInsertionOptions, mrpt::graphslam::TUncertaintyPath< GRAPH_T >, mrpt::hmtslam::CTopLCDetector_GridMatching::TOptions, mrpt::hmtslam::CTopLCDetector_FabMap::TOptions, mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions, mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions, mrpt::maps::CWirelessPowerGridMap2D::TInsertionOptions, mrpt::maps::TMetricMapInitializer, mrpt::slam::CMetricMapBuilderICP::TConfigParams, mrpt::vision::CCamModel, and mrpt::slam::TKLDParams.

Definition at line 77 of file CLoadableOptions.cpp.

References mrpt::config::CConfigFileMemory::getContent(), and saveToConfigFile().

Referenced by dumpToConsole(), and mrpt::maps::TMetricMapInitializer::dumpToTextStream().

◆ dumpVar_bool()

void CLoadableOptions::dumpVar_bool ( std::ostream &  out,
const char *  varName,
bool  v 
)
staticprotected

Definition at line 63 of file CLoadableOptions.cpp.

References mrpt::format(), and LOADABLEOPTS_COLUMN_WIDTH.

◆ dumpVar_double()

void CLoadableOptions::dumpVar_double ( std::ostream &  out,
const char *  varName,
double  v 
)
staticprotected

Definition at line 57 of file CLoadableOptions.cpp.

References mrpt::format(), and LOADABLEOPTS_COLUMN_WIDTH.

◆ dumpVar_float()

void CLoadableOptions::dumpVar_float ( std::ostream &  out,
const char *  varName,
float  v 
)
staticprotected

Definition at line 51 of file CLoadableOptions.cpp.

References mrpt::format(), and LOADABLEOPTS_COLUMN_WIDTH.

◆ dumpVar_int()

void CLoadableOptions::dumpVar_int ( std::ostream &  out,
const char *  varName,
int  v 
)
staticprotected

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

Definition at line 45 of file CLoadableOptions.cpp.

References mrpt::format(), and LOADABLEOPTS_COLUMN_WIDTH.

◆ dumpVar_string()

void CLoadableOptions::dumpVar_string ( std::ostream &  out,
const char *  varName,
const std::string v 
)
staticprotected

Definition at line 70 of file CLoadableOptions.cpp.

References mrpt::format(), and LOADABLEOPTS_COLUMN_WIDTH.

◆ loadFromConfigFile()

virtual void mrpt::config::CLoadableOptions::loadFromConfigFile ( const mrpt::config::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::vision::TMultiResDescOptions, mrpt::vision::TMultiResDescMatchOptions, mrpt::maps::COccupancyGridMap2D::TLikelihoodOptions, mrpt::maps::COccupancyGridMap2D::TInsertionOptions, mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::TLoopClosureParams, mrpt::vision::TMatchingOptions, mrpt::hmtslam::CHMTSLAM::TOptions, mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::TLaserParams, mrpt::nav::CParameterizedTrajectoryGenerator, mrpt::maps::CLandmarksMap::TLikelihoodOptions, mrpt::maps::TSetOfMetricMapInitializers, mrpt::maps::CPointsMap::TRenderOptions, mrpt::maps::CPointsMap::TLikelihoodOptions, mrpt::vision::TStereoSystemParams, mrpt::maps::CColouredPointsMap::TColourOptions, mrpt::maps::CLandmarksMap::TInsertionOptions, mrpt::maps::COctoMapBase< octree_t, octree_node_t >::TLikelihoodOptions, mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams, mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams, mrpt::maps::CPointsMap::TInsertionOptions, mrpt::graphslam::optimizers::CLevMarqGSO< GRAPH_T >::GraphVisualizationParams, mrpt::slam::CRangeBearingKFSLAM::TOptions, mrpt::graphslam::optimizers::CLevMarqGSO< GRAPH_T >::OptimizationParams, mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::TParams, mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::TParams, mrpt::graphslam::deciders::CRangeScanOps< GRAPH_T >::TParams, mrpt::maps::CBeaconMap::TInsertionOptions, mrpt::nav::CPTG_DiffDrive_CollisionGridBased, mrpt::maps::CRandomFieldGridMap3D::TInsertionOptions, mrpt::nav::CWaypointsNavigator::TWaypointsNavigatorParams, mrpt::graphslam::deciders::CFixedIntervalsNRD< GRAPH_T >::TParams, mrpt::maps::CMultiMetricMapPDF::TPredictionParams, mrpt::maps::CBeaconMap::TLikelihoodOptions, mrpt::slam::CRangeBearingKFSLAM2D::TOptions, mrpt::nav::CHolonomicFullEval::TOptions, mrpt::bayes::CParticleFilter::TParticleFilterOptions, mrpt::nav::CReactiveNavigationSystem::TReactiveNavigatorParams, mrpt::maps::CHeightGridMap2D::TInsertionOptions, mrpt::nav::CHolonomicND::TOptions, mrpt::maps::TMapGenericParams, mrpt::vision::CFeatureExtraction::TOptions, mrpt::maps::COctoMapBase< octree_t, octree_node_t >::TInsertionOptions, mrpt::graphslam::deciders::CIncrementalNodeRegistrationDecider< GRAPH_T >::TParams, mrpt::slam::CMetricMapBuilderRBPF::TConstructionOptions, mrpt::slam::CGridMapAligner::TConfigParams, mrpt::nav::CMultiObjectiveMotionOptimizerBase::TParamsBase, mrpt::graphslam::TSlidingWindow, mrpt::maps::CReflectivityGridMap2D::TInsertionOptions, mrpt::nav::CHolonomicVFF::TOptions, mrpt::slam::CICP::TConfigParams, mrpt::slam::CIncrementalMapPartitioner::TOptions, mrpt::graphslam::TUncertaintyPath< GRAPH_T >, mrpt::bayes::TKF_options, mrpt::hmtslam::CTopLCDetector_GridMatching::TOptions, mrpt::maps::CPointCloudFilterByDistance::TOptions, mrpt::hmtslam::CTopLCDetector_FabMap::TOptions, mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions, mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions, mrpt::maps::CWirelessPowerGridMap2D::TInsertionOptions, mrpt::nav::CPTG_DiffDrive_C, mrpt::maps::TMetricMapInitializer, mrpt::slam::CMetricMapBuilderICP::TConfigParams, mrpt::nav::CPTG_DiffDrive_alpha, mrpt::nav::CMultiObjMotionOpt_Scalarization::TParams, mrpt::vision::CCamModel, mrpt::nav::CPTG_DiffDrive_CC, mrpt::nav::CPTG_DiffDrive_CCS, mrpt::nav::CPTG_DiffDrive_CS, mrpt::nav::CPTG_Holo_Blend, and mrpt::slam::TKLDParams.

Referenced by loadFromConfigFileName().

◆ loadFromConfigFileName()

void 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

Definition at line 22 of file CLoadableOptions.cpp.

References loadFromConfigFile().

◆ saveToConfigFile()

void CLoadableOptions::saveToConfigFile ( mrpt::config::CConfigFileBase target,
const std::string section 
) const
virtual

◆ saveToConfigFileName()

void 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

Definition at line 37 of file CLoadableOptions.cpp.

References saveToConfigFile().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020