Antares Simulator
Power System Simulator
output.h
1 /*
2 ** Copyright 2007-2025, RTE (https://www.rte-france.com)
3 ** See AUTHORS.txt
4 ** SPDX-License-Identifier: MPL-2.0
5 ** This file is part of Antares-Simulator,
6 ** Adequacy and Performance assessment for interconnected energy networks.
7 **
8 ** Antares_Simulator is free software: you can redistribute it and/or modify
9 ** it under the terms of the Mozilla Public Licence 2.0 as published by
10 ** the Mozilla Foundation, either version 2 of the License, or
11 ** (at your option) any later version.
12 **
13 ** Antares_Simulator is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ** Mozilla Public Licence 2.0 for more details.
17 **
18 ** You should have received a copy of the Mozilla Public Licence 2.0
19 ** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20 */
21 #ifndef __STUDY_OUTPUT_AGGREGATOR_OUTPUT_H__
22 #define __STUDY_OUTPUT_AGGREGATOR_OUTPUT_H__
23 
24 #include <atomic>
25 #include <memory>
26 #include <set>
27 
28 #include <yuni/core/string.h>
29 
30 #include "result.h"
31 
32 class Output final
33 {
34 public:
36  using Ptr = std::shared_ptr<Output>;
38  using FolderName = Yuni::CString<10, false>;
40  using ColumnName = Yuni::CString<128, false>;
42  using Vector = std::vector<Ptr>;
43 
44 public:
45  Output(const YString& target, const YString::Vector& cols):
46  path(target),
47  columns(cols)
48  {
49  }
50 
51  bool canContinue() const
52  {
53  return (errors < 100);
54  }
55 
56  void incrementError();
57 
58 public:
60  uint minYear;
62  uint maxYear;
64  uint nbYears;
66  const Yuni::String path;
68  const Yuni::String::Vector columns;
70  std::atomic<int> errors;
71 
73  ResultsForAllStudyItems results;
74 
75 }; // class Output
76 
77 #endif // __STUDY_OUTPUT_AGGREGATOR_OUTPUT_H__
Definition: output.h:33
uint nbYears
The total number of years.
Definition: output.h:64
const Yuni::String::Vector columns
All columns to extract.
Definition: output.h:68
Yuni::CString< 128, false > ColumnName
Column name.
Definition: output.h:40
std::atomic< int > errors
The number of errors.
Definition: output.h:70
uint minYear
The minimum value for the years.
Definition: output.h:60
ResultsForAllStudyItems results
Results.
Definition: output.h:73
Yuni::CString< 10, false > FolderName
A folder name (short length)
Definition: output.h:38
std::vector< Ptr > Vector
Vector.
Definition: output.h:42
uint maxYear
The maximum value for the years.
Definition: output.h:62
const Yuni::String path
The study output directory.
Definition: output.h:66
std::shared_ptr< Output > Ptr
The most suitable smart pointer.
Definition: output.h:36