Skip to content

Commit

Permalink
Moved MessageFormat.hpp as stdcxx/format.hpp (#112)
Browse files Browse the repository at this point in the history
* Moved MessageFormat.hpp into stdcxx
* Renamed MessageFormat.hpp into format.hpp

Signed-off-by: Sébastien LAIGRE <[email protected]>
Signed-off-by: Sébastien LAIGRE <[email protected]>
  • Loading branch information
sebalaig authored and mathbagu committed Jun 17, 2020
1 parent 36791c1 commit dbf8826
Show file tree
Hide file tree
Showing 91 changed files with 263 additions and 275 deletions.
2 changes: 1 addition & 1 deletion extensions/entsoe/src/EntsoeArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ EntsoeArea::EntsoeArea(Substation& substation, const EntsoeGeographicalCode& cod

void EntsoeArea::assertExtendable(const stdcxx::Reference<Extendable>& extendable) const {
if (extendable && !stdcxx::isInstanceOf<Substation>(extendable.get())) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<Substation>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<Substation>()));
}
}

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 @@ -35,7 +35,7 @@ EntsoeAreaXmlSerializer::EntsoeAreaXmlSerializer() :

std::unique_ptr<Extension> EntsoeAreaXmlSerializer::read(Extendable& extendable, converter::xml::NetworkXmlReaderContext& context) const {
if (!stdcxx::isInstanceOf<Substation>(extendable)) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<Substation>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<Substation>()));
}
auto& substation = dynamic_cast<Substation&>(extendable);

Expand Down
6 changes: 3 additions & 3 deletions extensions/entsoe/src/MergedXnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ MergedXnode::MergedXnode(Line& line, double rdp, double xdp, double xnodeP1, dou

void MergedXnode::assertExtendable(const stdcxx::Reference<powsybl::iidm::Extendable>& extendable) const {
if (extendable && !stdcxx::isInstanceOf<Line>(extendable.get())) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<Line>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<Line>()));
}
}

double MergedXnode::checkDividerPosition(double dp) {
if (dp < 0.0 || dp > 1.0) {
throw PowsyblException(logging::format("Invalid divider position: %1%", dp));
throw PowsyblException(stdcxx::format("Invalid divider position: %1%", dp));
}
return dp;
}

double MergedXnode::checkPowerFlow(double value) {
if (std::isnan(value)) {
throw PowsyblException(logging::format("Power flow is invalid"));
throw PowsyblException(stdcxx::format("Power flow is invalid"));
}
return value;
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/entsoe/src/MergedXnodeXmlSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ MergedXnodeXmlSerializer::MergedXnodeXmlSerializer() :

std::unique_ptr<Extension> MergedXnodeXmlSerializer::read(Extendable& extendable, converter::xml::NetworkXmlReaderContext& context) const {
if (!stdcxx::isInstanceOf<Line>(extendable)) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<Line>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<Line>()));
}
auto& line = dynamic_cast<Line&>(extendable);

Expand Down
2 changes: 1 addition & 1 deletion extensions/entsoe/src/Xnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Xnode::Xnode(DanglingLine& dl, const std::string& code) :

void Xnode::assertExtendable(const stdcxx::Reference<powsybl::iidm::Extendable>& extendable) const {
if (extendable && !stdcxx::isInstanceOf<DanglingLine>(extendable.get())) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<DanglingLine>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<DanglingLine>()));
}
}

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 @@ -31,7 +31,7 @@ XnodeXmlSerializer::XnodeXmlSerializer() :

std::unique_ptr<Extension> XnodeXmlSerializer::read(Extendable& extendable, converter::xml::NetworkXmlReaderContext& context) const {
if (!stdcxx::isInstanceOf<DanglingLine>(extendable)) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<DanglingLine>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<DanglingLine>()));
}
auto& dl = dynamic_cast<DanglingLine&>(extendable);

Expand Down
2 changes: 1 addition & 1 deletion extensions/iidm/src/ActivePowerControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ActivePowerControl::ActivePowerControl(Generator& generator, bool participate, d

void ActivePowerControl::assertExtendable(const stdcxx::Reference<Extendable>& extendable) const {
if (extendable && !stdcxx::isInstanceOf<Battery>(extendable.get()) && !stdcxx::isInstanceOf<Generator>(extendable.get())) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% or %3% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<Battery>(), stdcxx::demangle<Generator>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% or %3% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<Battery>(), stdcxx::demangle<Generator>()));
}
}

Expand Down
2 changes: 1 addition & 1 deletion extensions/iidm/src/ActivePowerControlXmlSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ std::unique_ptr<Extension> ActivePowerControlXmlSerializer::read(Extendable& ext
return stdcxx::make_unique<Extension, ActivePowerControl>(generator, participate, droop);
}

throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<Generator>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<Generator>()));
}

void ActivePowerControlXmlSerializer::write(const Extension& extension, converter::xml::NetworkXmlWriterContext& context) const {
Expand Down
4 changes: 2 additions & 2 deletions extensions/iidm/src/CoordinatedReactiveControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ CoordinatedReactiveControl::CoordinatedReactiveControl(Generator& generator, dou

void CoordinatedReactiveControl::assertExtendable(const stdcxx::Reference<Extendable>& extendable) const {
if (extendable && !stdcxx::isInstanceOf<Generator>(extendable.get())) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<Generator>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<Generator>()));
}
}

Expand All @@ -37,7 +37,7 @@ double CoordinatedReactiveControl::checkQPercent(double qPercent) {
throw PowsyblException("Undefined value for qPercent");
}
if (qPercent < 0.0 || qPercent > 100.0) {
throw PowsyblException(logging::format("Unexpected value for qPercent: %1%", qPercent));
throw PowsyblException(stdcxx::format("Unexpected value for qPercent: %1%", qPercent));
}
return qPercent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ CoordinatedReactiveControlXmlSerializer::CoordinatedReactiveControlXmlSerializer

std::unique_ptr<Extension> CoordinatedReactiveControlXmlSerializer::read(Extendable& extendable, converter::xml::NetworkXmlReaderContext& context) const {
if (!stdcxx::isInstanceOf<Generator>(extendable)) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<Generator>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<Generator>()));
}
auto& generator = dynamic_cast<Generator&>(extendable);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <powsybl/iidm/PhaseTapChanger.hpp>
#include <powsybl/iidm/RatioTapChanger.hpp>
#include <powsybl/iidm/ThreeWindingsTransformer.hpp>
#include <powsybl/logging/MessageFormat.hpp>
#include <powsybl/stdcxx/demangle.hpp>
#include <powsybl/stdcxx/format.hpp>
#include <powsybl/stdcxx/instanceof.hpp>
#include <powsybl/stdcxx/reference_wrapper.hpp>

Expand All @@ -33,13 +33,13 @@ ThreeWindingsTransformerPhaseAngleClock::ThreeWindingsTransformerPhaseAngleClock

void ThreeWindingsTransformerPhaseAngleClock::assertExtendable(const stdcxx::Reference<Extendable>& extendable) const {
if (extendable && !stdcxx::isInstanceOf<ThreeWindingsTransformer>(extendable.get())) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<ThreeWindingsTransformer>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<ThreeWindingsTransformer>()));
}
}

unsigned long ThreeWindingsTransformerPhaseAngleClock::checkPhaseAngleClock(unsigned long phaseAngleClock) const {
if (phaseAngleClock > 11) {
throw PowsyblException(logging::format("Unexpected value for phaseAngleClock: %1%1", phaseAngleClock));
throw PowsyblException(stdcxx::format("Unexpected value for phaseAngleClock: %1%1", phaseAngleClock));
}
return phaseAngleClock;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ThreeWindingsTransformerPhaseAngleClockXmlSerializer::ThreeWindingsTransformerPh

std::unique_ptr<Extension> ThreeWindingsTransformerPhaseAngleClockXmlSerializer::read(Extendable& extendable, converter::xml::NetworkXmlReaderContext& context) const {
if (!stdcxx::isInstanceOf<ThreeWindingsTransformer>(extendable)) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<ThreeWindingsTransformer>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<ThreeWindingsTransformer>()));
}
auto& transformer = dynamic_cast<ThreeWindingsTransformer&>(extendable);

Expand Down
6 changes: 3 additions & 3 deletions extensions/iidm/src/TwoWindingsTransformerPhaseAngleClock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <powsybl/AssertionError.hpp>
#include <powsybl/PowsyblException.hpp>
#include <powsybl/iidm/TwoWindingsTransformer.hpp>
#include <powsybl/logging/MessageFormat.hpp>
#include <powsybl/stdcxx/demangle.hpp>
#include <powsybl/stdcxx/format.hpp>
#include <powsybl/stdcxx/instanceof.hpp>
#include <powsybl/stdcxx/reference_wrapper.hpp>

Expand All @@ -30,13 +30,13 @@ TwoWindingsTransformerPhaseAngleClock::TwoWindingsTransformerPhaseAngleClock(Two

void TwoWindingsTransformerPhaseAngleClock::assertExtendable(const stdcxx::Reference<Extendable>& extendable) const {
if (extendable && !stdcxx::isInstanceOf<TwoWindingsTransformer>(extendable.get())) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<TwoWindingsTransformer>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable.get()), stdcxx::demangle<TwoWindingsTransformer>()));
}
}

unsigned long TwoWindingsTransformerPhaseAngleClock::checkPhaseAngleClock(unsigned long phaseAngleClock) const {
if (phaseAngleClock > 11) {
throw PowsyblException(logging::format("Unexpected value for phaseAngleClock: %1%1", phaseAngleClock));
throw PowsyblException(stdcxx::format("Unexpected value for phaseAngleClock: %1%1", phaseAngleClock));
}
return phaseAngleClock;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TwoWindingsTransformerPhaseAngleClockXmlSerializer::TwoWindingsTransformerPhaseA

std::unique_ptr<Extension> TwoWindingsTransformerPhaseAngleClockXmlSerializer::read(Extendable& extendable, converter::xml::NetworkXmlReaderContext& context) const {
if (!stdcxx::isInstanceOf<TwoWindingsTransformer>(extendable)) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<TwoWindingsTransformer>()));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle(extendable), stdcxx::demangle<TwoWindingsTransformer>()));
}
auto& transformer = dynamic_cast<TwoWindingsTransformer&>(extendable);

Expand Down
6 changes: 3 additions & 3 deletions include/powsybl/iidm/BranchAdder.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <powsybl/iidm/TerminalBuilder.hpp>
#include <powsybl/iidm/ValidationException.hpp>
#include <powsybl/iidm/VoltageLevel.hpp>
#include <powsybl/logging/MessageFormat.hpp>
#include <powsybl/stdcxx/format.hpp>

