class mrpt::config::OptionsCapable
Overview
Mixin interface for classes that expose one or more CLoadableOptions structures (e.g.
“insertionOptions”, “likelihoodOptions”, “renderOptions”) in a generic, name-indexed way, so that callers never need to know the concrete 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 class’ internal structure, e.g. a voxel/grid size) are handled separately via trySetCreationOptions(), since changing them may be incompatible with already-built internal state.
#include <mrpt/config/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 template <class octree_t, class octree_node_t> class COctoMapBase; template <typename voxel_node_t, typename occupancy_t = int8_t> class CVoxelMapOccupancyBase; class CBeaconMap; class CGasConcentrationGridMap2D; class CHeightGridMap2D; class CHeightGridMap2D_MRF; class COccupancyGridMap2D; class COccupancyGridMap3D; class CPointsMap; class CRandomFieldGridMap3D; class CReflectivityGridMap2D; class CWirelessPowerGridMap2D;
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 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.