Oakfield API Documentation 1.0.0
Numerical core APIs
Loading...
Searching...
No Matches
operator.h File Reference

Operator abstraction, registry, and dependency resolution for libsimcore. More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "field.h"
#include "oakfield/backend.h"
#include "operator_identity.h"
Include dependency graph for operator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SimOperatorRepresentation
 Representation metadata attached to an operator. More...
 
struct  SimOperatorApproximation
 Approximation metadata describing discretization quality. More...
 
struct  SimNeuralShapeConstraints
 Shape and channel constraints used by neural operators. More...
 
struct  SimOperatorNeuralContract
 Neural operator contract metadata. More...
 
struct  SimOperatorInvariant
 Invariant declaration with tolerance. More...
 
struct  SimOperatorInfo
 Metadata describing operator characteristics. More...
 
struct  SimOperatorConfig
 Operator runtime configuration shared between descriptors and instances. More...
 
struct  SimOperator
 Operator instance stored by the registry. More...
 
struct  SimOperatorKernelBindingDescriptor
 Maps an IR field reference to a context field index. More...
 
struct  SimOperatorKernelOutputDescriptor
 Describes an output expression emitted by a kernel-backed operator. More...
 
struct  SimOperatorKernelDescriptor
 Descriptor for registering a kernel-backed operator. More...
 
struct  SimOperatorKernel
 Runtime state for a kernel-backed operator. More...
 
struct  SimOperatorDescriptor
 Description used when registering a new operator. More...
 
struct  SimOperatorRegistry
 Operator registry storing owned operator instances. More...
 
struct  SimOperatorPlan
 Execution plan obtained via dependency resolution. More...
 

Macros

#define OAKFIELD_ENABLE_SYMBOLIC_KERNELS   1
 
#define OAKFIELD_ENABLE_ZETA_CORE   1
 
#define SIM_OPERATOR_NAME_MAX   63U
 
#define SIM_OPERATOR_SCHEMA_KEY_MAX   127U
 
#define SIM_OPERATOR_MAX_SPACING_DIMS   4U
 
#define SIM_NEURAL_CHANNEL_AXIS_AUTO   255U
 
#define SIM_OPERATOR_MAX_INVARIANTS   4U
 

Typedefs

typedef void(* SimOperatorCycleLogFn) (const char *message, void *userdata)
 Callback used to report dependency-cycle diagnostics.
 
typedef enum SimOperatorCategory SimOperatorCategory
 Operator category for grouping and scheduling hints.
 
typedef enum SimContinuityMode SimContinuityMode
 Numerical continuity and stability policy.
 
typedef enum SimContinuityLimiterStrategy SimContinuityLimiterStrategy
 Limiter/clipper strategies engaged by continuity guards.
 
typedef enum SimOperatorAlgebraicFlags SimOperatorAlgebraicFlags
 Algebraic property bitmask for operators.
 
typedef struct SimOperatorRepresentation SimOperatorRepresentation
 Representation metadata attached to an operator.
 
typedef struct SimOperatorApproximation SimOperatorApproximation
 Approximation metadata describing discretization quality.
 
typedef enum SimRepresentationMode SimRepresentationMode
 Representation mode governing determinism guarantees.
 
typedef enum SimDeterminismFlags SimDeterminismFlags
 Determinism capability flags declared by operators.
 
typedef enum SimNeuralDeterminismPolicy SimNeuralDeterminismPolicy
 Determinism policy for neural inference operators.
 
typedef enum SimNeuralDeviceRequirement SimNeuralDeviceRequirement
 Device placement requirement for neural inference operators.
 
typedef enum SimNeuralPrecisionMode SimNeuralPrecisionMode
 Numeric precision policy for neural inference operators.
 
typedef struct SimNeuralShapeConstraints SimNeuralShapeConstraints
 Shape and channel constraints used by neural operators.
 
typedef struct SimOperatorNeuralContract SimOperatorNeuralContract
 Neural operator contract metadata.
 
typedef enum SimClockMode SimClockMode
 Clock selection for time-sensitive operators.
 
typedef enum SimOperatorInvariantKind SimOperatorInvariantKind
 Supported invariant kinds for bookkeeping/diagnostics.
 
typedef struct SimOperatorInvariant SimOperatorInvariant
 Invariant declaration with tolerance.
 
typedef struct SimOperatorInfo SimOperatorInfo
 Metadata describing operator characteristics.
 
typedef struct SimOperatorConfig SimOperatorConfig
 Operator runtime configuration shared between descriptors and instances.
 
typedef SimResult(* SimOperatorEvalFn) (struct SimContext *context, struct SimOperator *self, void *userdata)
 Function signature for operator evaluation.
 
typedef void(* SimOperatorDestroyFn) (void *userdata)
 Function signature for operator teardown callbacks.
 
typedef const struct SimGraphIR *(* SimOperatorGraphIRViewFn) (const struct SimOperator *self, void *userdata)
 Optional hook exposing a read-only GraphIR lowering view.
 
typedef struct SimOperator SimOperator
 Operator instance stored by the registry.
 
typedef struct SimOperatorKernelBindingDescriptor SimOperatorKernelBindingDescriptor
 Maps an IR field reference to a context field index.
 
typedef struct SimOperatorKernelOutputDescriptor SimOperatorKernelOutputDescriptor
 Describes an output expression emitted by a kernel-backed operator.
 
typedef struct SimOperatorKernelDescriptor SimOperatorKernelDescriptor
 Descriptor for registering a kernel-backed operator.
 
typedef struct SimOperatorKernel SimOperatorKernel
 Runtime state for a kernel-backed operator.
 
typedef struct SimOperatorDescriptor SimOperatorDescriptor
 Description used when registering a new operator.
 
typedef struct SimOperatorRegistry SimOperatorRegistry
 Operator registry storing owned operator instances.
 
typedef struct SimOperatorPlan SimOperatorPlan
 Execution plan obtained via dependency resolution.
 

Enumerations

enum  SimOperatorCategory {
  SIM_OPERATOR_CATEGORY_UNKNOWN = 0 , SIM_OPERATOR_CATEGORY_DIFFUSION , SIM_OPERATOR_CATEGORY_ADVECTION , SIM_OPERATOR_CATEGORY_REACTION ,
  SIM_OPERATOR_CATEGORY_POTENTIAL , SIM_OPERATOR_CATEGORY_MEASUREMENT , SIM_OPERATOR_CATEGORY_COUPLING , SIM_OPERATOR_CATEGORY_NOISE ,
  SIM_OPERATOR_CATEGORY_BOUNDARY , SIM_OPERATOR_CATEGORY_THERMOSTAT , SIM_OPERATOR_CATEGORY_UTILITY , SIM_OPERATOR_CATEGORY_NONLINEAR
}
 Operator category for grouping and scheduling hints. More...
 
enum  SimContinuityMode { SIM_CONTINUITY_NONE = 0 , SIM_CONTINUITY_STRICT = 1 , SIM_CONTINUITY_CLAMPED = 2 , SIM_CONTINUITY_LIMITED = 3 }
 Numerical continuity and stability policy. More...
 
enum  SimContinuityLimiterStrategy {
  SIM_LIMITER_STRATEGY_HARD_CLIP = 1u << 0 , SIM_LIMITER_STRATEGY_SOFT_CLIP = 1u << 1 , SIM_LIMITER_STRATEGY_SIGMOID_COMPRESSION , SIM_LIMITER_STRATEGY_ADAPTIVE_BIAS ,
  SIM_LIMITER_STRATEGY_STAT_AWARE , SIM_LIMITER_STRATEGY_PER_FIELD_OVERRIDE = 1u << 5
}
 Limiter/clipper strategies engaged by continuity guards. More...
 
