Antares Simulator
Power System Simulator
enum_operators.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 
22 #pragma once
23 #include <ostream>
24 #include <string>
25 
26 #include "antares/io/inputs/yml-model/Library.h"
27 #include "antares/study/system-model/valueType.h"
28 
29 namespace Antares::ModelerStudy::SystemModel
30 {
31 inline std::ostream& operator<<(std::ostream& os, const ValueType& value_type)
32 {
33  using namespace std::string_literals;
34  switch (value_type)
35  {
36  case ValueType::FLOAT:
37  os << "float"s;
38  break;
39  case ValueType::INTEGER:
40  os << "integer"s;
41  break;
42  case ValueType::BOOL:
43  os << "boolean"s;
44  break;
45  default:
46  os << "UNKNOWN"s;
47  break;
48  }
49  return os;
50 }
51 } // namespace Antares::ModelerStudy::SystemModel
52 
53 namespace Antares::IO::Inputs::YmlModel
54 {
55 inline std::ostream& operator<<(std::ostream& os, const ValueType& value_type)
56 {
57  using namespace std::string_literals;
58  switch (value_type)
59  {
60  case ValueType::CONTINUOUS:
61  os << "CONTINUOUS"s;
62  break;
63  case ValueType::INTEGER:
64  os << "INTEGER"s;
65  break;
66  case ValueType::BOOL:
67  os << "BOOL"s;
68  break;
69  default:
70  os << "UNKNOWN"s;
71  break;
72  }
73  return os;
74 }
75 } // namespace Antares::IO::Inputs::YmlModel