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

Fix special method declaration order #311

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#
# Copyright (c) 2021, RTE (http://www.rte-france.com)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

name: CI

on: [push]
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#
# Copyright (c) 2021, RTE (http://www.rte-france.com)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

name: clang-tidy

on:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(powsybl-iidm4cpp)

set(IIDM_VERSION_MAJOR 1)
set(IIDM_VERSION_MINOR 4)
set(IIDM_VERSION_MINOR 5)
set(IIDM_VERSION_PATCH 0)
set(IIDM_VERSION ${IIDM_VERSION_MAJOR}.${IIDM_VERSION_MINOR}.${IIDM_VERSION_PATCH})
set(IIDM_SOVERSION ${IIDM_VERSION_MAJOR})
Expand Down
7 changes: 7 additions & 0 deletions doxygen/Doxyfile.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#
# Copyright (c) 2021, RTE (http://www.rte-france.com)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

# Doxyfile 1.8.14

# This file describes the settings to be used by the documentation system
Expand Down
1 change: 1 addition & 0 deletions doxygen/cppreference-doxygen-web.tag.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 License. -->
<tagfile>
<compound kind="namespace">
<name>std</name>
Expand Down
7 changes: 6 additions & 1 deletion doxygen/powsybl.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions examples/example1/eurostag-tutorial1.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2021, RTE (http://www.rte-france.com)
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<iidm:network xmlns:iidm="http://www.itesla_project.eu/schema/iidm/1_0" id="sim1" caseDate="2013-01-15T18:45:00+01:00" forecastDistance="0" sourceFormat="test">
<iidm:substation id="P1" country="FR" tso="RTE" geographicalTags="A">
<iidm:voltageLevel id="VLGEN" nominalV="24" topologyKind="BUS_BREAKER">
Expand Down
3 changes: 2 additions & 1 deletion examples/example2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ project(my-project)

# Find the required dependencies: Boost, LibXML2 and IIDM and import the targets
find_package(Boost 1.65 REQUIRED COMPONENTS date_time filesystem program_options system unit_test_framework)
find_package(Threads REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(LibIIDM REQUIRED)

# Create an executable
add_executable(my-executable ../example1/example1.cpp)

# Link the executable with the IIDM shared library
target_link_libraries(my-executable PRIVATE IIDM::iidm-static)
target_link_libraries(my-executable PRIVATE IIDM::iidm)
19 changes: 19 additions & 0 deletions examples/example2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ project(my-project)

# Find the required dependencies: Boost, LibXML2 and IIDM and import the targets
find_package(Boost 1.65 REQUIRED COMPONENTS date_time filesystem program_options system unit_test_framework)
find_package(Threads REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(LibIIDM REQUIRED)

Expand All @@ -82,6 +83,15 @@ $> cmake -DCMAKE_PREFIX_PATH=/tmp/powsybl-iidm4cpp
-- program_options
-- system
-- unit_test_framework
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/powsybl-iidm4cpp/examples/example2/build
Expand Down Expand Up @@ -139,6 +149,15 @@ $> cmake --build .
-- program_options
-- system
-- unit_test_framework
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/powsybl-iidm4cpp/examples/example2/build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ class EntsoeAreaAdder : public ExtensionAdder {
*/
explicit EntsoeAreaAdder(Extendable& extendable);

/**
* Destructor
*/
~EntsoeAreaAdder() noexcept override = default;

/**
* Copy constructor
*/
Expand All @@ -42,6 +37,11 @@ class EntsoeAreaAdder : public ExtensionAdder {
*/
EntsoeAreaAdder(EntsoeAreaAdder&&) = default;

/**
* Destructor
*/
~EntsoeAreaAdder() noexcept override = default;

/**
* Copy assignment operator
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ enum class EntsoeGeographicalCode : unsigned int {
HR,
HU,
IT,
KS,
LU,
LT,
MA,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ class MergedXnodeAdder : public ExtensionAdder {
*/
explicit MergedXnodeAdder(Extendable& extendable);

/**
* Destructor
*/
~MergedXnodeAdder() noexcept override = default;

/**
* Copy constructor
*/
Expand All @@ -43,6 +38,11 @@ class MergedXnodeAdder : public ExtensionAdder {
*/
MergedXnodeAdder(MergedXnodeAdder&&) noexcept = default;

/**
* Destructor
*/
~MergedXnodeAdder() noexcept override = default;

/**
* Copy assignment operator
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ class XnodeAdder : public ExtensionAdder {
*/
explicit XnodeAdder(Extendable& extendable);

/**
* Destructor
*/
~XnodeAdder() noexcept override = default;

/**
* Copy constructor
*/
Expand All @@ -42,6 +37,11 @@ class XnodeAdder : public ExtensionAdder {
*/
XnodeAdder(XnodeAdder&&) noexcept = default;

/**
* Destructor
*/
~XnodeAdder() noexcept override = default;

/**
* Copy assignment operator
*/
Expand Down
2 changes: 1 addition & 1 deletion extensions/entsoe/resources/entsoeArea.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<iidm:network xmlns:iidm="http://www.powsybl.org/schema/iidm/1_4" xmlns:ea="http://www.itesla_project.eu/schema/iidm/ext/entsoe_area/1_0" id="test" caseDate="2016-06-27T12:27:58.535000+02:00" forecastDistance="0" sourceFormat="test">
<iidm:network xmlns:iidm="http://www.powsybl.org/schema/iidm/1_5" xmlns:ea="http://www.itesla_project.eu/schema/iidm/ext/entsoe_area/1_0" id="test" caseDate="2016-06-27T12:27:58.535000+02:00" forecastDistance="0" sourceFormat="test">
<iidm:substation id="S" country="FR"/>
<iidm:extension id="S">
<ea:entsoeArea>FR</ea:entsoeArea>
Expand Down
2 changes: 1 addition & 1 deletion extensions/entsoe/resources/mergedXnode.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<iidm:network xmlns:iidm="http://www.powsybl.org/schema/iidm/1_4" xmlns:mxn="http://www.itesla_project.eu/schema/iidm/ext/merged_xnode/1_0" id="test" caseDate="2016-06-27T12:27:58.535000+02:00" forecastDistance="0" sourceFormat="test">
<iidm:network xmlns:iidm="http://www.powsybl.org/schema/iidm/1_5" xmlns:mxn="http://www.itesla_project.eu/schema/iidm/ext/merged_xnode/1_0" id="test" caseDate="2016-06-27T12:27:58.535000+02:00" forecastDistance="0" sourceFormat="test">
<iidm:substation id="S1" country="FR">
<iidm:voltageLevel id="VL1" nominalV="400" topologyKind="BUS_BREAKER">
<iidm:busBreakerTopology>
Expand Down
2 changes: 1 addition & 1 deletion extensions/entsoe/resources/xnode.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<iidm:network xmlns:iidm="http://www.powsybl.org/schema/iidm/1_4" xmlns:xn="http://www.itesla_project.eu/schema/iidm/ext/xnode/1_0" id="test" caseDate="2016-06-27T12:27:58.535000+02:00" forecastDistance="0" sourceFormat="test">
<iidm:network xmlns:iidm="http://www.powsybl.org/schema/iidm/1_5" xmlns:xn="http://www.itesla_project.eu/schema/iidm/ext/xnode/1_0" id="test" caseDate="2016-06-27T12:27:58.535000+02:00" forecastDistance="0" sourceFormat="test">
<iidm:substation id="S" country="FR">
<iidm:voltageLevel id="VL" nominalV="400" topologyKind="BUS_BREAKER">
<iidm:busBreakerTopology>
Expand Down
2 changes: 1 addition & 1 deletion extensions/entsoe/src/EntsoeAreaXmlSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Extension& EntsoeAreaXmlSerializer::read(Extendable& extendable, converter::xml:

void EntsoeAreaXmlSerializer::write(const Extension& extension, converter::xml::NetworkXmlWriterContext& context) const {
const auto& entsoeArea = safeCast<EntsoeArea>(extension);
context.getExtensionsWriter().writeCharacters(Enum::toString<EntsoeGeographicalCode>(entsoeArea.getCode()));
context.getWriter().writeCharacters(Enum::toString<EntsoeGeographicalCode>(entsoeArea.getCode()));
}

} // namespace entsoe
Expand Down
1 change: 1 addition & 0 deletions extensions/entsoe/src/EntsoeGeographicalCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const std::initializer_list<std::string>& getNames<powsybl::iidm::extensions::en
"HR",
"HU",
"IT",
"KS",
"LU",
"LT",
"MA",
Expand Down
14 changes: 7 additions & 7 deletions extensions/entsoe/src/MergedXnodeXmlSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ Extension& MergedXnodeXmlSerializer::read(Extendable& extendable, converter::xml

void MergedXnodeXmlSerializer::write(const Extension& extension, converter::xml::NetworkXmlWriterContext& context) const {
const auto& mergedXnode = safeCast<MergedXnode>(extension);
context.getExtensionsWriter().writeAttribute("rdp", mergedXnode.getRdp());
context.getExtensionsWriter().writeAttribute("xdp", mergedXnode.getXdp());
context.getExtensionsWriter().writeAttribute("xnodeP1", mergedXnode.getXnodeP1());
context.getExtensionsWriter().writeAttribute("xnodeQ1", mergedXnode.getXnodeQ1());
context.getExtensionsWriter().writeAttribute("xnodeP2", mergedXnode.getXnodeP2());
context.getExtensionsWriter().writeAttribute("xnodeQ2", mergedXnode.getXnodeQ2());
context.getExtensionsWriter().writeAttribute("code", mergedXnode.getCode());
context.getWriter().writeAttribute("rdp", mergedXnode.getRdp());
context.getWriter().writeAttribute("xdp", mergedXnode.getXdp());
context.getWriter().writeAttribute("xnodeP1", mergedXnode.getXnodeP1());
context.getWriter().writeAttribute("xnodeQ1", mergedXnode.getXnodeQ1());
context.getWriter().writeAttribute("xnodeP2", mergedXnode.getXnodeP2());
context.getWriter().writeAttribute("xnodeQ2", mergedXnode.getXnodeQ2());
context.getWriter().writeAttribute("code", mergedXnode.getCode());
}

} // namespace entsoe
Expand Down
2 changes: 1 addition & 1 deletion extensions/entsoe/src/XnodeXmlSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Extension& XnodeXmlSerializer::read(Extendable& extendable, converter::xml::Netw

void XnodeXmlSerializer::write(const Extension& extension, converter::xml::NetworkXmlWriterContext& context) const {
const auto& xnode = safeCast<Xnode>(extension);
context.getExtensionsWriter().writeAttribute("code", xnode.getCode());
context.getWriter().writeAttribute("code", xnode.getCode());
}

} // namespace entsoe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ class ActivePowerControlAdder : public ExtensionAdder {
*/
explicit ActivePowerControlAdder(Extendable& extendable);

/**
* Destructor
*/
~ActivePowerControlAdder() noexcept override = default;

/**
* Copy constructor
Expand All @@ -40,6 +36,11 @@ class ActivePowerControlAdder : public ExtensionAdder {
*/
ActivePowerControlAdder(ActivePowerControlAdder&&) = default;

/**
* Destructor
*/
~ActivePowerControlAdder() noexcept override = default;

/**
* Copy assignment operator
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ class CoordinatedReactiveControlAdder : public ExtensionAdder {
*/
explicit CoordinatedReactiveControlAdder(Extendable& extendable);

/**
* Destructor
*/
~CoordinatedReactiveControlAdder() noexcept override = default;

/**
* Copy constructor
*/
Expand All @@ -41,6 +36,11 @@ class CoordinatedReactiveControlAdder : public ExtensionAdder {
*/
CoordinatedReactiveControlAdder(CoordinatedReactiveControlAdder&&) = default;

/**
* Destructor
*/
~CoordinatedReactiveControlAdder() noexcept override = default;

/**
* Copy assignment operator
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ class ThreeWindingsTransformerPhaseAngleClockAdder : public ExtensionAdder {
*/
explicit ThreeWindingsTransformerPhaseAngleClockAdder(Extendable& extendable);

/**
* Destructor
*/
~ThreeWindingsTransformerPhaseAngleClockAdder() noexcept override = default;

/**
* Copy constructor
*/
Expand All @@ -41,6 +36,11 @@ class ThreeWindingsTransformerPhaseAngleClockAdder : public ExtensionAdder {
*/
ThreeWindingsTransformerPhaseAngleClockAdder(ThreeWindingsTransformerPhaseAngleClockAdder&&) = default;

/**
* Destructor
*/
~ThreeWindingsTransformerPhaseAngleClockAdder() noexcept override = default;

/**
* Copy assignment operator
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ class TwoWindingsTransformerPhaseAngleClockAdder : public ExtensionAdder {
*/
explicit TwoWindingsTransformerPhaseAngleClockAdder(Extendable& extendable);

/**
* Destructor
*/
~TwoWindingsTransformerPhaseAngleClockAdder() noexcept override = default;

/**
* Copy constructor
*/
Expand All @@ -38,6 +33,11 @@ class TwoWindingsTransformerPhaseAngleClockAdder : public ExtensionAdder {
*/
TwoWindingsTransformerPhaseAngleClockAdder(TwoWindingsTransformerPhaseAngleClockAdder&&) = default;

/**
* Destructor
*/
~TwoWindingsTransformerPhaseAngleClockAdder() noexcept override = default;

/**
* Copy assignment operator
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ class VoltagePerReactivePowerControlAdder : public ExtensionAdder {
*/
explicit VoltagePerReactivePowerControlAdder(Extendable& extendable);

/**
* Destructor
*/
~VoltagePerReactivePowerControlAdder() noexcept override = default;

/**
* Copy constructor
*/
Expand All @@ -41,6 +36,11 @@ class VoltagePerReactivePowerControlAdder : public ExtensionAdder {
*/
VoltagePerReactivePowerControlAdder(VoltagePerReactivePowerControlAdder&&) = default;

/**
* Destructor
*/
~VoltagePerReactivePowerControlAdder() noexcept override = default;

/**
* Copy assignment operator
*/
Expand Down
2 changes: 1 addition & 1 deletion extensions/iidm/resources/activePowerControl.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<iidm:network xmlns:iidm="http://www.powsybl.org/schema/iidm/1_4" xmlns:apc="http://www.itesla_project.eu/schema/iidm/ext/active_power_control/1_0" id="fictitious" caseDate="2017-06-25T17:43:00+01:00" forecastDistance="0" sourceFormat="test">
<iidm:network xmlns:iidm="http://www.powsybl.org/schema/iidm/1_5" xmlns:apc="http://www.itesla_project.eu/schema/iidm/ext/active_power_control/1_0" id="fictitious" caseDate="2017-06-25T17:43:00+01:00" forecastDistance="0" sourceFormat="test">
<iidm:substation id="P1" country="FR" tso="R" geographicalTags="A">
<iidm:voltageLevel id="VLGEN" nominalV="400" topologyKind="BUS_BREAKER">
<iidm:busBreakerTopology>
Expand Down
Loading