Skip to content

Commit

Permalink
Clean up container.h / container.hxx (#2601)
Browse files Browse the repository at this point in the history
- Remove default constructor/destructor
- Remove useless `std::make_shared`, use the stack instead
  • Loading branch information
flomnes authored Jan 28, 2025
1 parent 12b4362 commit 4882c1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
12 changes: 0 additions & 12 deletions src/solver/variable/include/antares/solver/variable/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@ class List: public NextT
};

public:
//! \name Constructor & Destructor
//@{
/*!
** \brief Default Constructor
*/
List();
/*!
** \brief Destructor
*/
~List();
//@}

//! \name Variable initialization
//@{
/*!
Expand Down
22 changes: 6 additions & 16 deletions src/solver/variable/include/antares/solver/variable/container.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@ namespace Variable
{
namespace Container
{
template<class NextT>
inline List<NextT>::List()
{
}

template<class NextT>
inline List<NextT>::~List()
{
}

template<class NextT>
inline void List<NextT>::initializeFromStudy(Data::Study& study)
{
Expand Down Expand Up @@ -326,32 +316,32 @@ void List<NextT>::exportSurveyResults(bool global,
logs.info() << "Exporting the annual results";
}

auto survey = std::make_shared<SurveyResults>(*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<true, ListType>;
// 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<false, ListType>;
// Building the survey results for each possible state
Builder::Run(*this, *survey, numSpace);
Builder::Run(*this, survey, numSpace);
}
}

Expand Down

0 comments on commit 4882c1f

Please sign in to comment.