namespace powsybl {

Expand Down Expand Up @@ -44,7 +44,7 @@ VoltageLevel& BranchAdder<Adder>::checkAndGetVoltageLevel1() {

stdcxx::Reference<VoltageLevel> voltageLevel1 = this->getNetwork().template find<VoltageLevel>(m_voltageLevelId1);
if (!voltageLevel1) {
throw ValidationException(*this, logging::format("First voltage level '%1%' not found", m_voltageLevelId1));
throw ValidationException(*this, stdcxx::format("First voltage level '%1%' not found", m_voltageLevelId1));
}

return voltageLevel1.get();
Expand All @@ -58,7 +58,7 @@ VoltageLevel& BranchAdder<Adder>::checkAndGetVoltageLevel2() {

stdcxx::Reference<VoltageLevel> voltageLevel2 = this->getNetwork().template find<VoltageLevel>(m_voltageLevelId2);
if (!voltageLevel2) {
throw ValidationException(*this, logging::format("Second voltage level '%1%' not found", m_voltageLevelId2));
throw ValidationException(*this, stdcxx::format("Second voltage level '%1%' not found", m_voltageLevelId2));
}

return voltageLevel2.get();
Expand Down
2 changes: 1 addition & 1 deletion include/powsybl/iidm/CurrentLimitsAdder.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void CurrentLimitsAdder<S, O>::checkTemporaryLimits() const {
std::for_each(m_temporaryLimits.cbegin(), m_temporaryLimits.cend(), [this, &names](const std::pair<unsigned long, CurrentLimits::TemporaryLimit>& element) {
const auto& res = names.insert(element.second.getName());
if (!res.second) {
throw ValidationException(m_owner, logging::format("2 temporary limits have the same name %1%", element.second.getName()));
throw ValidationException(m_owner, stdcxx::format("2 temporary limits have the same name %1%", element.second.getName()));
}
});
}
Expand Down
6 changes: 3 additions & 3 deletions include/powsybl/iidm/Enum.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <powsybl/iidm/Enum.hpp>

#include <powsybl/AssertionError.hpp>
#include <powsybl/logging/MessageFormat.hpp>
#include <powsybl/stdcxx/demangle.hpp>
#include <powsybl/stdcxx/format.hpp>

namespace powsybl {

Expand All @@ -25,7 +25,7 @@ E fromString(const std::string& name) {
const auto& names = getNames<E>();
const auto& it = std::find(names.begin(), names.end(), name);
if (it == names.end()) {
throw powsybl::AssertionError(powsybl::logging::format("Unexpected %1% name: %2%", stdcxx::simpleClassName<E>(), name));
throw powsybl::AssertionError(stdcxx::format("Unexpected %1% name: %2%", stdcxx::simpleClassName<E>(), name));
}

return static_cast<E>(it - names.begin());
Expand All @@ -36,7 +36,7 @@ std::string toString(const E& value) {
auto index = static_cast<unsigned long>(value);
const auto& names = getNames<E>();
if (index >= names.size()) {
throw powsybl::AssertionError(powsybl::logging::format("Unexpected %1% value: %2%", stdcxx::simpleClassName<E>(), index));
throw powsybl::AssertionError(stdcxx::format("Unexpected %1% value: %2%", stdcxx::simpleClassName<E>(), index));
}
return *(names.begin() + index);
}
Expand Down
4 changes: 2 additions & 2 deletions include/powsybl/iidm/Extendable.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

#include <powsybl/iidm/Extendable.hpp>

#include <powsybl/logging/MessageFormat.hpp>
#include <powsybl/stdcxx/demangle.hpp>
#include <powsybl/stdcxx/format.hpp>

namespace powsybl {

Expand Down Expand Up @@ -45,7 +45,7 @@ template <typename E, typename>
const E& Extendable::getExtension() const {
const auto& it = m_extensionsByType.find(typeid(E));
if (it == m_extensionsByType.end()) {
throw PowsyblException(logging::format("Extension %1% not found", stdcxx::demangle<E>()));
throw PowsyblException(stdcxx::format("Extension %1% not found", stdcxx::demangle<E>()));
}
return dynamic_cast<E&>(it->second.get());
}
Expand Down
6 changes: 3 additions & 3 deletions include/powsybl/iidm/Extension.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <powsybl/iidm/Extension.hpp>

#include <powsybl/AssertionError.hpp>
#include <powsybl/logging/MessageFormat.hpp>
#include <powsybl/stdcxx/demangle.hpp>
#include <powsybl/stdcxx/format.hpp>
#include <powsybl/stdcxx/instanceof.hpp>
#include <powsybl/stdcxx/memory.hpp>

Expand All @@ -28,15 +28,15 @@ std::unique_ptr<Extension> Extension::create(Args&&... args) {
template <typename E, typename>
stdcxx::CReference<E> Extension::getExtendable() const {
if (m_extendable && !stdcxx::isInstanceOf<E>(m_extendable.get())) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle<E>(), stdcxx::demangle(m_extendable.get())));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle<E>(), stdcxx::demangle(m_extendable.get())));
}
return stdcxx::cref<E>(m_extendable);
}

template <typename E, typename>
stdcxx::Reference<E> Extension::getExtendable() {
if (m_extendable && !stdcxx::isInstanceOf<E>(m_extendable.get())) {
throw AssertionError(logging::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle<E>(), stdcxx::demangle(m_extendable.get())));
throw AssertionError(stdcxx::format("Unexpected extendable type: %1% (%2% expected)", stdcxx::demangle<E>(), stdcxx::demangle(m_extendable.get())));
}
return stdcxx::ref<E>(m_extendable);
}
Expand Down
4 changes: 2 additions & 2 deletions include/powsybl/iidm/IdentifiableAdder.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ std::string IdentifiableAdder<Adder>::getMessageHeader() const {
template <typename Adder>
std::string IdentifiableAdder<Adder>::checkAndGetUniqueId() const {
if (m_id.empty()) {
throw PowsyblException(logging::format("%1% id is not set", getTypeDescription()));
throw PowsyblException(stdcxx::format("%1% id is not set", getTypeDescription()));
}

const auto& network = getNetwork();
Expand All @@ -38,7 +38,7 @@ std::string IdentifiableAdder<Adder>::checkAndGetUniqueId() const {
} else {
const auto& obj = network.find(m_id);
if (obj) {
throw PowsyblException(logging::format("The network %1% already contains an object '%2%' with the id '%3%'", network.getId(), stdcxx::simpleClassName(obj.get()), m_id));
throw PowsyblException(stdcxx::format("The network %1% already contains an object '%2%' with the id '%3%'", network.getId(), stdcxx::simpleClassName(obj.get()), m_id));
}
uniqueId = m_id;
}
Expand Down
8 changes: 4 additions & 4 deletions include/powsybl/iidm/NetworkIndex.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <powsybl/PowsyblException.hpp>
#include <powsybl/iidm/LccConverterStation.hpp>
#include <powsybl/iidm/VscConverterStation.hpp>
#include <powsybl/logging/MessageFormat.hpp>
#include <powsybl/stdcxx/demangle.hpp>
#include <powsybl/stdcxx/format.hpp>
#include <powsybl/stdcxx/reference_wrapper.hpp>

namespace powsybl {
Expand All @@ -35,7 +35,7 @@ T& NetworkIndex::checkAndAdd(std::unique_ptr<T>&& identifiable) {

auto other = m_objectsById.find(identifiable->getId());
if (other != m_objectsById.end()) {
throw PowsyblException(logging::format("Object '%1%' already exists (%2%)", identifiable->getId(), stdcxx::demangle(*other->second)));
throw PowsyblException(stdcxx::format("Object '%1%' already exists (%2%)", identifiable->getId(), stdcxx::demangle(*other->second)));
}

auto it = m_objectsById.emplace(std::make_pair(identifiable->getId(), std::move(identifiable)));
Expand All @@ -52,12 +52,12 @@ const T& NetworkIndex::get(const std::string& id) const {

const auto& it = m_objectsById.find(id);
if (it == m_objectsById.end()) {
throw PowsyblException(logging::format("Unable to find to the identifiable '%1%'", id));
throw PowsyblException(stdcxx::format("Unable to find to the identifiable '%1%'", id));
}

auto* identifiable = dynamic_cast<T*>(it->second.get());
if (identifiable == nullptr) {
throw PowsyblException(logging::format("Identifiable '%1%' is not a %2%", id, stdcxx::demangle<T>()));
throw PowsyblException(stdcxx::format("Identifiable '%1%' is not a %2%", id, stdcxx::demangle<T>()));
}

return *identifiable;
Expand Down
Loading

0 comments on commit dbf8826

Please sign in to comment.