ConstPrecisionAdaptor< Type, InputType, Container > Class Template Reference

A const Field/List wrapper with possible data conversion. More...

Inheritance diagram for ConstPrecisionAdaptor< Type, InputType, Container >:
[legend]
Collaboration diagram for ConstPrecisionAdaptor< Type, InputType, Container >:
[legend]

Public Types

typedef Container< Type > FieldType
 The adapted field type. Same as element_type. More...
 
- Public Types inherited from refPtr< T >
typedef T element_type
 Type of object being managed or referenced. More...
 
typedef Tpointer
 Pointer to type of object being managed or referenced. More...
 
typedef Foam::refCount::zero refCount
 Null reference counter class. More...
 

Public Member Functions

 ConstPrecisionAdaptor ()=default
 Default construct, setting content later. More...
 
 ConstPrecisionAdaptor (const Container< InputType > &input)
 Construct from Container of InputType, copying if required. More...
 
 ConstPrecisionAdaptor (tmp< Container< InputType > > &&input)
 Construct from tmp Container of InputType, copy/move as required. More...
 
 ConstPrecisionAdaptor (const tmp< Container< InputType > > &input)
 Construct from tmp Container of InputType, copy/move as required. More...
 
bool active () const noexcept
 Is precision adaption being used (non-passive adaptor)? More...
 
void commit ()
 Commit adapted content changes (no-op for const adaptor) More...
 
void set (const Container< InputType > &input)
 Set adaptor for different input, copying input if required. More...
 
void set (tmp< Container< InputType > > &&input)
 Set adaptor for tmp Container of InputType, copy/move as required. More...
 
void set (const tmp< Container< InputType > > &input)
 Set adaptor for tmp Container of InputType, copy/move as required. More...
 
- Public Member Functions inherited from refPtr< T >
constexpr refPtr () noexcept
 Construct with no managed pointer. More...
 
constexpr refPtr (std::nullptr_t) noexcept
 Construct with no managed pointer (literal nullptr). More...
 
constexpr refPtr (T *p) noexcept
 Construct, taking ownership of the pointer. More...
 
 refPtr (autoPtr< T > &&ptr) noexcept
 Move construct from autoPtr, transferring ownership. More...
 
 refPtr (std::unique_ptr< T > &&ptr) noexcept
 Move construct from unique_ptr, transferring ownership. More...
 
constexpr refPtr (const T &obj) noexcept
 Construct for a const reference to an object. More...
 
 refPtr (refPtr< T > &&rhs) noexcept
 Move construct, transferring ownership. More...
 
 refPtr (const refPtr< T > &rhs)
 Copy construct (shallow copy) More...
 
 refPtr (const refPtr< T > &rhs, bool reuse)
 Copy/move construct. Optionally reusing pointer. More...
 
 ~refPtr ()
 Destructor: deletes managed pointer. More...
 
bool good () const noexcept
 True if pointer/reference is non-null. More...
 
bool is_const () const noexcept
 If the stored/referenced content is const. More...
 
bool is_pointer () const noexcept
 True if this is a managed pointer (not a reference) More...
 
bool movable () const noexcept
 True if this is a non-null managed pointer. More...
 
Tget () noexcept
 Return pointer without nullptr checking. More...
 
const Tget () const noexcept
 Return const pointer without nullptr checking. More...
 
const Tcref () const
 
Tref () const
 
TconstCast () const
 
refPtr< TshallowClone () const noexcept
 
Trelease () noexcept
 
Tptr () const
 Return managed pointer for reuse, or clone() the object reference. More...
 
void clear () const noexcept
 
void reset (refPtr< T > &&other) noexcept
 Clear existing and transfer ownership. More...
 
void reset (T *p=nullptr) noexcept
 Delete managed pointer and set to new given pointer. More...
 
void reset (autoPtr< T > &&other) noexcept
 Clear existing and transfer ownership from autoPtr. More...
 
void reset (std::unique_ptr< T > &&other)
 Clear existing and transfer ownership from unique_ptr. More...
 
void cref (const refPtr< T > &other) noexcept
 Clear existing and set (const) reference from other. More...
 
void cref (const T &obj) noexcept
 Clear existing and set (const) reference. More...
 
void cref (const T *p) noexcept
 Clear existing and set (const) reference to pointer content. More...
 
void ref (T &obj) noexcept
 Clear existing and set (non-const) reference. More...
 
void ref (T *p) noexcept
 Clear existing and set (non-const) reference to pointer content. More...
 
void swap (refPtr< T > &other) noexcept
 Swaps the managed object with other. More...
 
const Toperator* () const
 Return const reference to the object. More...
 
Toperator* ()
 Return reference to the managed object. More...
 
const Toperator-> () const
 Dereferences (const) pointer to the managed object. More...
 
