OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
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
 Convert a PluginState to a human-readable string.
 
bool openswmm::plugin_state_transition_valid (PluginState from, PluginState to) noexcept
 Check whether a state transition is valid.
 

Detailed Description

Plugin lifecycle state enumerator.

Defines the states that an output or report plugin can occupy. The PluginFactory enforces valid state transitions and calls the appropriate lifecycle methods in order.

State machine diagram

UNLOADED ──── (dlopen) ─────► LOADED
initialize()
INITIALIZED
validate()
VALIDATED
prepare()
PREPARED ◄─────────────┐
│ │
update() ────────► UPDATING
│ │
finalize() (return)
FINALIZED
(dlclose)
CLOSED
Any state ──── (error) ──────► ERROR