File tree Expand file tree Collapse file tree 3 files changed +27
-17
lines changed
power_grid_model_c/power_grid_model/include/power_grid_model/main_core Expand file tree Collapse file tree 3 files changed +27
-17
lines changed Original file line number Diff line number Diff line change 1+
2+ // SPDX-FileCopyrightText: Contributors to the Power Grid Model project <[email protected] >3+ //
4+ // SPDX-License-Identifier: MPL-2.0
5+
6+ #pragma once
7+
8+ #include " ../container.hpp"
9+
10+ namespace power_grid_model ::main_core {
11+
12+ // TODO Reconfirm if there is duplication with state_queries and if we can remove either one of them
13+
14+ template <typename ComponentType, class ComponentContainer >
15+ requires extended_component_container_c<ComponentContainer, ComponentType>
16+ constexpr auto get_component_size (ComponentContainer const & components) {
17+ return components.template size <ComponentType>();
18+ }
19+
20+ template <typename ComponentType, class ComponentContainer >
21+ requires extended_component_container_c<ComponentContainer, ComponentType>
22+ inline Idx get_component_sequence_idx (ComponentContainer const & components, auto const & id_or_index) {
23+ return components.template get_seq <ComponentType>(id_or_index);
24+ }
25+
26+ } // namespace power_grid_model::main_core
Original file line number Diff line number Diff line change 1010
1111namespace power_grid_model ::main_core {
1212
13- // using only components and not state
14-
15- template <typename ComponentType, class ComponentContainer >
16- requires extended_component_container_c<ComponentContainer, ComponentType>
17- constexpr auto get_component_size (ComponentContainer const & components) {
18- return components.template size <ComponentType>();
19- }
20-
21- template <typename ComponentType, class ComponentContainer >
22- requires extended_component_container_c<ComponentContainer, ComponentType>
23- inline Idx get_component_sequence_idx (ComponentContainer const & components, auto const & id_or_index) {
24- return components.template get_seq <ComponentType>(id_or_index);
25- }
26-
27- // existing implementation
28-
2913template <typename ComponentType, class ComponentContainer >
3014 requires model_component_state_c<MainModelState, ComponentContainer, ComponentType>
3115inline Idx get_component_type_index (MainModelState<ComponentContainer> const & state) {
Original file line number Diff line number Diff line change 44
55#pragma once
66
7+ #include " container_queries.hpp"
78#include " state.hpp"
8- #include " state_queries.hpp"
99
1010#include " ../all_components.hpp"
1111
You can’t perform that action at this time.
0 commit comments