EvaluationEngines
Collection of contract evaluation engines.
Provides secure registration and lookup of evaluation engines, with tamper detection capabilities.
Thread Safety: This collection is thread-safe for concurrent access.
All operations (register, unregister, lookup) are thread-safe
Iterators are weakly consistent (may not reflect all concurrent modifications)
Engine instances themselves should be thread-safe if accessed concurrently
Example Usage:
val engines = EvaluationEngines()
// Register an engine (using += operator)
engines += ParametricInsuranceEngine()
// Get an engine (using [] operator)
val engine = engines["parametric-insurance"]
// Check if registered (using 'in' operator)
if ("parametric-insurance" in engines) { ... }
// Verify engine integrity
engines.verify("parametric-insurance", expectedHash)
// Iterate over engines
for (engine in engines) { ... }Content copied to clipboard
Properties
Functions
Link copied to clipboard
fun EvaluationEngines.filter(predicate: (ContractEvaluationEngine) -> Boolean): List<ContractEvaluationEngine>
Filter engines by a predicate.
Link copied to clipboard
Get an evaluation engine by ID.
Link copied to clipboard
inline fun EvaluationEngines.getOrElse(engineId: String, defaultValue: () -> ContractEvaluationEngine): ContractEvaluationEngine
Get an engine or return default value.
Link copied to clipboard
Link copied to clipboard
Transform engines using a mapping function.
Link copied to clipboard
Unregister an evaluation engine.
Link copied to clipboard
Register an evaluation engine.
Link copied to clipboard
Get an engine or throw with a clear error message.
Link copied to clipboard
Verify engine integrity or throw SecurityException.