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 applied to a NodeGroup. More...

Description

Builder-level validation contracts.

Defines the Contract base class — a typed predicate over a NodeGroup — 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 <string>
20
21#include "builder/NodeGroup.h"
24
25namespace simaai::neat {
26
27// Forward-declare policy surface (contracts may consult it, but must remain STL-only).
28class Policy;
29
46 enum class Mode {
47 Validate = 0,
48 Run,
49 Rtsp,
50 };
51
53
56
58 const Policy* policy = nullptr;
59
61 bool strict = true;
62};
63
81class Contract {
82public:
84 virtual ~Contract() = default;
85
87 virtual std::string id() const = 0;
88
90 virtual std::string description() const {
91 return "";
92 }
93
101 virtual void validate(const NodeGroup& nodes, const ValidationContext& ctx,
102 ValidationReport& report) const = 0;
103};
104
105} // namespace simaai::neat

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.