Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ArrayDebugInfo.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* ArrayDebugInfo.h (C) 2000-2023 */
9/* */
10/* Informations de debug pour les classes tableaux. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_COLLECTIONS_ARRAYDEBUGINFO_H
13#define ARCCORE_COLLECTIONS_ARRAYDEBUGINFO_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/collections/CollectionsGlobal.h"
18
19#include "arccore/base/String.h"
20
21#include <atomic>
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arccore
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
37class ARCCORE_COLLECTIONS_EXPORT ArrayDebugInfo
38{
39 public:
40
41 ArrayDebugInfo() = default;
42
43 private:
44
45 ~ArrayDebugInfo() = default;
46
47 public:
48
49 void addReference() { ++m_nb_ref; }
50 void removeReference()
51 {
52 Int32 n = --m_nb_ref;
53 if (n == 0)
54 delete this;
55 }
56 void setName(const String& name) { m_name = name; }
57 const String& name() const { return m_name; }
58
59 private:
60
61 std::atomic<Int32> m_nb_ref = 0;
62 String m_name;
63};
64
65/*---------------------------------------------------------------------------*/
66/*---------------------------------------------------------------------------*/
67
68} // namespace Arccore
69
70/*---------------------------------------------------------------------------*/
71/*---------------------------------------------------------------------------*/
72
73#endif
Informations de debug pour les classes tableaux.
Chaîne de caractères unicode.
Espace de nom de Arccore.
Definition ArcaneTypes.h:24
std::int32_t Int32
Type entier signé sur 32 bits.