Loading...
Searching...
No Matches
ConstPrecisionAdaptor< Type, InputType, Container > Class Template Reference

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

#include <PrecisionAdaptor.H>

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

Public Types

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

Public Member Functions

 ConstPrecisionAdaptor ()=default
 Default construct, setting content later.
 ConstPrecisionAdaptor (const Container< InputType > &input)
 Construct from Container of InputType, copying if required.
 ConstPrecisionAdaptor (tmp< Container< InputType > > &&input)
 Construct from tmp Container of InputType, copy/move as required.
 ConstPrecisionAdaptor (const tmp< Container< InputType > > &input)
 Construct from tmp Container of InputType, copy/move as required.
bool active () const noexcept
 Is precision adaption being used (non-passive adaptor)?
void commit ()
 Commit adapted content changes (no-op for const adaptor).
void set (const Container< InputType > &input)
 Set adaptor for different input, copying input if required.
void set (tmp< Container< InputType > > &&input)
 Set adaptor for tmp Container of InputType, copy/move as required.
void set (const tmp< Container< InputType > > &input)
 Set adaptor for tmp Container of InputType, copy/move as required.
Public Member Functions inherited from refPtr< Field< Type > >
constexpr refPtr () noexcept
 Construct with no managed pointer.
 ~refPtr () noexcept
 Destructor: deletes managed pointer.
bool good () const noexcept
 True if pointer/reference is non-null.
bool is_const () const noexcept
 If the stored/referenced content is const.
bool is_pointer () const noexcept
 True if this is a managed pointer (not a reference).
bool is_reference () const noexcept
 True if this is a reference (not a pointer).
bool movable () const noexcept
 True if this is a non-null managed pointer.
Field< Type > * get () noexcept
 Return pointer without nullptr checking.
const Field< Type > & cref () const
 Return const reference to the object or to the contents of a (non-null) managed pointer.
Field< Type > & ref () const
 Return non-const reference to the contents of a non-null managed pointer.
Field< Type > & constCast () const
 Return non-const reference to the object or to the contents of a (non-null) managed pointer, with an additional const_cast.
refPtr< Field< Type > > shallowClone () const noexcept
 Return a shallow copy as a wrapped reference, preserving the const/non-const status.
Field< Type > * release () noexcept
 Release ownership and return the pointer. A no-op for reference objects (returns nullptr).
Field< Type > * ptr () const
 Return managed pointer for reuse, or clone() the object reference.
void clear () const noexcept
 If object pointer points to valid object: delete object and set pointer to nullptr.
void reset (Field< Type > *p=nullptr) noexcept
 Delete managed pointer and set to new given pointer.
Field< Type > & emplace (Args &&... args)
 Reset with emplace construction. Return reference to the new content.
void swap (refPtr< Field< Type > > &other) noexcept
 Swaps the managed object with other.
const Field< Type > & operator* () const
 Return const reference to the object.
const Field< Type > * operator-> () const
 Dereferences (const) pointer to the managed object.
const Field< Type > & operator() () const
 Return const reference to the object - same as cref() method.
 operator bool () const noexcept
 True if pointer/reference is non-null. Same as good().
 operator const Field< Type > & () const
 Cast to underlying data type, using the cref() method.
void operator= (const refPtr< Field< Type > > &other)
 Transfer ownership of managed pointer.
 operator tmp< Field< Type > > ()
 Conversion to tmp, releases pointer or shallow-copies reference.
bool valid () const noexcept
 Identical to good(), or bool operator.
bool empty () const noexcept
 Deprecated(2020-07) True if a null managed pointer.

Static Public Member Functions

static const Container< Type > & select (const Container< InputType > &input, Container< Type > &other)
 Select a reference to the input (if types are identical), or copy into other and return a reference to that.
Static Public Member Functions inherited from refPtr< Field< Type > >
static refPtr< Field< Type > > New (Args &&... args)
 Construct refPtr with forwarding arguments.
static refPtr< Field< Type > > NewFrom (Args &&... args)
 Construct refPtr from derived type with forwarding arguments.
static word typeName ()
 The type-name, constructed from type-name of T.

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 53 of file PrecisionAdaptor.H.

Member Typedef Documentation

◆ FieldType

template<class Type, class InputType, template< class > class Container = Field>
typedef Container<Type> FieldType

The adapted field type. Same as element_type.

Definition at line 99 of file PrecisionAdaptor.H.

Constructor & Destructor Documentation

◆ ConstPrecisionAdaptor() [1/4]

template<class Type, class InputType, template< class > class Container = Field>
ConstPrecisionAdaptor ( )
default

Default construct, setting content later.

◆ ConstPrecisionAdaptor() [2/4]

template<class Type, class InputType, template< class > class Container = Field>
ConstPrecisionAdaptor ( const Container< InputType > & input)
inlineexplicit

Construct from Container of InputType, copying if required.

Definition at line 112 of file PrecisionAdaptor.H.

◆ ConstPrecisionAdaptor() [3/4]

template<class Type, class InputType, template< class > class Container = Field>
ConstPrecisionAdaptor ( tmp< Container< InputType > > && input)
inlineexplicit

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

Definition at line 120 of file PrecisionAdaptor.H.

◆ ConstPrecisionAdaptor() [4/4]

template<class Type, class InputType, template< class > class Container = Field>
ConstPrecisionAdaptor ( const tmp< Container< InputType > > & input)
inlineexplicit

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

Definition at line 128 of file PrecisionAdaptor.H.

Member Function Documentation

◆ active()

template<class Type, class InputType, template< class > class Container = Field>
bool active ( ) const
inlinenoexcept

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

Definition at line 139 of file PrecisionAdaptor.H.

References refPtr< Field< Type > >::good(), refPtr< Field< Type > >::is_pointer(), and Foam::noexcept.

Here is the call graph for this function:

◆ commit()

template<class Type, class InputType, template< class > class Container = Field>
void commit ( )
inline

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

Definition at line 148 of file PrecisionAdaptor.H.

◆ set() [1/3]

template<class Type, class InputType, template< class > class Container = Field>
void set ( const Container< InputType > & input)
inline

Set adaptor for different input, copying input if required.

Definition at line 154 of file PrecisionAdaptor.H.

Referenced by kahipDecomp::decomposeSerial(), metisDecomp::decomposeSerial(), and scotchDecomp::decomposeSerial().

Here is the caller graph for this function:

◆ set() [2/3]

template<class Type, class InputType, template< class > class Container = Field>
void set ( tmp< Container< InputType > > && input)
inline

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

Definition at line 162 of file PrecisionAdaptor.H.

◆ set() [3/3]

template<class Type, class InputType, template< class > class Container = Field>
void set ( const tmp< Container< InputType > > & input)
inline

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

Definition at line 170 of file PrecisionAdaptor.H.

◆ select()

template<class Type, class InputType, template< class > class Container = Field>
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 182 of file PrecisionAdaptor.H.


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