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. More...
 
- Public Types inherited from refPtr< Container< Type > >
typedef Container< Type > element_type
 Type of object being managed or referenced. More...
 
typedef Container< Type > * pointer
 Pointer to type of object being managed or referenced. More...
 
typedef Foam::refCount::zero refCount
 Null reference counter class. More...
 

Public Member Functions

 ConstPrecisionAdaptor (const Container< InputType > &input)
 Construct from Container<InputType>, copying on input as required. More...
 
 ConstPrecisionAdaptor (tmp< Container< InputType >> &&input)
 Construct from tmp Container, copy/move as required. More...
 
 ConstPrecisionAdaptor (const tmp< Container< InputType >> &input)
 Construct from tmp Container, copy/move as required. More...
 
- Public Member Functions inherited from refPtr< Container< Type > >
Foam::refPtr< Container< Type > > New (Args &&... args)
 
Foam::refPtr< Container< Type > > NewFrom (Args &&... args)
 
constexpr refPtr () noexcept
 Default construct, no managed pointer. More...
 
constexpr refPtr (std::nullptr_t) noexcept
 Construct with no managed pointer. More...
 
constexpr refPtr (Container< Type > *p) noexcept
 Construct, taking ownership of the pointer. More...
 
 refPtr (autoPtr< Container< Type > > &&ptr) noexcept
 Move construct from autoPtr, transferring ownership. More...
 
 refPtr (std::unique_ptr< Container< Type > > &&ptr) noexcept
 Move construct from unique_ptr, transferring ownership. More...
 
constexpr refPtr (const Container< Type > &obj) noexcept
 Construct for a const reference to an object. More...
 
 refPtr (refPtr< Container< Type > > &&rhs) noexcept
 Move construct, transferring ownership. More...
 
 refPtr (const refPtr< Container< Type > > &rhs)
 Copy construct. More...
 
 refPtr (const refPtr< Container< Type > > &rhs, bool reuse)
 Copy/move construct. Optionally reusing pointer. More...
 
 ~refPtr ()
 Destructor: deletes managed pointer. More...
 
bool empty () const noexcept
 Deprecated(2020-07) True if a null managed pointer. More...
 
bool valid () const noexcept
 True for non-null pointer/reference. More...
 
bool is_pointer () const noexcept
 True if this is a managed pointer (not a reference) More...
 
bool isTmp () const noexcept
 Identical to is_pointer() More...
 
bool movable () const noexcept
 True if this is a non-null managed pointer. More...
 
Container< Type > * get () noexcept
 Return pointer without nullptr checking. More...
 
const Container< Type > * get () const noexcept
 Return const pointer without nullptr checking. More...
 
const Container< Type > & cref () const
 
void cref (const Container< Type > &obj) noexcept
 Delete managed temporary object and set to (const) reference. More...
 
Container< Type > & ref () const
 
void ref (Container< Type > &obj) noexcept
 Delete managed temporary object and set to (non-const) reference. More...
 
Container< Type > & constCast () const
 
Container< Type > * ptr () const
 Return managed pointer for reuse, or clone() the object reference. More...
 
void clear () const noexcept
 
void reset (Container< Type > *p=nullptr) noexcept
 Delete managed temporary object and set to new given pointer. More...
 
void reset (autoPtr< Container< Type > > &&other) noexcept
 Clear existing and transfer ownership from autoPtr. More...
 
void reset (std::unique_ptr< Container< Type > > &&other)
 Clear existing and transfer ownership from unique_ptr. More...
 
void reset (refPtr< Container< Type > > &&other) noexcept
 Clear existing and transfer ownership. More...
 
void swap (refPtr< Container< Type > > &other) noexcept
 Swaps the managed object with other. More...
 
const Container< Type > * operator-> () const
 Dereferences (const) pointer to the managed object. More...
 
Container< Type > * operator-> ()
 Dereferences (non-const) pointer to the managed object. More...
 
const Container< Type > & operator() () const
 Return const reference to the object - same as cref() method. More...
 
 operator const Container< Type > & () const
 Cast to underlying data type, using the cref() method. More...
 
 operator bool () const noexcept
 Non-null pointer/reference : valid() More...
 
void operator= (const refPtr< Container< Type > > &other)
 Transfer ownership of the managed pointer. More...
 
void operator= (refPtr< Container< Type > > &&other) noexcept
 Clear existing and transfer ownership. More...
 
void operator= (Container< Type > *p)
 Take ownership of the pointer. More...
 
void operator= (std::nullptr_t) noexcept
 Reset via assignment from literal nullptr. More...
 
 operator tmp< Container< Type > > ()
 Conversion to tmp, releases pointer or shallow-copies reference. More...
 

Static Public Member Functions

static const Container< Type > & get (const Container< InputType > &input, Container< Type > &dst)
 Return the field. More...
 
- Static Public Member Functions inherited from refPtr< Container< Type > >
static refPtr< Container< Type > > New (Args &&... args)
 Construct refPtr of T with forwarding arguments. More...
 
static refPtr< Container< Type > > NewFrom (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 51 of file PrecisionAdaptor.H.

Member Typedef Documentation

◆ FieldType

typedef Container<Type> FieldType

The adapted field type.

Definition at line 93 of file PrecisionAdaptor.H.

Constructor & Destructor Documentation

◆ ConstPrecisionAdaptor() [1/3]

ConstPrecisionAdaptor ( const Container< InputType > &  input)
inline

Construct from Container<InputType>, copying on input as required.

Definition at line 99 of file PrecisionAdaptor.H.

References refPtr< Container< Type > >::cref(), and Foam::input().

Here is the call graph for this function:

◆ ConstPrecisionAdaptor() [2/3]

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

Construct from tmp Container, copy/move as required.

Definition at line 116 of file PrecisionAdaptor.H.

References Foam::input().

Here is the call graph for this function:

◆ ConstPrecisionAdaptor() [3/3]

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

Construct from tmp Container, copy/move as required.

Definition at line 125 of file PrecisionAdaptor.H.

References Foam::input().

Here is the call graph for this function:

Member Function Documentation

◆ get()

static const Container<Type>& get ( const Container< InputType > &  input,
Container< Type > &  dst 
)
inlinestatic

Return the field.

Definition at line 139 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: