ores.cpp.presentation.history_field_mapper_header

Table of Contents

Declares render_{entity}_fields(): a codegen'd, plain per-entity function rendering a domain value to an ordered ores::diff::domain::field_value list, per History Diff Architecture layer 1 — one call per field, in mapper order, no runtime reflection. presentation profile.

See the Template variable reference for the complete list of available variables and their semantics.

Template

The full template source. Edit here and re-tangle with compass build --direct tangle_codegen_templates to regenerate library/templates/cpp_history_field_mapper.hpp.mustache.

{{! GENERATED FILE — tangled from projects/ores.codegen/library/templates/cpp_presentation.org. Edit the org source. }}
{{{cpp_license}}}
{{#domain_entity}}
#ifndef ORES_{{component_core_upper}}_PRESENTATION_{{entity_singular_upper}}_HISTORY_FIELD_MAPPER_HPP
#define ORES_{{component_core_upper}}_PRESENTATION_{{entity_singular_upper}}_HISTORY_FIELD_MAPPER_HPP

#include "ores.diff/domain/field_value.hpp"
#include "ores.{{component_core}}/export.hpp"
#include "ores.{{component_include}}/domain/{{entity_singular}}.hpp"
#include <vector>

namespace ores::{{component}}::presentation {

/**
 * @brief Renders a {{entity_singular}} to an ordered field list for
 * history-diff display. One line per field, in mapper order; no
 * runtime reflection.
 */
[[nodiscard]] ORES_{{component_core_upper}}_EXPORT std::vector<ores::diff::domain::field_value>
render_{{entity_singular}}_fields(const domain::{{entity_singular}}& v);

}

#endif
{{/domain_entity}}

See also

Emacs 29.3 (Org mode 9.6.15)