Toperator-> ()
 Dereferences (non-const) pointer to the managed object. More...
 
const Toperator() () const
 Return const reference to the object - same as cref() method. More...
 
 operator bool () const noexcept
 True if pointer/reference is non-null. Same as good() More...
 
 operator const T & () const
 Cast to underlying data type, using the cref() method. More...
 
void operator= (const refPtr< T > &other)
 Transfer ownership of the managed pointer. More...
 
void operator= (refPtr< T > &&other) noexcept
 Clear existing and transfer ownership. More...
 
void operator= (T *p)
 Take ownership of the pointer. More...
 
void operator= (std::nullptr_t) noexcept
 Reset via assignment from literal nullptr. More...
 
 operator tmp< T > ()
 Conversion to tmp, releases pointer or shallow-copies reference. More...
 
bool valid () const noexcept
 Identical to good(), or bool operator. More...
 
bool empty () const noexcept
 Deprecated(2020-07) True if a null managed pointer. More...
 
template<class... Args>
Foam::refPtr< TNew (Args &&... args)
 
template<class U , class... Args>
Foam::refPtr< TNewFrom (Args &&... args)
 

Static Public Member Functions

static const Container< Type > & select (const Container< InputType > &input, Container< Type > &other)
 
- Static Public Member Functions inherited from refPtr< T >
template<class... Args>
static refPtr< TNew (Args &&... args)
 Construct refPtr of T with forwarding arguments. More...
 
template<class U , class... Args>
static refPtr< TNewFrom (Args &&... args)
 Construct refPtr from derived type with forwarding arguments. More...
 
static word typeName ()
 The type-name, constructed from type-name of T. More...
 

Detailed Description

template<class Type, class InputType, template< class > class Container = Field>
class Foam::ConstPrecisionAdaptor< Type, InputType, Container >

A const Field/List wrapper with possible data conversion.

Definition at line 57 of file PrecisionAdaptor.H.

Member Typedef Documentation

◆ FieldType

typedef Container<Type> FieldType

The adapted field type. Same as element_type.

Definition at line 97 of file PrecisionAdaptor.H.

Constructor & Destructor Documentation

◆ ConstPrecisionAdaptor() [1/4]

ConstPrecisionAdaptor ( )
default

Default construct, setting content later.

◆ ConstPrecisionAdaptor() [2/4]

ConstPrecisionAdaptor ( const Container< InputType > &  input)
inlineexplicit

Construct from Container of InputType, copying if required.

Definition at line 106 of file PrecisionAdaptor.H.

References Foam::input().

Here is the call graph for this function:

◆ ConstPrecisionAdaptor() [3/4]

ConstPrecisionAdaptor ( tmp< Container< InputType > > &&  input)
inlineexplicit

Construct from tmp Container of InputType, copy/move as required.

Definition at line 112 of file PrecisionAdaptor.H.

References Foam::input().

Here is the call graph for this function:

◆ ConstPrecisionAdaptor() [4/4]

ConstPrecisionAdaptor ( const tmp< Container< InputType > > &  input)
inlineexplicit

Construct from tmp Container of InputType, copy/move as required.

Definition at line 118 of file PrecisionAdaptor.H.

References Foam::input().

Here is the call graph for this function:

Member Function Documentation

◆ active()

bool active ( ) const
inlinenoexcept

Is precision adaption being used (non-passive adaptor)?

Definition at line 127 of file PrecisionAdaptor.H.

References refPtr< T >::good(), and refPtr< T >::is_pointer().

Here is the call graph for this function:

◆ commit()

void commit ( )
inline

Commit adapted content changes (no-op for const adaptor)

Definition at line 134 of file PrecisionAdaptor.H.

◆ set() [1/3]

void set ( const Container< InputType > &  input)
inline

Set adaptor for different input, copying input if required.

Definition at line 138 of file PrecisionAdaptor.H.

References Foam::input().

Here is the call graph for this function:

◆ set() [2/3]

void set ( tmp< Container< InputType > > &&  input)
inline

Set adaptor for tmp Container of InputType, copy/move as required.

Definition at line 144 of file PrecisionAdaptor.H.

References Foam::input().

Here is the call graph for this function:

◆ set() [3/3]

void set ( const tmp< Container< InputType > > &  input)
inline

Set adaptor for tmp Container of InputType, copy/move as required.

Definition at line 150 of file PrecisionAdaptor.H.

References Foam::input().

Here is the call graph for this function:

◆ select()

static const Container< Type > & select ( const Container< InputType > &  input,
Container< Type > &  other 
)
inlinestatic

Select a reference to the input (if types are identical), or copy into other and return a reference to that

Definition at line 160 of file PrecisionAdaptor.H.

References Foam::input().

Here is the call graph for this function:

The documentation for this class was generated from the following file: