Main MRPT website > C++ reference for MRPT 1.5.9
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>

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::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::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::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 (mrpt::utils::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 88 of file CLoadableOptions.h.

Member Function Documentation

◆ dumpToConsole()

void CLoadableOptions::dumpToConsole ( ) const

◆ dumpToTextStream()

void CLoadableOptions::dumpToTextStream ( mrpt::utils::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::vision::TMultiResDescOptions, mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::TLoopClosureParams, mrpt::vision::TMultiResDescMatchOptions, mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::TLaserParams, mrpt::maps::COccupancyGridMap2D::TLikelihoodOptions, mrpt::hmtslam::CHMTSLAM::TOptions, mrpt::maps::COccupancyGridMap2D::TInsertionOptions, mrpt::vision::TMatchingOptions, mrpt::maps::TSetOfMetricMapInitializers, mrpt::maps::CLandmarksMap::TLikelihoodOptions, mrpt::maps::CColouredPointsMap::TColourOptions, mrpt::graphslam::optimizers::CLevMarqGSO< GRAPH_T >::GraphVisualizationParams, mrpt::maps::CPointsMap::TLikelihoodOptions, mrpt::maps::CLandmarksMap::TInsertionOptions, mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::TParams, mrpt::vision::TStereoSystemParams, mrpt::maps::CPointsMap::TInsertionOptions, mrpt::graphslam::optimizers::CLevMarqGSO< GRAPH_T >::OptimizationParams, mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::TParams, mrpt::maps::COctoMapBase< octree_t, octree_node_t >::TLikelihoodOptions, mrpt::slam::CRangeBearingKFSLAM::TOptions, mrpt::graphslam::deciders::CRangeScanOps< GRAPH_T >::TParams, mrpt::graphslam::deciders::CFixedIntervalsNRD< GRAPH_T >::TParams, mrpt::maps::CBeaconMap::TInsertionOptions, mrpt::maps::CRandomFieldGridMap3D::TInsertionOptions, mrpt::maps::CMultiMetricMapPDF::TPredictionParams, mrpt::maps::CBeaconMap::TLikelihoodOptions, mrpt::slam::CRangeBearingKFSLAM2D::TOptions, mrpt::maps::CHeightGridMap2D::TInsertionOptions, mrpt::graphslam::TSlidingWindow, mrpt::slam::CGridMapAligner::TConfigParams, mrpt::bayes::CParticleFilter::TParticleFilterOptions, mrpt::maps::COctoMapBase< octree_t, octree_node_t >::TInsertionOptions, mrpt::bayes::TKF_options, mrpt::maps::CReflectivityGridMap2D::TInsertionOptions, mrpt::vision::CFeatureExtraction::TOptions, mrpt::graphslam::TUncertaintyPath< GRAPH_T >, mrpt::maps::TMapGenericParams, mrpt::slam::CMetricMapBuilderRBPF::TConstructionOptions, mrpt::hmtslam::CTopLCDetector_GridMatching::TOptions, mrpt::hmtslam::CTopLCDetector_FabMap::TOptions, mrpt::maps::CGasConcentrationGridMap2D::TInsertionOptions, mrpt::slam::CICP::TConfigParams, mrpt::slam::CIncrementalMapPartitioner::TOptions, mrpt::maps::CHeightGridMap2D_MRF::TInsertionOptions, mrpt::maps::CWirelessPowerGridMap2D::TInsertionOptions, mrpt::slam::CMetricMapBuilderICP::TConfigParams, mrpt::maps::TMetricMapInitializer, mrpt::vision::CCamModel, and mrpt::slam::TKLDParams.

Definition at line 80 of file CLoadableOptions.cpp.

References mrpt::utils::CConfigFileMemory::getContent(), mrpt::utils::CStream::printf(), and saveToConfigFile().

Referenced by dumpToConsole().

◆ dumpVar_bool()

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

◆ dumpVar_double()

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

◆ dumpVar_float()

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

◆ dumpVar_int()

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

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

Definition at line 52 of file CLoadableOptions.cpp.

References LOADABLEOPTS_COLUMN_WIDTH, and mrpt::utils::CStream::printf().

◆ dumpVar_string()

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

References loadFromConfigFile().

Referenced by mrpt::graphslam::optimizers::CLevMarqGSO< GRAPH_T >::loadParams().

◆ saveToConfigFile()

void CLoadableOptions::saveToConfigFile ( mrpt::utils::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 39 of file CLoadableOptions.cpp.

References saveToConfigFile().




Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020