OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::components::ProcessComponentRegistry Class Reference

Process-global id → entry table. More...

#include <ProcessComponentRegistry.hpp>

Collaboration diagram for openswmm::components::ProcessComponentRegistry:

Public Member Functions

void register_component (const std::string &id, std::string description, ComponentConfigApply apply, ComponentConfigSave save=nullptr)
 Insert or replace a complete component-hook entry and clear its pending phase.
 
const ProcessComponentEntry * find (const std::string &id) const
 Borrow one exact component registry entry.
 
std::vector< std::string > known_ids () const
 Copy every registered key, including planned entries without apply hooks.
 

Static Public Member Functions

static ProcessComponentRegistry & instance ()
 Access the process-global lazily constructed builtin hook registry.
 

Detailed Description

Process-global id → entry table.

Planned built-in ids are pre-seeded (see the .cpp); implemented components overwrite their entry via register_component() at engine static-init or test setup. Not thread-safe for registration (register at startup only).

Member Function Documentation

◆ find()

const ProcessComponentEntry * openswmm::components::ProcessComponentRegistry::find ( const std::string & id) const

Borrow one exact component registry entry.

Parameters
idCase-sensitive key; no path or version parsing is applied.
Returns
Owned map-entry pointer, or null. Other map insertions preserve addresses, but replacement changes that entry's contents; serialize registration/use.
Here is the caller graph for this function:

◆ instance()

ProcessComponentRegistry & openswmm::components::ProcessComponentRegistry::instance ( )
static

Access the process-global lazily constructed builtin hook registry.

Returns
Borrowed singleton; caller serializes registration with all lookup/use. Initial construction is thread-safe, subsequent map mutation is not.
Here is the caller graph for this function:

◆ known_ids()

std::vector< std::string > openswmm::components::ProcessComponentRegistry::known_ids ( ) const

Copy every registered key, including planned entries without apply hooks.

Returns
Independent lexicographically map-ordered keys; does not load libraries.
Here is the caller graph for this function:

◆ register_component()

void openswmm::components::ProcessComponentRegistry::register_component ( const std::string & id,
std::string description,
ComponentConfigApply apply,
ComponentConfigSave save = nullptr )

Insert or replace a complete component-hook entry and clear its pending phase.

Parameters
idExact case-sensitive key, copied without empty/duplicate validation.
descriptionHuman-readable description moved into storage.
applyRequired callable for an implemented entry; no nonnull check occurs. Hooks receive mutable engine state and are expected to append diagnostics rather than throw, though this registry installs no exception boundary.
saveOptional serialization hook moved into storage; null declines authored serialization and lets the writer use its file-copy fallback. Register at startup with no concurrent readers; replacement invalidates prior hook assumptions.
Here is the caller graph for this function:

The documentation for this class was generated from the following files: