OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm_engine_impl.cpp File Reference

C API implementation — engine lifecycle, callbacks, errors, timing. More...

Include dependency graph for openswmm_engine_impl.cpp:

Functions

SWMM_ENGINE_API SWMM_Engine swmm_engine_create (void)
 Create a new engine instance (SWMM_STATE_CREATED).
 
SWMM_ENGINE_API int swmm_engine_open (SWMM_Engine engine, const char *inp, const char *rpt, const char *out)
 Open and parse a SWMM input file; load plugins → SWMM_STATE_OPENED.
 
SWMM_ENGINE_API int swmm_engine_initialize (SWMM_Engine engine)
 Initialize the simulation → SWMM_STATE_INITIALIZED.
 
SWMM_ENGINE_API int swmm_engine_start (SWMM_Engine engine, int save_results)
 Start the simulation → SWMM_STATE_STARTED.
 
SWMM_ENGINE_API int swmm_engine_step (SWMM_Engine engine, double *elapsed_time)
 Advance one explicit timestep. elapsed_time==0 when done.
 
SWMM_ENGINE_API int swmm_engine_end (SWMM_Engine engine)
 End the simulation → SWMM_STATE_ENDED.
 
SWMM_ENGINE_API int swmm_engine_report (SWMM_Engine engine)
 Write summary report (SWMM_STATE_ENDED).
 
SWMM_ENGINE_API int swmm_engine_close (SWMM_Engine engine)
 Close all files → SWMM_STATE_CLOSED.
 
SWMM_ENGINE_API void swmm_engine_destroy (SWMM_Engine engine)
 Destroy the engine handle (any state, NULL safe).
 
SWMM_ENGINE_API int swmm_engine_get_state (SWMM_Engine engine, int *state)
 Query the current engine lifecycle state.
 
SWMM_ENGINE_API int swmm_set_progress_callback (SWMM_Engine engine, SWMM_ProgressCallback callback, void *user_data)
 
SWMM_ENGINE_API int swmm_set_warning_callback (SWMM_Engine engine, SWMM_WarningCallback callback, void *user_data)
 
SWMM_ENGINE_API int swmm_set_step_begin_callback (SWMM_Engine engine, SWMM_StepBeginCallback callback, void *user_data)
 
SWMM_ENGINE_API int swmm_set_step_end_callback (SWMM_Engine engine, SWMM_StepEndCallback callback, void *user_data)
 
SWMM_ENGINE_API int swmm_get_last_error (SWMM_Engine engine)
 
SWMM_ENGINE_API const char * swmm_get_last_error_msg (SWMM_Engine engine)
 
SWMM_ENGINE_API const char * swmm_error_message (int code)
 
SWMM_ENGINE_API int swmm_get_start_time (SWMM_Engine engine, double *start)
 
SWMM_ENGINE_API int swmm_get_end_time (SWMM_Engine engine, double *end)
 
SWMM_ENGINE_API int swmm_get_current_time (SWMM_Engine engine, double *current)
 
SWMM_ENGINE_API int swmm_get_routing_step (SWMM_Engine engine, double *dt)
 

Detailed Description

C API implementation — engine lifecycle, callbacks, errors, timing.

See also
include/openswmm/engine/openswmm_engine.h
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License

Function Documentation

◆ swmm_engine_close()

SWMM_ENGINE_API int swmm_engine_close ( SWMM_Engine  engine)

Close all files → SWMM_STATE_CLOSED.

◆ swmm_engine_create()

SWMM_ENGINE_API SWMM_Engine swmm_engine_create ( void  )

Create a new engine instance (SWMM_STATE_CREATED).

◆ swmm_engine_destroy()

SWMM_ENGINE_API void swmm_engine_destroy ( SWMM_Engine  engine)

Destroy the engine handle (any state, NULL safe).

◆ swmm_engine_end()

SWMM_ENGINE_API int swmm_engine_end ( SWMM_Engine  engine)

End the simulation → SWMM_STATE_ENDED.

◆ swmm_engine_get_state()

SWMM_ENGINE_API int swmm_engine_get_state ( SWMM_Engine  engine,
int *  state 
)

Query the current engine lifecycle state.

◆ swmm_engine_initialize()

SWMM_ENGINE_API int swmm_engine_initialize ( SWMM_Engine  engine)

Initialize the simulation → SWMM_STATE_INITIALIZED.

◆ swmm_engine_open()

SWMM_ENGINE_API int swmm_engine_open ( SWMM_Engine  engine,
const char *  inp,
const char *  rpt,
const char *  out 
)

Open and parse a SWMM input file; load plugins → SWMM_STATE_OPENED.

◆ swmm_engine_report()

SWMM_ENGINE_API int swmm_engine_report ( SWMM_Engine  engine)

Write summary report (SWMM_STATE_ENDED).

◆ swmm_engine_start()

SWMM_ENGINE_API int swmm_engine_start ( SWMM_Engine  engine,
int  save_results 
)

Start the simulation → SWMM_STATE_STARTED.

◆ swmm_engine_step()

SWMM_ENGINE_API int swmm_engine_step ( SWMM_Engine  engine,
double *  elapsed_time 
)

Advance one explicit timestep. elapsed_time==0 when done.

◆ swmm_error_message()

SWMM_ENGINE_API const char * swmm_error_message ( int  code)

◆ swmm_get_current_time()

SWMM_ENGINE_API int swmm_get_current_time ( SWMM_Engine  engine,
double *  current 
)

◆ swmm_get_end_time()

SWMM_ENGINE_API int swmm_get_end_time ( SWMM_Engine  engine,
double *  end 
)

◆ swmm_get_last_error()

SWMM_ENGINE_API int swmm_get_last_error ( SWMM_Engine  engine)

◆ swmm_get_last_error_msg()

SWMM_ENGINE_API const char * swmm_get_last_error_msg ( SWMM_Engine  engine)

◆ swmm_get_routing_step()

SWMM_ENGINE_API int swmm_get_routing_step ( SWMM_Engine  engine,
double *  dt 
)

◆ swmm_get_start_time()

SWMM_ENGINE_API int swmm_get_start_time ( SWMM_Engine  engine,
double *  start 
)

◆ swmm_set_progress_callback()

SWMM_ENGINE_API int swmm_set_progress_callback ( SWMM_Engine  engine,
SWMM_ProgressCallback  callback,
void *  user_data 
)

◆ swmm_set_step_begin_callback()

SWMM_ENGINE_API int swmm_set_step_begin_callback ( SWMM_Engine  engine,
SWMM_StepBeginCallback  callback,
void *  user_data 
)

◆ swmm_set_step_end_callback()

SWMM_ENGINE_API int swmm_set_step_end_callback ( SWMM_Engine  engine,
SWMM_StepEndCallback  callback,
void *  user_data 
)

◆ swmm_set_warning_callback()

SWMM_ENGINE_API int swmm_set_warning_callback ( SWMM_Engine  engine,
SWMM_WarningCallback  callback,
void *  user_data 
)