Skip to content
Concord

Class InjectionOrderer

Namespace
Concord.Detour
Assembly
Concord.Detour.dll

Topologically sorts injections for composition order.

public static class InjectionOrderer
Inheritance
InjectionOrderer
Inherited Members

Methods

OrderForComposition(IReadOnlyList<(long Seq, Injection Injection)>)

Returns injections in composition order: the order in which patch bodies are nested.

public static Injection[] OrderForComposition(IReadOnlyList<(long Seq, Injection Injection)> live)

Parameters

live IReadOnlyList<(long Seq, Injection Injection)>

Injections paired with registration sequence number.

Returns

Injection[]

Injections in composition order (the order bodies are composed/nested).

Remarks

The returned array is composition order: bodies are composed in array order, and each later-composed body wraps the ones before it, so the last element runs first at runtime.

Runtime ordering: an injection runs before every injection whose Owner appears in its BeforeOwners, and after every injection whose owner appears in its AfterOwners. Among unconstrained injections, lower Priority runs earlier; among equal priorities, higher Seq (later registration) runs earlier. Equivalently, in the returned array: higher priority composes earlier, and lower Seq composes earlier.

A constraint cycle throws ConcordEmitException (code CONC052).

Exceptions

ConcordEmitException

If ordering constraints form a cycle.