Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ISharedReference.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 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/* ISharedReference.h (C) 2000-2025 */
9/* */
10/* Interface of the reference counter class. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ISHAREDREFERENCE_H
13#define ARCANE_CORE_ISHAREDREFERENCE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/Ptr.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
42class ARCANE_CORE_EXPORT ISharedReference
43{
44 public:
45
47 virtual ~ISharedReference() = default;
48
49 public:
50
52 virtual void addRef() = 0;
53
55 virtual void removeRef() = 0;
56
58 virtual Int32 refCount() const = 0;
59};
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64} // namespace Arcane
65
66/*---------------------------------------------------------------------------*/
67/*---------------------------------------------------------------------------*/
68
69#endif
Interface of a reference counter.
virtual Int32 refCount() const =0
Returns the value of the reference counter.
virtual ~ISharedReference()=default
Releases resources.
virtual void removeRef()=0
Decrements the reference counter.
virtual void addRef()=0
Increments the reference counter.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int32_t Int32
Signed integer type of 32 bits.