enum  SimOperatorAlgebraicFlags {
  SIM_OPERATOR_ALG_NONE = 0u , SIM_OPERATOR_ALG_LINEAR = 1u << 0 , SIM_OPERATOR_ALG_AFFINE = 1u << 1 , SIM_OPERATOR_ALG_SELF_ADJOINT = 1u << 2 ,
  SIM_OPERATOR_ALG_PROJECTION = 1u << 3 , SIM_OPERATOR_ALG_COMMUTES_WITH_NOISE , SIM_OPERATOR_ALG_COMMUTES_WITH_BOUNDARY = 1u << 5
}
 Algebraic property bitmask for operators. More...
 
enum  SimRepresentationMode { SIM_REPRESENTATION_MODE_STRICT = 0 , SIM_REPRESENTATION_MODE_RELAXED , SIM_REPRESENTATION_MODE_EXPLORATION }
 Representation mode governing determinism guarantees. More...
 
enum  SimDeterminismFlags {
  SIM_DET_NONE = 0U , SIM_DET_PURE_TIME = 1U << 0 , SIM_DET_REWIND_SAFE = 1U << 1 , SIM_DET_NO_STATEFUL_NODES = 1U << 2 ,
  SIM_DET_DETERMINISTIC_RNG_ONLY = 1U << 3
}
 Determinism capability flags declared by operators. More...
 
enum  SimNeuralDeterminismPolicy { SIM_NEURAL_DETERMINISM_INHERIT = 0 , SIM_NEURAL_DETERMINISM_STRICT , SIM_NEURAL_DETERMINISM_BEST_EFFORT , SIM_NEURAL_DETERMINISM_OFF }
 Determinism policy for neural inference operators. More...
 
enum  SimNeuralDeviceRequirement { SIM_NEURAL_DEVICE_ANY = 0 , SIM_NEURAL_DEVICE_CPU_ONLY , SIM_NEURAL_DEVICE_ACCELERATOR_PREFERRED , SIM_NEURAL_DEVICE_ACCELERATOR_REQUIRED }
 Device placement requirement for neural inference operators. More...
 
enum  SimNeuralPrecisionMode {
  SIM_NEURAL_PRECISION_DEFAULT = 0 , SIM_NEURAL_PRECISION_FP32 , SIM_NEURAL_PRECISION_FP64 , SIM_NEURAL_PRECISION_MIXED ,
  SIM_NEURAL_PRECISION_FP16 , SIM_NEURAL_PRECISION_BF16
}
 Numeric precision policy for neural inference operators. More...
 
enum  SimClockMode { SIM_CLOCK_FROM_TIME_PARAM = 0 , SIM_CLOCK_FROM_STEP_PURE , SIM_CLOCK_ACCUMULATED_STATEFUL }
 Clock selection for time-sensitive operators. More...
 
enum  SimOperatorInvariantKind {
  SIM_OPERATOR_INVARIANT_NONE = 0 , SIM_OPERATOR_INVARIANT_L2_NORM , SIM_OPERATOR_INVARIANT_L1_NORM , SIM_OPERATOR_INVARIANT_ENERGY ,
  SIM_OPERATOR_INVARIANT_MASS , SIM_OPERATOR_INVARIANT_MEAN , SIM_OPERATOR_INVARIANT_VARIANCE
}
 Supported invariant kinds for bookkeeping/diagnostics. More...
 

Functions

const char * sim_continuity_mode_name (SimContinuityMode mode)
 
bool sim_continuity_mode_from_string (const char *text, SimContinuityMode *out_mode)
 
const char * sim_continuity_limiter_name (SimContinuityLimiterStrategy strategy)
 
const char * sim_boundary_policy_name (SimIRBoundaryPolicy policy)
 
bool sim_boundary_policy_from_string (const char *text, SimIRBoundaryPolicy *out_policy)
 
void sim_operator_config_set_spacing (struct SimOperatorConfig *config, const double *spacing, size_t rank)
 
SimResult sim_operator_registry_init (SimOperatorRegistry *registry)
 Initialize an empty registry.
 
