Arcane  v3.16.8.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ArcaneException.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ArcaneException.h (C) 2000-2025 */
9/* */
10/* Exceptions lancées par Arcane. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ARCANEEXCEPTION_H
13#define ARCANE_CORE_ARCANEEXCEPTION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/Exception.h"
18#include "arcane/utils/String.h"
19
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
45class ARCANE_CORE_EXPORT BadIDException
46: public Exception
47{
48 public:
49
54 BadIDException(const String& where,const String& invalid_name);
55 ~BadIDException() ARCANE_NOEXCEPT override {}
56
57 public:
58
59 void explain(std::ostream& m) const override;
60
61 private:
62
64};
65
66/*---------------------------------------------------------------------------*/
67/*---------------------------------------------------------------------------*/
75class ARCANE_CORE_EXPORT BadItemIdException
76: public Exception
77{
78 public:
79
87 ~BadItemIdException() ARCANE_NOEXCEPT override {}
88
89 public:
90
91 void explain(std::ostream& m) const override;
92
93 private:
94
96};
97
98/*---------------------------------------------------------------------------*/
99/*---------------------------------------------------------------------------*/
104class ARCANE_CORE_EXPORT InternalErrorException
105: public Exception
106{
107 public:
108
109 InternalErrorException(const String& where,const String& why);
110 InternalErrorException(const TraceInfo& where,const String& why);
111 InternalErrorException(const InternalErrorException& ex) ARCANE_NOEXCEPT;
112 ~InternalErrorException() ARCANE_NOEXCEPT override {}
113
114 public:
115
116 void explain(std::ostream& m) const override;
117
118 private:
119
120 String m_why;
121};
122
123/*---------------------------------------------------------------------------*/
124/*---------------------------------------------------------------------------*/
133class ARCANE_CORE_EXPORT BadVariableKindTypeException
134: public Exception
135{
136 public:
137
138 BadVariableKindTypeException(const TraceInfo& where,IVariable* valid_var,
139 eItemKind kind,eDataType datatype,int dimension);
140 ~BadVariableKindTypeException() ARCANE_NOEXCEPT override {}
141
142 public:
143
144 void explain(std::ostream& m) const override;
145
146 private:
147
148 IVariable *m_valid_var;
149 eItemKind m_item_kind;
150 eDataType m_data_type;
151 int m_dimension;
152};
153
154/*---------------------------------------------------------------------------*/
155/*---------------------------------------------------------------------------*/
164class ARCANE_CORE_EXPORT BadPartialVariableItemGroupNameException
165: public Exception
166{
167 public:
168
169 BadPartialVariableItemGroupNameException(const TraceInfo& where,IVariable* valid_var,
170 const String& item_group_name);
171 ~BadPartialVariableItemGroupNameException() ARCANE_NOEXCEPT override {}
172
173 public:
174
175 void explain(std::ostream& m) const override;
176
177 private:
178
179 IVariable *m_valid_var;
180 String m_item_group_name;
181};
182
183
184/*---------------------------------------------------------------------------*/
185/*---------------------------------------------------------------------------*/
191class ARCANE_CORE_EXPORT UnknownItemTypeException
192: public Exception
193{
194 public:
195
196 UnknownItemTypeException(const String& where,Integer nb_node,Integer item_id);
197 UnknownItemTypeException(const UnknownItemTypeException& ex) ARCANE_NOEXCEPT;
198 ~UnknownItemTypeException() ARCANE_NOEXCEPT override {}
199
200 public:
201
202 void explain(std::ostream& m) const override;
203
204 private:
205
206 Integer m_nb_node;
207 Integer m_item_id;
208};
209
210/*---------------------------------------------------------------------------*/
211/*---------------------------------------------------------------------------*/
216class ARCANE_CORE_EXPORT BadReferenceException
217: public Exception
218{
219 public:
220
221 explicit BadReferenceException(const String& where);
222 ~BadReferenceException() ARCANE_NOEXCEPT override {}
223
224 public:
225
226 void explain(std::ostream& m) const override;
227
228 private:
229};
230
231/*---------------------------------------------------------------------------*/
232/*---------------------------------------------------------------------------*/
237class ARCANE_CORE_EXPORT ReaderWriterException
238: public Exception
239{
240 public:
241
242 ReaderWriterException(const String& where,const String& message);
243 ReaderWriterException(const TraceInfo& where,const String& message);
244 ReaderWriterException(const ReaderWriterException& ex) ARCANE_NOEXCEPT;
245 ~ReaderWriterException() ARCANE_NOEXCEPT override {}
246
247 public:
248
249 void explain(std::ostream& m) const override;
250};
251
252/*---------------------------------------------------------------------------*/
253/*---------------------------------------------------------------------------*/
258class ARCANE_CORE_EXPORT AssertionException
259: public Exception
260{
261 public:
265 explicit AssertionException(const TraceInfo& where);
266
271 AssertionException(const TraceInfo& where, const String& expected, const String& actual);
272
273 public:
274
275 void explain(std::ostream& m) const override;
277 const char* file() const { return m_file; }
279 int line() const { return m_line; }
280
281 public:
282
283 using Exception::where;
284 using Exception::message;
285
286 private:
287
288 const char* m_file;
289 int m_line;
290};
291
292/*---------------------------------------------------------------------------*/
293/*---------------------------------------------------------------------------*/
294
295} // End namespace Arcane
296
297/*---------------------------------------------------------------------------*/
298/*---------------------------------------------------------------------------*/
299
300#endif
Déclarations des types généraux de Arcane.
const String & where() const
Localisation de l'exception.
const char * file() const
Fichier de l'exception.
int line() const
Ligne de l'exception.
void explain(std::ostream &m) const override
Explique la cause de l'exception dans le flot o.
AssertionException(const TraceInfo &where)
BadIDException(const String &where, const String &invalid_name)
void explain(std::ostream &m) const override
Explique la cause de l'exception dans le flot o.
String m_invalid_name
Identifiant invalide.
BadItemIdException(const String &where, Integer bad_id)
Construit une exception.
Integer m_bad_id
Numéro invalide.
void explain(std::ostream &m) const override
Explique la cause de l'exception dans le flot o.
void explain(std::ostream &m) const override
Explique la cause de l'exception dans le flot o.
void explain(std::ostream &m) const override
Explique la cause de l'exception dans le flot o.
void explain(std::ostream &m) const override
Explique la cause de l'exception dans le flot o.
const String & where() const
Localisation de l'exception.
const String & message() const
Message de l'exception.
Exception(const String &name, const String &where)
Interface d'une variable.
Definition IVariable.h:39
void explain(std::ostream &m) const override
Explique la cause de l'exception dans le flot o.
void explain(std::ostream &m) const override
Explique la cause de l'exception dans le flot o.
Chaîne de caractères unicode.
void explain(std::ostream &m) const override
Explique la cause de l'exception dans le flot o.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.
eItemKind
Genre d'entité de maillage.
eDataType
Type d'une donnée.
Definition DataTypes.h:39