Encapsulation of a pointer. More...
#include <arcane/utils/Ptr.h>
Public Member Functions | |
| PtrT ()=default | |
| Constructs an instance without a reference. | |
| PtrT (T *t) | |
| Constructs an instance referring to t. | |
| T * | operator-> () const |
| Returns the object referenced by the instance. | |
| T & | operator* () const |
| Returns the object referenced by the instance. | |
| T * | get () const |
| Returns the object referenced by the instance. | |
| bool | isNull () const |
Protected Member Functions | |
| PtrT< T > & | operator= (const PtrT< T > &from) |
| Copy operator. | |
| template<typename T2> | |
| PtrT< T > & | operator= (const PtrT< T2 > &from) |
| PtrT< T > & | operator= (T *new_value) |
| Assigns the value new_value to the instance. | |
| PtrT (const PtrT< T > &from) | |
| Constructs a reference referring to from. | |
| template<typename T2> | |
| PtrT (const PtrT< T2 > &from) | |
| Constructs a reference referring to from. | |
Protected Attributes | |
| T * | m_value = nullptr |
| Pointer to the referenced object. | |
Encapsulation of a pointer.
This class does nothing special other than encapsulating a pointer of any type. It serves as a base class for other classes that provide more advanced features like AutoRefT.
To avoid accidental copies, the copy constructor and copy operators are protected.
In debug mode, checks that we do not access a null pointer.
The template parameter does not need to be defined. This class can therefore be instantiated for an opaque type.
|
inlineprotected |
Constructs a reference referring to from.
Definition at line 71 of file Ptr.h.
References m_value, and PtrT().
Referenced by operator=(), operator=(), PtrT(), and PtrT().
|
inlineprotected |
|
inlineexplicit |
|
inline |
Returns the object referenced by the instance.
Definition at line 122 of file Ptr.h.
References m_value.
Referenced by Arcane::VariableIOReaderMng::_readMetaData(), Arcane::LimaCutInfosReader::_readUniqueIndex(), Arcane::DumpWEnsight7::_saveVariableOnGroup(), Arcane::SimpleGridMeshPartitioner::applyMeshPartitioning(), Arcane::InternalInfosDumper::dumpArcaneDatabase(), Arcane::InternalInfosDumper::dumpInternalAllInfos(), Arcane::ManualHdf5VariableWriter::notifyEndWrite(), Arcane::operator!=(), Arcane::operator==(), Arcane::MeshGeneratorService::readMeshFromFile(), Arcane::TimeLoopReader::readTimeLoops(), Arcane::TimeHistoryMngInternal::readVariables(), Arcane::mesh::ItemFamily::reduceFromGhostItems(), and Arcane::TimeLoopMng::setUsedTimeLoop().
|
inline |
|
inline |
Returns the object referenced by the instance.
Definition at line 107 of file Ptr.h.
References Arcane::arcaneNullPointerError(), and m_value.
|
inline |
Returns the object referenced by the instance.
Definition at line 97 of file Ptr.h.
References Arcane::arcaneNullPointerError(), and m_value.
|
inlineprotected |
Copy operator.
Definition at line 50 of file Ptr.h.
References m_value, and PtrT().
Referenced by Arcane::ScopedPtrT< T >::operator=().
|
inlineprotected |
|
inlineprotected |
|
protected |
Pointer to the referenced object.
Definition at line 128 of file Ptr.h.
Referenced by get(), operator*(), operator->(), operator=(), operator=(), Arcane::ScopedPtrT< T >::operator=(), Arcane::ScopedPtrT< T >::operator=(), PtrT(), PtrT(), PtrT(), and Arcane::ScopedPtrT< T >::~ScopedPtrT().