class mola::OptionsCapable
Overview
Mixin interface for metric map classes that expose one or more mrpt::config::CLoadableOptions structures (e.g. “creationOptions”, “insertionOptions”, “likelihoodOptions”, “renderOptions”) in a generic, name-indexed way, so that callers (e.g. the mm2ini / ini2mm CLI tools) never need to know the concrete map class nor the exact set/names of options structures it defines works uniformly for all present and future classes implementing this interface.
“Creation options” (those that configure a map’s internal structure, e.g. a voxel/grid size) are handled separately via trySetCreationOptions(), since changing them may be incompatible with already-inserted map contents.
This interface is a temporary home for functionality that may eventually be proposed for inclusion in MRPT itself (mrpt::maps::CMetricMap). Until then, it lives here.
#include <OptionsCapable.h> class OptionsCapable { public: // construction OptionsCapable(); OptionsCapable(const OptionsCapable&); OptionsCapable(OptionsCapable&&); // methods OptionsCapable& operator = (const OptionsCapable&); OptionsCapable& operator = (OptionsCapable&&); virtual std::map<std::string, mrpt::config::CLoadableOptions*> optionsByName() = 0; }; // direct descendants class HashedVoxelPointCloud; class KeyframePointCloudMap; class NDT; class SparseTreesPointCloud; class SparseVoxelPointCloud;
Methods
virtual std::map<std::string, mrpt::config::CLoadableOptions*> optionsByName() = 0
Maps an options-group name (e.g. “insertionOptions”) to a pointer to the corresponding, live CLoadableOptions member. Pointers remain valid as long as this is alive, and point directly to the map’s actual option members (no copies), so writes through them (e.g. via loadFromConfigFile()) take effect immediately.
Implementations should list every CLoadableOptions member they define, INCLUDING “creationOptions” if present (so it can be discovered/exported generically); however, callers must use trySetCreationOptions(), not a direct write through this pointer, to safely modify creation options.