Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ReferenceCounterImpl.h File Reference
#include "ArccoreGlobal.h"
#include "arccore/base/ReferenceCounter.h"
#include "arccore/base/RefBase.h"
#include <atomic>
Include dependency graph for ReferenceCounterImpl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Arcane::ReferenceCounterImpl
 Thread-safe implementation of a reference counter. More...

Namespaces

namespace  Arccore
 Namespace of Arccore.
namespace  Arcane
 -- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --

Macros

#define ARCCORE_INTERNAL_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS(OPTIONAL_OVERRIDE)
#define ARCCORE_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS()
 Macro to define methods managing counters of references.
#define ARCCORE_DEFINE_REFERENCE_COUNTED_CLASS(class_name)
 Macro to define methods and types for a class that uses a reference counter.

Detailed Description

This file should only be included by implementation classes using a reference counter. For declarations, use the file 'RefDeclarations.h'

Definition in file ReferenceCounterImpl.h.

Macro Definition Documentation

◆ ARCCORE_DEFINE_REFERENCE_COUNTED_CLASS

#define ARCCORE_DEFINE_REFERENCE_COUNTED_CLASS ( class_name)
Value:
template class ExternalReferenceCounterAccessor<class_name>

Macro to define methods and types for a class that uses a reference counter.

This macro must be used for a class for which the macro ARCCORE_DECLARE_REFERENCE_COUNTED_CLASS() was used. It must be located in a single translation unit (a '.cc' file, for example) and be used in the Arccore namespace. For example:

namespace Arccore
{
}
#define ARCCORE_DEFINE_REFERENCE_COUNTED_CLASS(class_name)
Macro to define methods and types for a class that uses a reference counter.
Namespace of Arccore.

Definition at line 250 of file ReferenceCounterImpl.h.

◆ ARCCORE_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS

#define ARCCORE_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS ( )
Value:
#define ARCCORE_INTERNAL_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS(OPTIONAL_OVERRIDE)

Macro to define methods managing counters of references.

This macro is used in a class implementing an interface for which the macro ARCCORE_DECLARE_REFERENCE_COUNTED_INCLASS_METHODS() was used. The implementation class must inherit from ReferenceCounterImpl. For example:

class MyClass
: public ReferenceCounterImpl
, public IMyInterface
{
public:
void myMethod1() override;
};
#define ARCCORE_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS()
Macro to define methods managing counters of references.

Definition at line 228 of file ReferenceCounterImpl.h.

◆ ARCCORE_INTERNAL_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS

#define ARCCORE_INTERNAL_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS ( OPTIONAL_OVERRIDE)
Value:
private: \
\
using BaseCounterType = ::Arcane::ReferenceCounterImpl; \
\
public: \
\
BaseCounterType* _internalReferenceCounter() OPTIONAL_OVERRIDE \
{ \
return this; \
} \
void _internalAddReference() OPTIONAL_OVERRIDE \
{ \
BaseCounterType::_internalAddReference(); \
} \
bool _internalRemoveReference() OPTIONAL_OVERRIDE \
{ \
return BaseCounterType::_internalRemoveReference(); \
}
Thread-safe implementation of a reference counter.

Generic macro to define methods managing reference counters.

Definition at line 185 of file ReferenceCounterImpl.h.