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

Plugin lifecycle state enumerator. More...

#include <cstdint>
Include dependency graph for PluginState.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  openswmm
 

Enumerations

enum class  openswmm::PluginState : std::int32_t {
  openswmm::PluginState::UNLOADED = 0 ,
  openswmm::PluginState::LOADED = 1 ,
  openswmm::PluginState::INITIALIZED = 2 ,
  openswmm::PluginState::VALIDATED = 3 ,
  openswmm::PluginState::PREPARED = 4 ,
  openswmm::PluginState::UPDATING = 5 ,
  openswmm::PluginState::FINALIZED = 6 ,
  openswmm::PluginState::CLOSED = 7 ,
  openswmm::PluginState::ERROR = -1
}
 Plugin lifecycle states. More...
 

Functions

const char * openswmm::plugin_state_to_string (PluginState state) noexcept
 Read the static spelling of one lifecycle enum.
 
bool openswmm::plugin_state_transition_valid (PluginState from, PluginState to) noexcept
 Query the standalone lifecycle transition policy without applying it.
 

Detailed Description

Plugin lifecycle state enumerator.

Defines the states that an output or report plugin can occupy. PluginFactory gates selected callbacks using reported states, while implementations maintain their transitions. The helper below is a policy query; it does not change state or enforce calls.

State machine diagram

UNLOADED ──── (dlopen) ─────► LOADED
│
initialize()
│
▼
INITIALIZED
│
validate()
│
▼
VALIDATED
│
prepare()
│
▼
PREPARED ◄─────────────┐
│ │
update() ────────► UPDATING
│ │
finalize() (return)
│
▼
FINALIZED
│
(dlclose)
│
▼
CLOSED
Any state ──── (error) ──────► ERROR
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License
Apache-2.0