Define MCP_SAVE

Define Documentation

MCP_SAVE(Yaml__, Var__)

Macro to store a variable into a mrpt::containers::yaml (initials MCP) dictionary, using as “key” the name of the variable.

Usage:

mrpt::containers::yaml p;
double K = ...;

MCP_SAVE(p, K);

// If you want "K" to have degree units in the parameter block, radians when
// loaded in memory:
MCP_SAVE_DEG(p,K);

Since MRPT 2.3.2, this also works for enums, converting to textual names of values. Note that this requires enums to implement mrpt::typemeta::TEnumType.