12#ifndef ARCCORE_BASE_CHECKEDPOINTER_H
13#define ARCCORE_BASE_CHECKEDPOINTER_H
55 template <
typename T2>
75 template <
typename T2>
94 explicit operator bool()
const {
return get() !=
nullptr; }
129 inline bool isNull()
const
140 template <
typename T2>
friend bool
143 return v1.
get() == v2.
get();
152 template <
typename T2>
friend bool
155 return v1.
get() != v2.
get();
Definitions and globals of Arccore.
Encapsulation of a pointer.
CheckedPointer(T *t)
Constructs an instance referring to t.
CheckedPointer()
Constructs an instance without a reference.
const CheckedPointer< T > & operator=(const CheckedPointer< T > &from)
Copy operator.
T * m_value
Pointer to the referenced object.
CheckedPointer(const CheckedPointer< T2 > &from)
Constructs a reference referring to from.
T & operator*() const
Returns the object referenced by the instance.
CheckedPointer(const CheckedPointer< T > &from)
Constructs a reference referring to from.
friend bool operator==(const CheckedPointer< T > &v1, const CheckedPointer< T2 > &v2)
Compares the objects referenced by v1 and v2 The comparison is done pointer by pointer.
friend bool operator!=(const CheckedPointer< T > &v1, const CheckedPointer< T2 > &v2)
Compares the objects referenced by v1 and v2 The comparison is done pointer by pointer.
T * get() const
Returns the object referenced by the instance.
const CheckedPointer< T > & operator=(T *new_value)
Assigns the value new_value to the instance.
T * operator->() const
Returns the object referenced by the instance.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
void arccoreNullPointerError()
Signals the use of a null pointer.