mirror of
https://github.com/logos-co/logos-tutorial.git
synced 2026-08-30 20:31:06 +00:00
address review: self-valid interface header + accurate CI step
- Interface calculator.h includes logos_module_context.h so the logos_events token is defined (valid C++ standalone); prose updated accordingly. - CI step name/comment now reflect the third tutorial leaf (tutorial-interface-dependencies), not just the UI chain + Composing Modules. (Copilot review, PR #64.) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
592683156a
commit
1176ebf99e
@@ -55,12 +55,14 @@ jobs:
|
||||
# The runner is the shared `doctest` CLI, invoked directly via its flake
|
||||
# (github:logos-co/logos-doctest). The flake bundles Python + PyYAML
|
||||
# (+ rich), so no pip install step is needed.
|
||||
- name: Test - UI chain + Composing Modules (C Library tutorial pulled in via requires)
|
||||
- name: Test - UI chain + Composing Modules + Dependency Interfaces (C Library tutorial pulled in via requires)
|
||||
run: |
|
||||
# Two leaves, run back-to-back into one report:
|
||||
# Three leaves, run back-to-back into one report:
|
||||
# - tutorial-cpp-ui-app: the Part 1 -> 2 -> 3 chain (requires:)
|
||||
# - tutorial-composing-modules: the calc_aggregator core module
|
||||
# (requires Part 1 only)
|
||||
# - tutorial-interface-dependencies: the calc_via_interface module
|
||||
# binding a calculator interface at runtime (requires Part 1 only)
|
||||
# --continue-on-fail so the run walks every step and the published
|
||||
# report is complete. The job still fails (non-zero exit) if any step
|
||||
# failed; this only changes whether we stop early.
|
||||
|
||||
@@ -85,6 +85,10 @@ sections:
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
// Defines the `logos_events` token (expands to `public`) so this
|
||||
// header is valid C++ on its own, not only as generator input.
|
||||
#include <logos_module_context.h>
|
||||
|
||||
class ICalculator {
|
||||
public:
|
||||
int64_t add(int64_t a, int64_t b);
|
||||
@@ -100,7 +104,7 @@ sections:
|
||||
post_text: |
|
||||
A few things to notice:
|
||||
|
||||
- The class name (`ICalculator`) and method signatures are all the generator needs. There is no `#include` of any module, no `LogosAPI`, no Qt.
|
||||
- The class name (`ICalculator`) and method signatures are all the generator needs — no `LogosAPI`, no Qt, no reference to any concrete module. The one include (`logos_module_context.h`) just defines the `logos_events` token so the header is valid C++ on its own.
|
||||
- `logos_events:` (like Qt's `signals:`) marks event declarations. The generator turns each into a typed `on<Event>(callback)` subscriber on the bound wrapper.
|
||||
- You could write the exact same contract as a `.lidl` file instead — `interfaces/calculator.lidl` with `method add(a: int, b: int) -> int` … `event versionReady(version: tstr)`. The `.h` form is shown here because it matches a universal module's own language.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user