Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/optimize headers #502

Merged
merged 23 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@

// clang-format off
#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_{{ include_guard }}_HPP
#define POWER_GRID_MODEL_AUXILIARY_{{ include_guard }}_HPP

#include "meta_data.hpp"

#include "../enum.hpp"
#include "../power_grid_model.hpp"
#include "../three_phase_tensor.hpp"
#include "../common/common.hpp"
#include "../common/enum.hpp"
#include "../common/three_phase_tensor.hpp"

namespace power_grid_model {

Expand Down Expand Up @@ -41,5 +39,4 @@ using Asym{{ attribute_class.name }} = {{ attribute_class.name }}<false>;

} // namespace power_grid_model

#endif
// clang-format on
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

// clang-format off
#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_META_GEN_{{ include_guard }}_HPP
#define POWER_GRID_MODEL_AUXILIARY_META_GEN_{{ include_guard }}_HPP

#include "gen_getters.hpp" // NOLINT

#include "../../enum.hpp" // NOLINT
#include "../../power_grid_model.hpp" // NOLINT
#include "../../three_phase_tensor.hpp" // NOLINT
#include "../meta_data.hpp" // NOLINT
#include "../../common/common.hpp" // NOLINT
#include "../../common/enum.hpp" // NOLINT
#include "../../common/three_phase_tensor.hpp" // NOLINT
#include "../meta_data.hpp" // NOLINT

#include "../{{ name }}.hpp" // NOLINT


Expand Down Expand Up @@ -66,5 +65,4 @@ struct get_component_nan<{{ attribute_class.name }}> {

} // namespace power_grid_model::meta_data

#endif
// clang-format on
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

// clang-format off
#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_STATIC_ASSERTS_{{ include_guard }}_HPP
#define POWER_GRID_MODEL_AUXILIARY_STATIC_ASSERTS_{{ include_guard }}_HPP

#include "../{{ name }}.hpp" // NOLINT

Expand Down Expand Up @@ -35,5 +33,4 @@ static_assert(offsetof({{ specification }}, {{ attribute.names }}) == offsetof({

} // namespace power_grid_model::test

#endif
// clang-format on
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
// SPDX-License-Identifier: MPL-2.0

#pragma once
#ifndef POWER_GRID_MODEL_ALL_COMPONENTS_HPP
#define POWER_GRID_MODEL_ALL_COMPONENTS_HPP

// define all components
#include "power_grid_model.hpp"
#include "common/common.hpp"
#include "common/component_list.hpp"
// component include
#include "component/appliance.hpp"
#include "component/fault.hpp"
Expand All @@ -30,5 +29,3 @@ using AllComponents =
SymLoad, AsymLoad, SymPowerSensor, AsymPowerSensor, SymVoltageSensor, AsymVoltageSensor, Fault>;

} // namespace power_grid_model

#endif // POWER_GRID_MODEL_ALL_COMPONENTS_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
// SPDX-License-Identifier: MPL-2.0

#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_DATASET_HPP
#define POWER_GRID_MODEL_AUXILIARY_DATASET_HPP

// define dataset classes with void pointers

#include "../power_grid_model.hpp"
#include "../common/common.hpp"

#include <cassert>
#include <map>

namespace power_grid_model {

Expand Down Expand Up @@ -104,5 +105,3 @@ using Dataset = std::map<std::string, MutableDataPointer>;
using ConstDataset = std::map<std::string, ConstDataPointer>;

} // namespace power_grid_model

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
// SPDX-License-Identifier: MPL-2.0

#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_DATASET_HANDLER_HPP
#define POWER_GRID_MODEL_AUXILIARY_DATASET_HANDLER_HPP

// handle dataset and buffer related stuff

#include "../exception.hpp"
#include "../power_grid_model.hpp"
#include "../common/common.hpp"
#include "../common/exception.hpp"
#include "dataset.hpp"
#include "meta_data.hpp"
#include "meta_data_gen.hpp"
Expand Down Expand Up @@ -202,5 +200,3 @@ using MutableDatasetHandler = DatasetHandler<true, false>;
using WritableDatasetHandler = DatasetHandler<true, true>;

} // namespace power_grid_model::meta_data

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@

// clang-format off
#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_INPUT_HPP
#define POWER_GRID_MODEL_AUXILIARY_INPUT_HPP

#include "meta_data.hpp"

#include "../enum.hpp"
#include "../power_grid_model.hpp"
#include "../three_phase_tensor.hpp"
#include "../common/common.hpp"
#include "../common/enum.hpp"
#include "../common/three_phase_tensor.hpp"

namespace power_grid_model {

Expand Down Expand Up @@ -392,5 +390,4 @@ struct FaultInput {

} // namespace power_grid_model

#endif
// clang-format on
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
// SPDX-License-Identifier: MPL-2.0

#pragma once
#ifndef POWER_GRID_MODEL_META_DATA_HPP
#define POWER_GRID_MODEL_META_DATA_HPP

#include "../enum.hpp"
#include "../exception.hpp"
#include "../power_grid_model.hpp"
#include "../three_phase_tensor.hpp"
#include "../common/common.hpp"
#include "../common/enum.hpp"
#include "../common/exception.hpp"
#include "../common/three_phase_tensor.hpp"

#include <bit>
#include <span>
Expand Down Expand Up @@ -191,5 +189,3 @@ struct MetaData {
constexpr bool is_little_endian() { return std::endian::native == std::endian::little; }

} // namespace power_grid_model::meta_data

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// SPDX-License-Identifier: MPL-2.0

#pragma once
#ifndef POWER_GRID_MODEL_META_DATA_GEN_HPP
#define POWER_GRID_MODEL_META_DATA_GEN_HPP

#include "input.hpp"
#include "meta_data.hpp"
Expand All @@ -16,7 +14,7 @@
#include "update.hpp"

#include "../all_components.hpp"
#include "../power_grid_model.hpp"
#include "../common/common.hpp"

#include <map>
#include <string>
Expand Down Expand Up @@ -58,5 +56,3 @@ constexpr MetaData meta_data = get_meta_data<AllComponents, // all components li
constexpr MetaData meta_data = meta_data_gen::meta_data;

} // namespace power_grid_model::meta_data

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// SPDX-License-Identifier: MPL-2.0

#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_META_GEN_GEN_GETTERS_HPP
#define POWER_GRID_MODEL_AUXILIARY_META_GEN_GEN_GETTERS_HPP

#include "../../common/component_list.hpp"
#include "../../common/counting_iterator.hpp"
#include "../meta_data.hpp"

namespace power_grid_model::meta_data::meta_data_gen {
Expand Down Expand Up @@ -96,5 +96,3 @@ struct get_meta_data<comp_list, dataset_mark<dataset_name_getter, struct_getter>
};

} // namespace power_grid_model::meta_data::meta_data_gen

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

// clang-format off
#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_META_GEN_INPUT_HPP
#define POWER_GRID_MODEL_AUXILIARY_META_GEN_INPUT_HPP

#include "gen_getters.hpp" // NOLINT

#include "../../enum.hpp" // NOLINT
#include "../../power_grid_model.hpp" // NOLINT
#include "../../three_phase_tensor.hpp" // NOLINT
#include "../meta_data.hpp" // NOLINT
#include "../../common/common.hpp" // NOLINT
#include "../../common/enum.hpp" // NOLINT
#include "../../common/three_phase_tensor.hpp" // NOLINT
#include "../meta_data.hpp" // NOLINT

#include "../input.hpp" // NOLINT


Expand Down Expand Up @@ -712,5 +711,4 @@ struct get_component_nan<FaultInput> {

} // namespace power_grid_model::meta_data

#endif
// clang-format on
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

// clang-format off
#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_META_GEN_OUTPUT_HPP
#define POWER_GRID_MODEL_AUXILIARY_META_GEN_OUTPUT_HPP

#include "gen_getters.hpp" // NOLINT

