gtopt/carrier.hpp file

Energy-carrier tag for Node<> templated balance nodes.

Defines the Carrier enum used as the template parameter for the generic Node<C> balance-node template (see node.hpp). The enum is the single source of truth for which energy carrier a node (and any storage / generator / converter attached to it) operates on. Cross-carrier wiring is rejected at compile time by the C++ type system — there are no runtime carrier string compares.

Reserved values:

  • Electric — the legacy Bus class will be refactored to Node<Carrier::Electric> in a follow-up pass.
  • Water — the legacy Junction class will be refactored to Node<Carrier::Water> in a follow-up pass.

New carriers (Hydrogen, Thermal) get their own typed HydrogenNode / ThermalNode concrete classes that inherit from the generic template — see hydrogen_node.hpp and thermal_node.hpp.

Namespaces

namespace gtopt