Skip to main content

Contract.h File

Builder-level validation contracts. More...

Included Headers

#include <memory> #include <span> #include <string> #include <vector> #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 applied to an ordered node list. More...

Description

Builder-level validation contracts.

Defines the Contract base class — a typed predicate over an ordered node list — plus the ValidationContext passed to each contract during validation. Contracts are pure builder-level checks (STL only, no GStreamer); they report findings through ValidationReport rather than throwing.

See Also

ContractRegistry

See Also

Validators

See Also

ValidationReport

File Listing

The file content with the documentation metadata removed is:

1
15// include/contracts/Contract.h
16#pragma once
17
18#include <memory>
19#include <span>
20#include <string>
21#include <vector>
22
25
26namespace simaai::neat {
27
28// Forward-declare policy surface (contracts may consult it, but must remain STL-only).
29class Node;
30class Policy;
31
48 enum class Mode {
49 Validate = 0,
50 Run,
51 Rtsp,
52 };
53
55
58
60 const Policy* policy = nullptr;
61
63 bool strict = true;
64};
65
83class Contract {
84public:
86 virtual ~Contract() = default;
87
89 virtual std::string id() const = 0;
90
92 virtual std::string description() const {
93 return "";
94 }
95
103 virtual void validate(std::span<const std::shared_ptr<Node>> nodes, const ValidationContext& ctx,
104 ValidationReport& report) const = 0;
105};
106
107} // namespace simaai::neat

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.