C++ messaging templates
Table of Contents
This page is the literate source for the cpp_messaging facet of the
codegen template library. Each section documents one template and
holds its source in a mustache block tangled to the sibling
.mustache file consumed by generator.py. The .mustache files are
generated artefacts — edit this document, then run the tangle
(compass build --direct tangle_codegen_templates or
projects/ores.lisp/src/ores-build-codegen-templates.el directly).
Output paths and profile membership come from
facet_catalogue.org.
Summary
Six templates forming the entity's NATS surface end-to-end: the
protocol request/response pair (protocol profile; cpp_protocol.cpp
is referenced by no profile — audit candidate), the changed-event
(nats-eventing), the subject handler (nats-handler), and the
per-entity service pair backing it (service profile).
The cpp_messaging facet
The seam between an entity and the messaging fabric: protocol message
types are what travels, the handler dispatches them, and the service
executes them against the repository. Generated per entity; the
component-side host that runs the handlers lives in
cpp_service_app. Protocol and event class names arrive as explicit
model fields — deriving them from conventions is the Phase-1
Qt-derivation story.
Archetypes
| Archetype | Description |
|---|---|
| cpp_nats_changed_event.hpp.mustache | Entity-changed event type published by the notify pipeline. nats-eventing profile. |
| cpp_nats_handler.hpp.mustache | Subject handler skeleton dispatching protocol messages to the entity service. nats-handler profile. |
| cpp_protocol.cpp.mustache | Out-of-class protocol implementations. No profile references it — audit candidate. |
| cpp_protocol.hpp.mustache | Request/response message types for the entity's NATS API. protocol profile. |
| cpp_service.cpp.mustache | Repository-backed operations exposed to messaging. service profile (per entity). |
| cpp_service.hpp.mustache | Entity service declarations. service profile (per entity). |
See also
- (Parent template group doc:
<group>_group.org.) - Codegen template library — the groups overview.
- Facet — the MASD concept these templates project.
- ORE Studio Messaging Reference — the facet's modeling reference (protocol).
- Applied MASD — the facet catalogue and codegen routes.
- facet_catalogue.org — profile → template/output mapping.