#include <gtopt/element_traits.hpp>
template<typename SystemContext SystemContext>
ElementTraits<SystemContext, BusLP> struct
Specialization of ElementTraits for BusLP elements.
| Template parameters | |
|---|---|
| SystemContext | The context providing access to the system model. |
This specialization handles the unique way BusLP elements are accessed, such as using dedicated get_bus_index and get_bus methods on the SystemContext.
Public static functions
- static auto get_element(SystemContext& sc, const ElementIndex<BusType>& id) -> constexpr auto&&
- Gets a reference to a bus element by its
ElementIndex. - static auto get_element(SystemContext& sc, const ObjectSingleId<BusLP>& id) -> constexpr auto&&
- Gets a reference to a
BusLPelement by its single ID. - static auto get_element_index(SystemContext& sc, const ObjectSingleId<BusLP>& id) -> constexpr auto
- Gets the index of a
BusLPelement by its ID. - static auto get_elements(SystemContext& sc) -> constexpr auto&& noexcept
- Gets a container of all
BusLPelements. -
template<typename ElementType2 ElementType2>static auto push_back(SystemContext& sc, ElementType2&& e) -> constexpr auto
- Adds a new
BusLPelement to the system.
Function documentation
static constexpr auto&& gtopt:: ElementTraits<SystemContext, BusLP><SystemContext>:: get_element(SystemContext& sc,
const ElementIndex<BusType>& id)
Gets a reference to a bus element by its ElementIndex.
| Parameters | |
|---|---|
| sc | The system context. |
| id | The index of the bus element. |
| Returns | A reference to the bus element. |
Routes through sc.get_element(id) — a fully-inline template using void* dispatch — so that callers do not need to include system_lp.hpp.
template<typename SystemContext SystemContext>
static constexpr auto&& gtopt:: ElementTraits<SystemContext, BusLP><SystemContext>:: get_element(SystemContext& sc,
const ObjectSingleId<BusLP>& id)
Gets a reference to a BusLP element by its single ID.
| Parameters | |
|---|---|
| sc | The system context. |
| id | The single ID of the BusLP element. |
| Returns | A reference to the BusLP element. |
template<typename SystemContext SystemContext>
static constexpr auto gtopt:: ElementTraits<SystemContext, BusLP><SystemContext>:: get_element_index(SystemContext& sc,
const ObjectSingleId<BusLP>& id)
Gets the index of a BusLP element by its ID.
| Parameters | |
|---|---|
| sc | The system context. |
| id | The single ID of the BusLP element. |
| Returns | The ElementIndex for the given ID. |
template<typename SystemContext SystemContext>
static constexpr auto&& gtopt:: ElementTraits<SystemContext, BusLP><SystemContext>:: get_elements(SystemContext& sc) noexcept
Gets a container of all BusLP elements.
| Parameters | |
|---|---|
| sc | The system context. |
| Returns | A reference to the container of BusLP elements. |
static constexpr auto gtopt:: ElementTraits<SystemContext, BusLP><SystemContext>:: push_back(SystemContext& sc,
ElementType2&& e)
Adds a new BusLP element to the system.
| Parameters | |
|---|---|
| sc | The system context. |
| e | The BusLP element to add. |
| Returns | The ElementIndex of the newly added element. |