Type Formatter::getOption##Name (const string &name) \
{ \
if (unlikely (!opts_table_index (name, &opt))) \
OPT_ERR_UNKNOWN (name.c_str ()); \
if (unlikely (opt->type != (GType))) \
OPT_ERR_BAD_TYPE (name.c_str (), G_STRINGIFY (Type)); \
return *((Type *) (((ptrdiff_t) &_opts) + opt->offset)); \
} \
void Formatter::setOption##Name (const string &name, Type value) \
{ \
if (unlikely (!opts_table_index (name, &opt))) \
OPT_ERR_UNKNOWN (name.c_str ()); \
if (unlikely (opt->type != (GType))) \
OPT_ERR_BAD_TYPE (name.c_str (), G_STRINGIFY (Type)); \
*((Type *) (((ptrdiff_t) &_opts) + opt->offset)) = value; \
if (opt->func) \
{ \
((void (*) (
Formatter *,
const string &, Type)) opt->func) ( \
this, name, value); \
} \
}
Definition Formatter.cpp:45