#include "../../enum.hpp" // NOLINT
#include "../../power_grid_model.hpp" // NOLINT
#include "../../three_phase_tensor.hpp" // NOLINT
#include "../meta_data.hpp" // NOLINT
#include "../../common/common.hpp" // NOLINT
#include "../../common/enum.hpp" // NOLINT
#include "../../common/three_phase_tensor.hpp" // NOLINT
#include "../meta_data.hpp" // NOLINT

#include "../output.hpp" // NOLINT


Expand Down Expand Up @@ -444,5 +443,4 @@ struct get_component_nan<SensorShortCircuitOutput> {

} // namespace power_grid_model::meta_data

#endif
// clang-format on
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

// clang-format off
#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_META_GEN_UPDATE_HPP
#define POWER_GRID_MODEL_AUXILIARY_META_GEN_UPDATE_HPP

#include "gen_getters.hpp" // NOLINT

#include "../../enum.hpp" // NOLINT
#include "../../power_grid_model.hpp" // NOLINT
#include "../../three_phase_tensor.hpp" // NOLINT
#include "../meta_data.hpp" // NOLINT
#include "../../common/common.hpp" // NOLINT
#include "../../common/enum.hpp" // NOLINT
#include "../../common/three_phase_tensor.hpp" // NOLINT
#include "../meta_data.hpp" // NOLINT

#include "../update.hpp" // NOLINT


Expand Down Expand Up @@ -346,5 +345,4 @@ struct get_component_nan<FaultUpdate> {

} // namespace power_grid_model::meta_data

#endif
// clang-format on
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@

// clang-format off
#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_OUTPUT_HPP
#define POWER_GRID_MODEL_AUXILIARY_OUTPUT_HPP

#include "meta_data.hpp"

#include "../enum.hpp"
#include "../power_grid_model.hpp"
#include "../three_phase_tensor.hpp"
#include "../common/common.hpp"
#include "../common/enum.hpp"
#include "../common/three_phase_tensor.hpp"

namespace power_grid_model {

Expand Down Expand Up @@ -220,5 +218,4 @@ struct SensorShortCircuitOutput {

} // namespace power_grid_model

#endif
// clang-format on
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
// SPDX-License-Identifier: MPL-2.0

#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_SERIALIZTION_DESERIALIZER_HPP
#define POWER_GRID_MODEL_AUXILIARY_SERIALIZTION_DESERIALIZER_HPP

#include "../../exception.hpp"
#include "../../power_grid_model.hpp"
#include "../../common/common.hpp"
#include "../../common/exception.hpp"
#include "../dataset_handler.hpp"
#include "../meta_data.hpp"
#include "../meta_data_gen.hpp"
Expand Down Expand Up @@ -844,5 +842,3 @@ class Deserializer {
};

} // namespace power_grid_model::meta_data

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
// SPDX-License-Identifier: MPL-2.0

#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_SERIALIZTION_SERIALIZER_HPP
#define POWER_GRID_MODEL_AUXILIARY_SERIALIZTION_SERIALIZER_HPP

#include "../../exception.hpp"
#include "../../power_grid_model.hpp"
#include "../../common/common.hpp"
#include "../../common/exception.hpp"
#include "../dataset_handler.hpp"
#include "../meta_data.hpp"
#include "../meta_data_gen.hpp"
Expand Down Expand Up @@ -510,5 +508,3 @@ class Serializer {
};

} // namespace power_grid_model::meta_data

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

// clang-format off
#pragma once
#ifndef POWER_GRID_MODEL_AUXILIARY_STATIC_ASSERTS_INPUT_HPP
#define POWER_GRID_MODEL_AUXILIARY_STATIC_ASSERTS_INPUT_HPP

#include "../input.hpp" // NOLINT

Expand Down Expand Up @@ -482,5 +480,4 @@ static_assert(offsetof(FaultInput, id) == offsetof(BaseInput, id));

} // namespace power_grid_model::test

#endif
// clang-format on
Loading
Loading