21 #ifndef __ANTARES_LIBS_SOLVER_SIMULATION_PROGRESSION_H__
22 #define __ANTARES_LIBS_SOLVER_SIMULATION_PROGRESSION_H__
30 #include <yuni/core/singleton.h>
31 #include <yuni/io/file.h>
32 #include <yuni/thread/timer.h>
34 #include <antares/writer/i_writer.h>
38 namespace Antares::Solver
64 const char* SectionToCStr(Section section);
70 using MapPerSection = std::map<Section, Part>;
71 using Map = std::map<uint, MapPerSection>;
73 using ListRef = std::list<Part*>;
77 unsigned maxTickCount;
79 std::atomic<unsigned> tickCount;
81 unsigned lastTickCount;
84 Yuni::CString<40, false> caption;
96 pProgression.end(pPart);
105 Task& operator+=(
unsigned value)
107 pPart.tickCount += value;
139 void add(uint year, Section section,
unsigned nbTicks);
141 void add(Section section,
int nbTicks);
143 bool saveToFile(
const Yuni::String& filename,
IResultWriter& writer);
145 void setNumberOfParallelYears(uint nb);
161 Part& begin(uint year, Section section);
162 void end(Part& part);
165 class Meter final:
public Yuni::Thread::Timer
170 virtual ~Meter() =
default;
175 void taskCount(uint n);
178 virtual bool onInterval(uint)
override;
181 Progression::Part::Map parts;
184 uint nbParallelYears;
186 std::vector<Yuni::CString<256, false>> logsContainer;
192 Meter pProgressMeter;
203 #include "progression.hxx"
Definition: i_writer.h:32
Definition: progression.h:89
Progress meter about any operation performed on the attached study.
Definition: progression.h:44
void start()
Start the thread dedicated to the progress notification.
Definition: progression.cpp:193
void add(uint year, Section section, unsigned nbTicks)
Declare a new part of the progression.
Definition: progression.cpp:45
~Progression()
Destructor.
Definition: progression.cpp:157
void stop()
Stop the thread dedicated to the progress notification.
Definition: progression.cpp:200