CloneRegistry

Helpers & Utilities · AiDotNet.Models

Holds the compile-time clone plan for every discovered type, and builds one on demand for types the generator never saw.

How It Works

The clone plan generator registers a plan for every type it discovers, so correctness for those is settled at compile time and enforced by the analyzer. Types the generator never saw — one defined in a consumer’s own assembly, or produced at runtime — fall back to reflection, which is slower on first use but never simply fails.

The layering matters: a compile-time plan is checkable, a runtime plan is not, and mixing them silently would leave nobody able to say which guarantees applied. IsVerified reports which of the two produced a given plan.

Methods

Method Summary
ClonePlan GetPlan(Type type) Gets the plan for a type, building one by reflection if the generator never saw it.
IEnumerable<Type> VerifiedTypes() Gets every type with a compile-time plan.
bool IsVerified(Type type) Gets a value indicating whether a type’s plan was produced at compile time, and so is covered by the analyzer and the generated round-trip test.
void Register(ClonePlan plan) Registers a compile-time plan.