class mrpt::config::CLoadableOptions

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

#include <mrpt/config/CLoadableOptions.h>

class CLoadableOptions
{
public:
    //
methods

    virtual void loadFromConfigFile(const mrpt::config::CConfigFileBase& source, const std::string& section) = 0;
    void loadFromConfigFileName(const std::string& config_file, const std::string& section);
    virtual void saveToConfigFile(mrpt::config::CConfigFileBase& target, const std::string& section) const;
    void saveToConfigFileName(const std::string& config_file, const std::string& section) const;
    void dumpToConsole() const;
    virtual void dumpToTextStream(std::ostream& out) const;
};

// direct descendants

struct TParticleFilterOptions;
struct TKF_options;
struct TSlidingWindow;

template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
struct TUncertaintyPath;

struct TParams;
struct TParams;
struct TParams;
struct TParams;
struct TLaserParams;
struct TLoopClosureParams;
struct TParams;
struct GraphVisualizationParams;
struct OptimizationParams;
struct TMyntEyeCameraParameters;
struct TInsertionOptions;
struct TLikelihoodOptions;
struct TColourOptions;
struct TInsertionOptions;
struct TInsertionOptions;
struct TInsertionOptions;
struct TInsertionOptions;
struct TLikelihoodOptions;
struct TPredictionParams;
class TInsertionOptions;
class TLikelihoodOptions;
class TInsertionOptions;
class TLikelihoodOptions;
struct TInsertionOptions;
struct TLikelihoodOptions;
struct TOptions;
struct TInsertionOptions;
struct TLikelihoodOptions;
struct TRenderOptions;
struct TInsertionOptions;
struct TInsertionOptions;
struct TInsertionOptions;
class TMapGenericParams;
struct TMetricMapInitializer;
class TSetOfMetricMapInitializers;
struct TVoxelMap_InsertionOptions;
struct TVoxelMap_LikelihoodOptions;
struct TAbstractNavigatorParams;
struct TAbstractPTGNavigatorParams;
struct TOptions;
struct TOptions;
struct TOptions;
struct TParamsBase;
class CParameterizedTrajectoryGenerator;
struct TReactiveNavigatorParams;
struct TWaypointsNavigatorParams;
class TConfigParams;
class TConfigParams;
struct TOptions;
struct TConfigParams;
struct TConstructionOptions;
struct TOptions;
struct TOptions;
class TKLDParams;
struct TOptions;
struct TMatchingOptions;
struct TMultiResDescMatchOptions;
struct TMultiResDescOptions;
struct TStereoSystemParams;

Methods

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.

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

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.

See also:

loadFromConfigFile

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.

See also:

loadFromConfigFile, saveToConfigFileName

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.

See also:

saveToConfigFile, loadFromConfigFileName

void dumpToConsole() const

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

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.

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