Arcane  v4.1.1.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ExceptionUtils.h
Aller à la documentation de ce fichier.
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/* ExceptionUtils.h (C) 2000-2025 */
9/* */
10/* Fonctions utilitaires pour la gestion des exceptions. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_COMMON_EXCEPTIONUTILS_H
13#define ARCCORE_COMMON_EXCEPTIONUTILS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arccore/common/CommonGlobal.h"
19
20#include <functional>
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane::ExceptionUtils
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
41extern "C++" ARCCORE_COMMON_EXPORT Int32
42print(ITraceMng* tm, bool is_no_continue = true);
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
55extern "C++" ARCCORE_COMMON_EXPORT Int32
56print(const std::exception& ex, ITraceMng* tm, bool is_no_continue = true);
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
69extern "C++" ARCCORE_COMMON_EXPORT Int32
70print(const Exception& ex, ITraceMng* tm, bool is_no_continue = true);
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
90extern "C++" ARCCORE_COMMON_EXPORT Int32
91callWithTryCatch(std::function<void()> function, ITraceMng* tm = nullptr);
92
93/*---------------------------------------------------------------------------*/
94/*---------------------------------------------------------------------------*/
101extern "C++" ARCCORE_COMMON_EXPORT void
102callAndTerminateIfThrow(std::function<void()> function, ITraceMng* tm = nullptr);
103
104/*---------------------------------------------------------------------------*/
105/*---------------------------------------------------------------------------*/
106
107} // namespace Arcane::ExceptionUtils
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
111
112#endif
Déclarations des types de la composante 'base' de Arccore.
ARCCORE_COMMON_EXPORT Int32 print(ITraceMng *tm, bool is_no_continue=true)
Imprime un message pour une exception inconnue.
ARCCORE_COMMON_EXPORT void callAndTerminateIfThrow(std::function< void()> function, ITraceMng *tm=nullptr)
Appelle une fonction et termine le programme en cas d'exception.
ARCCORE_COMMON_EXPORT Int32 callWithTryCatch(std::function< void()> function, ITraceMng *tm=nullptr)
Appelle une fonction en récupérant et affichant les exceptions.
std::int32_t Int32
Type entier signé sur 32 bits.