ores.cpp.generator.generator_header

Table of Contents

Generator class declaration. generator profile. Uses faker-cxx to produce structurally-valid synthetic instances. Counter-suffixed keys guarantee uniqueness within a test run; temporal fields are filled with plausible past timestamps via the generation context.

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_domain_type_generator.hpp.mustache.

{{! GENERATED FILE — tangled from projects/ores.codegen/library/templates/cpp_domain.org. Edit the org source. }}
{{{cpp_license}}}
{{#domain_entity}}
#ifndef ORES_{{component_include_upper}}_{{generator_facet_name_upper}}_{{entity_singular_upper}}_GENERATOR_HPP
#define ORES_{{component_include_upper}}_{{generator_facet_name_upper}}_{{entity_singular_upper}}_GENERATOR_HPP

#include <vector>
#include "ores.{{component_include}}/export.hpp"
#include "ores.{{component_include}}/domain/{{entity_singular}}.hpp"
#include "ores.utility/generation/generation_context.hpp"

namespace ores::{{component}}::{{generator_facet_name}} {

/**
 * @brief Generates a synthetic {{entity_singular}}.
 */
ORES_{{component_include_upper}}_EXPORT domain::{{entity_singular}} generate_synthetic_{{entity_singular}}(
    utility::generation::generation_context& ctx);

/**
 * @brief Generates N synthetic {{entity_plural}}.
 */
ORES_{{component_include_upper}}_EXPORT std::vector<domain::{{entity_singular}}>
generate_synthetic_{{entity_plural}}(std::size_t n,
    utility::generation::generation_context& ctx);

<<paste:E32E358B-56EC-4642-911E-A2EA1D95E3B4>>
}

#endif
{{/domain_entity}}
{{#junction}}
#ifndef ORES_{{component_include_upper}}_{{generator_facet_name_upper}}_{{name_singular_upper}}_GENERATOR_HPP
#define ORES_{{component_include_upper}}_{{generator_facet_name_upper}}_{{name_singular_upper}}_GENERATOR_HPP

#include <vector>
#include "ores.{{component_include}}/export.hpp"
#include "ores.{{component_include}}/domain/{{name_singular}}.hpp"
#include "ores.utility/generation/generation_context.hpp"

namespace ores::{{component}}::{{generator_facet_name}} {

/**
 * @brief Generates a synthetic {{name_singular}}.
 */
ORES_{{component_include_upper}}_EXPORT domain::{{name_singular}} generate_synthetic_{{name_singular}}(
    utility::generation::generation_context& ctx);

/**
 * @brief Generates N synthetic {{name}}.
 */
ORES_{{component_include_upper}}_EXPORT std::vector<domain::{{name_singular}}>
generate_synthetic_{{name}}(std::size_t n,
    utility::generation::generation_context& ctx);

}

#endif
{{/junction}}

See also

Emacs 29.3 (Org mode 9.6.15)