81 mutable refType type_;
88 inline void incrCount();
114 template<
class... Args>
122 template<
class U,
class... Args>
135 inline explicit
tmp(
T*
p);
154 inline
tmp(const
tmp<
T>& rhs,
bool reuse);
193 inline const T&
cref()
const;
198 inline T&
ref()
const;
209 inline T*
ptr()
const;
254 inline const
T* operator->() const;
258 inline
T* operator->();
261 const
T& operator()()
const {
return cref(); }
270 operator const T&()
const {
return cref(); }
287 inline void operator=(std::nullptr_t)
noexcept;
Reference counter for various OpenFOAM components.
A class for managing temporary objects.
void swap(tmp< T > &other) noexcept
Swaps the managed object with other.
bool is_pointer() const noexcept
True if this is a managed pointer (not a reference)
static word typeName()
The type-name, constructed from type-name of T.
bool empty() const noexcept
Deprecated(2020-07) True if a null managed pointer.
Foam::refCount refCount
Reference counter class.
T * get() noexcept
Return pointer without nullptr checking.
bool good() const noexcept
True if pointer/reference is non-null.
T * pointer
Pointer to type of object being managed or referenced.
const T * get() const noexcept
Return const pointer without nullptr checking.
void clear() const noexcept
bool movable() const noexcept
True if this is a non-null managed pointer with a unique ref-count.
void operator=(const tmp< T > &other)
Transfer ownership of the managed pointer.
bool valid() const noexcept
Identical to good(), or bool operator.
void reset(tmp< T > &&other) noexcept
Clear existing and transfer ownership.
bool isTmp() const noexcept
Identical to is_pointer()
bool is_const() const noexcept
If the stored/referenced content is const.
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
T element_type
Type of object being managed or referenced.
static tmp< T > NewFrom(Args &&... args)
Construct tmp from derived type with forwarding arguments.
constexpr tmp() noexcept
Construct with no managed pointer.
A class for handling words, derived from Foam::string.
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
Foam::argList args(argc, argv)
Includes some standard C++ headers, defines global macros and templates used in multiple places by Op...
#define FOAM_DEPRECATED_FOR(since, replacement)