Arcane  v4.1.2.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
Collection.cc
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/* Collection.cc (C) 2000-2025 */
9/* */
10/* Classe de base d'une collection. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arccore/common/Collection.h"
15
16#include "arccore/base/ArgumentException.h"
17#include "arccore/base/TraceInfo.h"
18
19// Ces fichiers ne sont pas directement utilisés ici mais permettent
20// d'exporter les symboles.
21#include "arccore/common/List.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29namespace
30{
31 void _doNoReferenceError(const void* ptr)
32 {
33 std::cerr << "** FATAL: Null reference.\n";
34 std::cerr << "** FATAL: Trying to use an item not referenced.\n";
35 std::cerr << "** FATAL: Item is located at memory address " << ptr << ".\n";
36 arccoreDebugPause("arcaneNoReferenceError");
37 }
38} // namespace
39
40/*---------------------------------------------------------------------------*/
41/*---------------------------------------------------------------------------*/
42
43void ObjectImpl::
44_noReferenceErrorCallTerminate(const void* ptr)
45{
46 _doNoReferenceError(ptr);
47 std::terminate();
48}
49
50/*---------------------------------------------------------------------------*/
51/*---------------------------------------------------------------------------*/
52
53extern "C" ARCCORE_COMMON_EXPORT void
54throwOutOfRangeException()
55{
56 std::cerr << "** FATAL: Invalid access on a collection (array, list, ...).\n";
57 throw ArgumentException(A_FUNCINFO, "Bad index");
58}
59
60/*---------------------------------------------------------------------------*/
61/*---------------------------------------------------------------------------*/
62
63} // namespace Arcane
64
65/*---------------------------------------------------------------------------*/
66/*---------------------------------------------------------------------------*/
Exception lorsqu'un argument est invalide.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
ARCCORE_BASE_EXPORT void arccoreDebugPause(const char *msg)
Passe en mode pause ou lance une erreur fatale.