void sim_operator_registry_destroy (SimOperatorRegistry *registry)
 Release all operators contained in a registry.
 
SimResult sim_operator_registry_register (SimOperatorRegistry *registry, const SimOperatorDescriptor *descriptor, size_t *out_index)
 Register a new operator.
 
SimOperatorsim_operator_registry_get (SimOperatorRegistry *registry, size_t index)
 Lookup an operator by index.
 
void sim_operator_dependencies (const SimOperator *op, const size_t **out_deps, size_t *out_count)
 Access operator dependency list.
 
SimResult sim_operator_resolve_plan_with_logger (const SimOperatorRegistry *registry, SimOperatorPlan *plan, SimOperatorCycleLogFn logger, void *logger_userdata)
 Resolve an execution plan for the registry.
 
SimResult sim_operator_resolve_plan (const SimOperatorRegistry *registry, SimOperatorPlan *plan)
 
void sim_operator_plan_destroy (SimOperatorPlan *plan)
 Release resources owned by a plan.
 
void * sim_operator_payload (SimOperator *op)
 Retrieve the internal user payload.
 
const char * sim_operator_name (const SimOperator *op)
 Retrieve the operator name.
 
SimOperatorInfo sim_operator_info (const SimOperator *op)
 Retrieve operator metadata.
 
void sim_operator_config_normalize (SimOperatorConfig *config)
 Convenience helpers for working with operator configuration payloads.
 
SimOperatorConfig sim_operator_config_defaults (void)
 
SimOperatorInfo sim_operator_info_defaults (void)
 
void sim_operator_info_normalize (SimOperatorInfo *info)
 
void sim_operator_info_set_identity (SimOperatorInfo *info, const char *schema_key, SimIROpcode ir_opcode)
 
void sim_operator_info_set_schema_identity (SimOperatorInfo *info, const char *schema_key)
 
const char * sim_operator_abstract_id (const struct SimOperator *op)
 
void sim_operator_set_schema_key (struct SimOperator *op, const char *schema_key)
 
void sim_operator_set_catalog_metadata (struct SimOperator *op, const void *metadata)
 
const void * sim_operator_catalog_metadata (const struct SimOperator *op)
 
const char * sim_operator_schema_key (const struct SimOperator *op)
 
const char * sim_operator_schema_key_or (const struct SimOperator *op, const char *fallback)
 
SimIROpcode sim_operator_ir_opcode (const struct SimOperator *op)
 
const SimOperatorRepresentationsim_operator_representation (const struct SimOperator *op)
 
const char * sim_operator_representation_domain_name (const struct SimOperator *op)
 
const char * sim_operator_representation_value_kind_name (const struct SimOperator *op)
 
const struct SimGraphIR * sim_operator_graph_ir (const struct SimOperator *op)
 
bool sim_operator_config_get (const SimOperator *op, SimOperatorConfig *out_config)
 
void sim_operator_config_set (struct SimOperator *op, const SimOperatorConfig *config)
 

Detailed Description

Operator abstraction, registry, and dependency resolution for libsimcore.

Operators are registered into a SimContext with explicit read/write field access, optional dependencies, metadata, and configuration. The scheduler uses those declarations to build deterministic execution order, while operator descriptors keep ownership boundaries clear: descriptors and arrays are copied as needed, but user payload lifetime remains the caller's responsibility unless a concrete operator documents otherwise.

Macro Definition Documentation

◆ SIM_NEURAL_CHANNEL_AXIS_AUTO

#define SIM_NEURAL_CHANNEL_AXIS_AUTO   255U

Automatic channel-axis selection for neural shape constraints.

◆ SIM_OPERATOR_MAX_INVARIANTS

#define SIM_OPERATOR_MAX_INVARIANTS   4U

Maximum invariants tracked inline per operator.

◆ SIM_OPERATOR_MAX_SPACING_DIMS

#define SIM_OPERATOR_MAX_SPACING_DIMS   4U

Maximum dimensions tracked for spacing metadata.

◆ SIM_OPERATOR_NAME_MAX

#define SIM_OPERATOR_NAME_MAX   63U

Maximum length for operator identifiers (excluding null terminator).

◆ SIM_OPERATOR_SCHEMA_KEY_MAX

#define SIM_OPERATOR_SCHEMA_KEY_MAX   127U

Maximum length for stable operator schema keys (excluding null terminator).

Typedef Documentation

◆ SimClockMode

typedef enum SimClockMode SimClockMode

Clock selection for time-sensitive operators.

Pure deterministic time: t = f(params) (rewind-safe, replayable, KernelIR-friendly). True accumulated time: t_{n+1} = t_n + dt_n (requires state, rewind policy-dependent).

CLOCK_FROM_TIME_PARAM: t = time param + offset (pure). CLOCK_FROM_STEP_PURE: t = step_index * nominal_dt + offset (pure). CLOCK_ACCUMULATED_STATEFUL: t accumulates with state (non-replayable).

◆ SimRepresentationMode

Representation mode governing determinism guarantees.

STRICT: deterministic, snapshot-friendly, IR/CPU parity, rewind-safe. RELAXED: mostly deterministic; permits limited conveniences. EXPLORATION: best-effort; stateful or non-replayable behavior permitted.

Enumeration Type Documentation

◆ SimClockMode

Clock selection for time-sensitive operators.

Pure deterministic time: t = f(params) (rewind-safe, replayable, KernelIR-friendly). True accumulated time: t_{n+1} = t_n + dt_n (requires state, rewind policy-dependent).

CLOCK_FROM_TIME_PARAM: t = time param + offset (pure). CLOCK_FROM_STEP_PURE: t = step_index * nominal_dt + offset (pure). CLOCK_ACCUMULATED_STATEFUL: t accumulates with state (non-replayable).

Enumerator
SIM_CLOCK_FROM_TIME_PARAM 

Derive time from runtime time parameter.

SIM_CLOCK_FROM_STEP_PURE 

Derive time from step index and nominal dt.

SIM_CLOCK_ACCUMULATED_STATEFUL 

Accumulate time inside operator state.

◆ SimContinuityLimiterStrategy

Limiter/clipper strategies engaged by continuity guards.

Enumerator
SIM_LIMITER_STRATEGY_HARD_CLIP 

Clamp values to configured hard bounds.

SIM_LIMITER_STRATEGY_SOFT_CLIP 

Smoothly compress values near bounds.

SIM_LIMITER_STRATEGY_SIGMOID_COMPRESSION 

Use sigmoid compression for singular neighborhoods.

SIM_LIMITER_STRATEGY_ADAPTIVE_BIAS 

Shift probe bias adaptively near singularities.

SIM_LIMITER_STRATEGY_STAT_AWARE 

Incorporate field statistics into limiter decisions.

SIM_LIMITER_STRATEGY_PER_FIELD_OVERRIDE 

Permit per-field limiter overrides.

◆ SimContinuityMode

Numerical continuity and stability policy.

Enumerator
SIM_CONTINUITY_NONE 

Disable all guards; raw kernel output.

SIM_CONTINUITY_STRICT 

Preserve analytic continuity; may emit NaN/Inf.

SIM_CONTINUITY_CLAMPED 

Clip to finite range near singularities.

SIM_CONTINUITY_LIMITED 

Blend asymptotic/analytic forms near threshold.

◆ SimDeterminismFlags

Determinism capability flags declared by operators.

Enumerator
SIM_DET_NONE 

No determinism guarantees declared.

SIM_DET_PURE_TIME 

Time is derived purely from runtime params.

SIM_DET_REWIND_SAFE 

Operator behavior is rewind-safe.

SIM_DET_NO_STATEFUL_NODES 

Operator does not rely on stateful nodes.

SIM_DET_DETERMINISTIC_RNG_ONLY 

RNG usage is deterministic and seed-driven.

◆ SimNeuralDeterminismPolicy

Determinism policy for neural inference operators.

Enumerator
SIM_NEURAL_DETERMINISM_INHERIT 

Defer to context/operator determinism mode.

SIM_NEURAL_DETERMINISM_STRICT 

Require strict deterministic inference path.

SIM_NEURAL_DETERMINISM_BEST_EFFORT 

Prefer deterministic path but allow fallback.

SIM_NEURAL_DETERMINISM_OFF 

Determinism not required for inference.

◆ SimNeuralDeviceRequirement

Device placement requirement for neural inference operators.

Enumerator
SIM_NEURAL_DEVICE_ANY 

Any available device is acceptable.

SIM_NEURAL_DEVICE_CPU_ONLY 

Must run on CPU.

SIM_NEURAL_DEVICE_ACCELERATOR_PREFERRED 

Prefer accelerator, fallback to CPU.

SIM_NEURAL_DEVICE_ACCELERATOR_REQUIRED 

Require accelerator device.

◆ SimNeuralPrecisionMode

Numeric precision policy for neural inference operators.

Enumerator
SIM_NEURAL_PRECISION_DEFAULT 

Runtime/provider default precision.

SIM_NEURAL_PRECISION_FP32 

32-bit floating-point inference.

SIM_NEURAL_PRECISION_FP64 

64-bit floating-point inference.

SIM_NEURAL_PRECISION_MIXED 

Backend-selected mixed precision.

SIM_NEURAL_PRECISION_FP16 

16-bit floating-point inference.

SIM_NEURAL_PRECISION_BF16 

bfloat16 inference.

◆ SimOperatorAlgebraicFlags

Algebraic property bitmask for operators.

Enumerator
SIM_OPERATOR_ALG_NONE 

No algebraic properties declared.

SIM_OPERATOR_ALG_LINEAR 

Purely linear mapping.

SIM_OPERATOR_ALG_AFFINE 

Affine (linear + bias).

SIM_OPERATOR_ALG_SELF_ADJOINT 

Self-adjoint / symmetric.

SIM_OPERATOR_ALG_PROJECTION 

Idempotent projection.

SIM_OPERATOR_ALG_COMMUTES_WITH_NOISE 

Commutes with stochastic noise injection.

SIM_OPERATOR_ALG_COMMUTES_WITH_BOUNDARY 

Commutes with boundary enforcement.

◆ SimOperatorCategory

Operator category for grouping and scheduling hints.

Enumerator
SIM_OPERATOR_CATEGORY_UNKNOWN 

Uncategorized operator.

SIM_OPERATOR_CATEGORY_DIFFUSION 

Diffusion, dissipation, linear damping.

SIM_OPERATOR_CATEGORY_ADVECTION 

Transport, advection, warp.

SIM_OPERATOR_CATEGORY_REACTION 

Nonlinear reaction terms (e.g., cubic).

SIM_OPERATOR_CATEGORY_POTENTIAL 

External potential application.

SIM_OPERATOR_CATEGORY_MEASUREMENT 

Measurement, projection, collapse.

SIM_OPERATOR_CATEGORY_COUPLING 

Field coupling, sieve operators.

SIM_OPERATOR_CATEGORY_NOISE 

Stochastic noise injection.

SIM_OPERATOR_CATEGORY_BOUNDARY 

Boundary condition enforcement.

SIM_OPERATOR_CATEGORY_THERMOSTAT 

Thermostat regulation operators.

SIM_OPERATOR_CATEGORY_UTILITY 

Utility operators (copy, scale, etc.).

SIM_OPERATOR_CATEGORY_NONLINEAR 

General nonlinear operators.

◆ SimOperatorInvariantKind

Supported invariant kinds for bookkeeping/diagnostics.

Enumerator
SIM_OPERATOR_INVARIANT_NONE 

No invariant declared.

SIM_OPERATOR_INVARIANT_L2_NORM 

L2 norm should remain within tolerance.

SIM_OPERATOR_INVARIANT_L1_NORM 

L1 norm should remain within tolerance.

SIM_OPERATOR_INVARIANT_ENERGY 

Energy should remain within tolerance.

SIM_OPERATOR_INVARIANT_MASS 

Mass/sum should remain within tolerance.

SIM_OPERATOR_INVARIANT_MEAN 

Mean value should remain within tolerance.

SIM_OPERATOR_INVARIANT_VARIANCE 

Variance should remain within tolerance.

◆ SimRepresentationMode

Representation mode governing determinism guarantees.

STRICT: deterministic, snapshot-friendly, IR/CPU parity, rewind-safe. RELAXED: mostly deterministic; permits limited conveniences. EXPLORATION: best-effort; stateful or non-replayable behavior permitted.

Enumerator
SIM_REPRESENTATION_MODE_STRICT 

Deterministic, replayable representation mode.

SIM_REPRESENTATION_MODE_RELAXED 

Mostly deterministic representation mode.

SIM_REPRESENTATION_MODE_EXPLORATION 

Best-effort exploratory representation mode.

Function Documentation

◆ sim_operator_dependencies()

void sim_operator_dependencies ( const SimOperator op,
const size_t **  out_deps,
size_t *  out_count 
)

Access operator dependency list.

Parameters
opOperator instance.
[out]out_depsPointer receiving dependency array (owned by op).
[out]out_countPointer receiving dependency count.

◆ sim_operator_info()

SimOperatorInfo sim_operator_info ( const SimOperator op)

Retrieve operator metadata.

Parameters
opOperator instance.
Returns
Operator metadata structure.

◆ sim_operator_name()

const char * sim_operator_name ( const SimOperator op)

Retrieve the operator name.

Parameters
opOperator instance.
Returns
Null-terminated operator name.

◆ sim_operator_payload()

void * sim_operator_payload ( SimOperator op)

Retrieve the internal user payload.

Parameters
opOperator instance.
Returns
User-provided pointer.

◆ sim_operator_plan_destroy()

void sim_operator_plan_destroy ( SimOperatorPlan plan)

Release resources owned by a plan.

Parameters
planPlan to destroy; may be NULL.

◆ sim_operator_registry_destroy()

void sim_operator_registry_destroy ( SimOperatorRegistry registry)

Release all operators contained in a registry.

Parameters
registryRegistry to tear down.

◆ sim_operator_registry_get()

SimOperator * sim_operator_registry_get ( SimOperatorRegistry registry,
size_t  index 
)

Lookup an operator by index.

Parameters
registryRegistry instance.
indexOperator index.
Returns
Pointer to the operator, or NULL if not found.

◆ sim_operator_registry_init()

SimResult sim_operator_registry_init ( SimOperatorRegistry registry)

Initialize an empty registry.

Parameters
[out]registryTarget registry.
Returns
SIM_RESULT_OK on success.

◆ sim_operator_registry_register()

SimResult sim_operator_registry_register ( SimOperatorRegistry registry,
const SimOperatorDescriptor descriptor,
size_t *  out_index 
)

Register a new operator.

Parameters
registryTarget registry.
descriptorOperator descriptor; all strings are copied.
[out]out_indexOptional pointer receiving the assigned index.
Returns
SIM_RESULT_OK on success or an error code.

◆ sim_operator_resolve_plan_with_logger()

SimResult sim_operator_resolve_plan_with_logger ( const SimOperatorRegistry registry,
SimOperatorPlan plan,
SimOperatorCycleLogFn  logger,
void *  logger_userdata 
)

Resolve an execution plan for the registry.

Parameters
registryRegistry instance.
[out]planExecution plan to populate.
loggerOptional callback for dependency-cycle diagnostics.
logger_userdataOpaque pointer forwarded to logger.
Returns
SIM_RESULT_OK on success or SIM_RESULT_DEPENDENCY_ERROR when cycles exist.