Skip to content

tenzr::OpRegistry

Process-wide registry of custom operator definitions, keyed by name.

#include <op_registry.h>

Public Functions

Name
OpRegistry & Instance()
The process-wide singleton registry.
void RegisterOp(OpDef def)
Add or replace the definition def.
const OpDef * Lookup(std::string_view name) const
Look up name, or nullptr when unknown.
bool HasOp(std::string_view name) const
Whether an operator named name is registered.
std::vector< std::string > RegisteredOps() const
Names of all registered operators.

Public Functions Documentation

function Instance

static OpRegistry & Instance()

The process-wide singleton registry.

Return: Reference to the singleton OpRegistry.

Get the process-wide operator registry.

function RegisterOp

void RegisterOp(
    OpDef def
)

Add or replace the definition def.

Parameters:

  • def Operator definition to store.

Add or replace an operator, filling in category-appropriate default inference functions.

function Lookup

const OpDef * Lookup(
    std::string_view name
) const

Look up name, or nullptr when unknown.

Parameters:

  • name Operator name.

Return: Pointer to the definition, or nullptr when absent.

Find an operator definition by name.

function HasOp

bool HasOp(
    std::string_view name
) const

Whether an operator named name is registered.

Parameters:

  • name Operator name.

Return: true when present.

Test whether an operator is registered.

function RegisteredOps

std::vector< std::string > RegisteredOps() const

Names of all registered operators.

Return: Sorted operator names.

List the names of all registered operators, sorted alphabetically.