69template<
class T>
class refPtr;
70template<
class T>
class tmp;
71template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
97 mutable refType type_;
103 inline void checkUseCount()
const;
130 inline explicit
tmp(
T*
p);
175 template<class... Args>
187 template<
class U,
class... Args>
229 inline const T&
cref()
const;
234 inline T&
ref()
const;
245 inline T*
ptr()
const;
269 template<class... Args>
313 inline const
T* operator->() const;
317 inline
T* operator->();
320 const
T& operator()()
const {
return cref(); }
326 explicit operator bool() const
noexcept {
return bool(ptr_); }
329 operator const T&()
const {
return cref(); }
376 std::is_void_v<typename T::is_GeometricField>
Expression wrap of const tmp to GeometricField.
Expression wrap of const tmp to List.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Generic GeometricField class.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Reference counter for various OpenFOAM components.
A class for managing references or pointers (no reference counting).
A class for managing temporary objects.
void operator=(std::nullptr_t) noexcept
Reset via assignment from literal nullptr.
T & emplace(Args &&... args)
Reset with emplace construction. Return reference to the new content.
void swap(tmp< T > &other) noexcept
Swaps the managed object with other.
bool is_reference() const noexcept
True if this is a reference (not a pointer).
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.
void protect(bool on) noexcept
Use specified protection against moving for the managed pointer. No-op for references.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
auto expr() const
Wrap value as expression.
T & constCast() const
Return non-const reference to the object or to the contents of a (non-null) managed pointer,...
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
If object pointer points to valid object: delete object and set pointer to nullptr.
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.
void reset(const refPtr< T > &)=delete
Avoid inadvertent casting (to object).
bool isTmp() const noexcept
Identical to is_pointer(). Prefer is_pointer() or movable().
bool is_const() const noexcept
If the stored/referenced content is const.
static tmp< T > New(Args &&... args)
Construct tmp 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.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
constexpr tmp() noexcept
Construct with no managed pointer.
A class for handling words, derived from Foam::string.
limits reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL))
A namespace for expression templates.
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Foam::argList args(argc, argv)
#define FOAM_DEPRECATED_FOR(since, replacement)