OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm_process_components.h File Reference

C API — [PROCESS_COMPONENTS] registrations (E-C3 subset of the transport IO plan §5): enumerate, find, register, remove. More...

#include "openswmm_engine.h"
Include dependency graph for openswmm_process_components.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

SWMM_ENGINE_API int swmm_process_component_count (SWMM_Engine engine)
 Number of [PROCESS_COMPONENTS] registrations. -1 on bad handle.
 
SWMM_ENGINE_API int swmm_process_component_get (SWMM_Engine engine, int idx, char *id_buf, int id_len, char *config_buf, int config_len, char *resolved_buf, int resolved_len)
 Read one registration.
 
SWMM_ENGINE_API int swmm_process_component_find (SWMM_Engine engine, const char *id)
 Registration index for id, or -1.
 
SWMM_ENGINE_API int swmm_process_component_register (SWMM_Engine engine, const char *id, const char *config_path)
 Register a component (BUILDING/OPENED). Duplicate id refused. The config file need not exist yet.
 
SWMM_ENGINE_API int swmm_process_component_remove (SWMM_Engine engine, int idx)
 Remove registration idx (BUILDING/OPENED). Indexes shift.
 
SWMM_ENGINE_API int swmm_process_component_known_count (void)
 Number of built-in component ids.
 
SWMM_ENGINE_API int swmm_process_component_known_get (int idx, char *id_buf, int id_len, char *desc_buf, int desc_len, int *implemented)
 Read built-in id idx.
 

Detailed Description

C API — [PROCESS_COMPONENTS] registrations (E-C3 subset of the transport IO plan §5): enumerate, find, register, remove.

The GUI's file-binding surface: an editor locates its component's config path here, and the "create component + config file" flow registers first, then writes the file (registration with a not-yet-existing config path is legal — resolve reads it at the next open).

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n Apache-2.0

Function Documentation

◆ swmm_process_component_count()

SWMM_ENGINE_API int swmm_process_component_count ( SWMM_Engine engine)

Number of [PROCESS_COMPONENTS] registrations. -1 on bad handle.

◆ swmm_process_component_find()

SWMM_ENGINE_API int swmm_process_component_find ( SWMM_Engine engine,
const char * id )

Registration index for id, or -1.

Here is the caller graph for this function:

◆ swmm_process_component_get()

SWMM_ENGINE_API int swmm_process_component_get ( SWMM_Engine engine,
int idx,
char * id_buf,
int id_len,
char * config_buf,
int config_len,
char * resolved_buf,
int resolved_len )

Read one registration.

Parameters
id_buf[out] Component id (NUL-terminated).
config_buf[out] The config="…" argument as written (may be "").
resolved_buf[out] Effective path the config was READ from at the last open ("" until resolution).

◆ swmm_process_component_known_count()

SWMM_ENGINE_API int swmm_process_component_known_count ( void )

Number of built-in component ids.

Here is the call graph for this function:

◆ swmm_process_component_known_get()

SWMM_ENGINE_API int swmm_process_component_known_get ( int idx,
char * id_buf,
int id_len,
char * desc_buf,
int desc_len,
int * implemented )

Read built-in id idx.

Parameters
id_buf[out] The id (e.g. "org.hydrocouple.openswmm.reactions").
desc_buf[out] Short description.
implemented[out] 1 when the component has an apply hook in this build, 0 when it is a planned placeholder (its registration line is diagnosed at open).
Here is the call graph for this function:

◆ swmm_process_component_register()

SWMM_ENGINE_API int swmm_process_component_register ( SWMM_Engine engine,
const char * id,
const char * config_path )

Register a component (BUILDING/OPENED). Duplicate id refused. The config file need not exist yet.

Here is the call graph for this function:

◆ swmm_process_component_remove()

SWMM_ENGINE_API int swmm_process_component_remove ( SWMM_Engine engine,
int idx )

Remove registration idx (BUILDING/OPENED). Indexes shift.