Loading...
Searching...
No Matches
exprValueUnion Union Reference

The data content (as a union). More...

#include <exprValue.H>

Collaboration diagram for exprValueUnion:

Public Member Functions

template<class Type>
const Type * get () const noexcept
 Return read pointer to typed union member, which is nullptr for unspecialized versions.
template<class Type>
void set (const Type &val) noexcept
 No generic set(), only specialized methods.
template<>
const scalar * get () const noexcept
template<>
void set (const scalar &val) noexcept
template<>
const vectorget () const noexcept
template<>
void set (const vector &val) noexcept
template<>
const tensorget () const noexcept
template<>
void set (const tensor &val) noexcept
template<>
const symmTensorget () const noexcept
template<>
void set (const symmTensor &val) noexcept
template<>
const sphericalTensorget () const noexcept
template<>
void set (const sphericalTensor &val) noexcept
template<>
const label * get () const noexcept
template<>
void set (const label &val) noexcept
template<>
const bool * get () const noexcept
template<>
void set (const bool &val) noexcept

Static Public Member Functions

static void notSpecialized (const std::string &msg) noexcept
 Runtime 'assert' for unimplemented generic methods.

Public Attributes

scalar scalarValue
vector vectorValue
tensor tensorValue
symmTensor symmTensorValue
sphericalTensor sphericalTensorValue
label labelValue
bool boolValue

Detailed Description

The data content (as a union).

The stem of the member names correspond identically to the data types to enable macro definitions (naming similar to Foam::token)

Definition at line 81 of file exprValue.H.

Member Function Documentation

◆ notSpecialized()

void notSpecialized ( const std::string & msg)
staticnoexcept

Runtime 'assert' for unimplemented generic methods.

This seems to be the best way to catch programming errors since static_assert does not help here. The 'noexcept' is slightly misleading (needed for the caller)

Definition at line 29 of file exprValue.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.

Referenced by set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get() [1/8]

template<class Type>
const Type * get ( ) const
inlinenoexcept

Return read pointer to typed union member, which is nullptr for unspecialized versions.

Definition at line 111 of file exprValue.H.

References Foam::noexcept.

◆ set() [1/8]

template<class Type>
void set ( const Type & val)
inlinenoexcept

No generic set(), only specialized methods.

Definition at line 117 of file exprValue.H.

References name, and notSpecialized().

Here is the call graph for this function:

◆ get() [2/8]

template<>
const scalar * get ( ) const
inlinenoexcept

Return read pointer to scalar union member

Definition at line 145 of file exprValue.H.

References defineMultiTypeValueUnionMethods.

◆ set() [2/8]

template<>
void set ( const scalar & val)
inlinenoexcept

Set scalar value

Definition at line 145 of file exprValue.H.

◆ get() [3/8]

template<>
const vector * get ( ) const
inlinenoexcept

Return read pointer to vector union member

Definition at line 145 of file exprValue.H.

◆ set() [3/8]

template<>
void set ( const vector & val)
inlinenoexcept

Set vector value

Definition at line 145 of file exprValue.H.

◆ get() [4/8]

template<>
const tensor * get ( ) const
inlinenoexcept

Return read pointer to tensor union member

Definition at line 145 of file exprValue.H.

◆ set() [4/8]

template<>
void set ( const tensor & val)
inlinenoexcept

Set tensor value

Definition at line 145 of file exprValue.H.

◆ get() [5/8]

template<>
const symmTensor * get ( ) const
inlinenoexcept

Return read pointer to symmTensor union member

Definition at line 145 of file exprValue.H.

◆ set() [5/8]

template<>
void set ( const symmTensor & val)
inlinenoexcept

Set symmTensor value

Definition at line 145 of file exprValue.H.

◆ get() [6/8]

template<>
const sphericalTensor * get ( ) const
inlinenoexcept

Return read pointer to sphericalTensor union member

Definition at line 145 of file exprValue.H.

◆ set() [6/8]

template<>
void set ( const sphericalTensor & val)
inlinenoexcept

Set sphericalTensor value

Definition at line 145 of file exprValue.H.

◆ get() [7/8]

template<>
const label * get ( ) const
inlinenoexcept

Return read pointer to label union member

Definition at line 145 of file exprValue.H.

◆ set() [7/8]

template<>
void set ( const label & val)
inlinenoexcept

Set label value

Definition at line 145 of file exprValue.H.

◆ get() [8/8]

template<>
const bool * get ( ) const
inlinenoexcept

Return read pointer to bool union member

Definition at line 145 of file exprValue.H.

◆ set() [8/8]

template<>
void set ( const bool & val)
inlinenoexcept

Set bool value

Definition at line 145 of file exprValue.H.

Member Data Documentation

◆ scalarValue

scalar scalarValue

Define scalar data member

Definition at line 91 of file exprValue.H.

◆ vectorValue

vector vectorValue

Define vector data member

Definition at line 91 of file exprValue.H.

◆ tensorValue

tensor tensorValue

Define tensor data member

Definition at line 91 of file exprValue.H.

◆ symmTensorValue

symmTensor symmTensorValue

Define symmTensor data member

Definition at line 91 of file exprValue.H.

◆ sphericalTensorValue

sphericalTensor sphericalTensorValue

Define sphericalTensor data member

Definition at line 91 of file exprValue.H.

◆ labelValue

label labelValue

Define label data member

Definition at line 91 of file exprValue.H.

◆ boolValue

bool boolValue

Define bool data member

Definition at line 91 of file exprValue.H.


The documentation for this union was generated from the following files: