Skip to main content

Contract.h File

Builder-level validation contracts. More...

Included Headers

#include <memory> #include <string> #include "builder/NodeGroup.h" #include "contracts/ContractTypes.h" #include "contracts/ValidationReport.h"

Namespaces Index

namespacesimaai
namespaceneat

Classes Index

structValidationContext

Context passed to contracts during validation. More...

classContract

A single validation rule. More...

Description

Builder-level validation contracts.

File Listing

The file content with the documentation metadata removed is:

1
6// include/contracts/Contract.h
7#pragma once
8
9#include <memory>
10#include <string>
11
12#include "builder/NodeGroup.h"
15
16namespace simaai::neat {
17
18// Forward-declare policy surface (contracts may consult it, but must remain STL-only).
19class Policy;
20
28 enum class Mode {
29 Validate = 0, // "validate()" path (structural checks only, no PLAYING implied here)
30 Run, // "run()" path (expects Output terminal)
31 Rtsp, // "run_rtsp()" path (expects StillImageInput, encoder/pay if you model them)
32 };
33
35
36 // Desired runner memory posture (used only for reporting / soft checks at builder-level).
38
39 // Optional: a policy bundle. Contracts must not require it.
40 const Policy* policy = nullptr;
41
42 // If false, contracts should prefer WARN over ERROR when reasonable.
43 bool strict = true;
44};
45
54class Contract {
55public:
56 virtual ~Contract() = default;
57
59 virtual std::string id() const = 0;
60
62 virtual std::string description() const {
63 return "";
64 }
65
67 virtual void validate(const NodeGroup& nodes, const ValidationContext& ctx,
68 ValidationReport& report) const = 0;
69};
70
71} // namespace simaai::neat

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.