From 4882c1fb4d5fc65032bbec6e6cfd6dfec760048e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Omn=C3=A8s?= Date: Tue, 28 Jan 2025 10:22:18 +0100 Subject: [PATCH] Clean up container.h / container.hxx (#2601) - Remove default constructor/destructor - Remove useless `std::make_shared`, use the stack instead --- .../antares/solver/variable/container.h | 12 ---------- .../antares/solver/variable/container.hxx | 22 +++++-------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/src/solver/variable/include/antares/solver/variable/container.h b/src/solver/variable/include/antares/solver/variable/container.h index 23938f71f1..74991a5926 100644 --- a/src/solver/variable/include/antares/solver/variable/container.h +++ b/src/solver/variable/include/antares/solver/variable/container.h @@ -55,18 +55,6 @@ class List: public NextT }; public: - //! \name Constructor & Destructor - //@{ - /*! - ** \brief Default Constructor - */ - List(); - /*! - ** \brief Destructor - */ - ~List(); - //@} - //! \name Variable initialization //@{ /*! diff --git a/src/solver/variable/include/antares/solver/variable/container.hxx b/src/solver/variable/include/antares/solver/variable/container.hxx index dd76f9b523..1488cd77aa 100644 --- a/src/solver/variable/include/antares/solver/variable/container.hxx +++ b/src/solver/variable/include/antares/solver/variable/container.hxx @@ -35,16 +35,6 @@ namespace Variable { namespace Container { -template -inline List::List() -{ -} - -template -inline List::~List() -{ -} - template inline void List::initializeFromStudy(Data::Study& study) { @@ -326,32 +316,32 @@ void List::exportSurveyResults(bool global, logs.info() << "Exporting the annual results"; } - auto survey = std::make_shared(*pStudy, output, writer); + SurveyResults survey(*pStudy, output, writer); // Year by year ? - survey->yearByYearResults = !global; + survey.yearByYearResults = !global; if (global) { // alias to the type of the report builder using Builder = SurveyReportBuilder; // Building the survey results for each possible state - Builder::Run(*this, *survey); + Builder::Run(*this, survey); // Exporting the Grid (information about the study) - survey->exportGridInfos(); + survey.exportGridInfos(); // Exporting the digest // The digest must be exported after the real report because some values // are computed at this moment. - Builder::RunDigest(*this, *survey, writer); + Builder::RunDigest(*this, survey, writer); } else { // alias to the type of the report builder using Builder = SurveyReportBuilder; // Building the survey results for each possible state - Builder::Run(*this, *survey, numSpace); + Builder::Run(*this, survey, numSpace); } }