exprValueUnion Union Reference

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

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. More...
 
template<class Type >
void set (const Type &val) noexcept
 No generic set(), only specialized methods. More...
 
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. More...
 

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 83 of file exprValue.H.

Member Function Documentation

◆ notSpecialized()

static void notSpecialized ( const std::string &  msg)
inlinestaticnoexcept

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 106 of file exprValue.H.

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

Referenced by exprValueUnion::set().

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

◆ get() [1/8]

const Type* get ( ) const
inlinenoexcept

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

Definition at line 118 of file exprValue.H.

◆ set() [1/8]

void set ( const Type &  val)
inlinenoexcept

No generic set(), only specialized methods.

Definition at line 124 of file exprValue.H.

References Foam::name(), and exprValueUnion::notSpecialized().

Here is the call graph for this function:

◆ get() [2/8]

const scalar* get ( ) const
inlinenoexcept

Return read pointer to scalar union member

Definition at line 152 of file exprValue.H.

◆ set() [2/8]

void set ( const scalar &  val)
inlinenoexcept

Set scalar value

Definition at line 152 of file exprValue.H.

◆ get() [3/8]

const vector* get ( ) const
inlinenoexcept

Return read pointer to vector union member

Definition at line 152 of file exprValue.H.

◆ set() [3/8]

void set ( const vector val)
inlinenoexcept

Set vector value

Definition at line 152 of file exprValue.H.

◆ get() [4/8]

const tensor* get ( ) const
inlinenoexcept

Return read pointer to tensor union member

Definition at line 152 of file exprValue.H.

◆ set() [4/8]

void set ( const tensor val)
inlinenoexcept

Set tensor value

Definition at line 152 of file exprValue.H.

◆ get() [5/8]

const symmTensor* get ( ) const
inlinenoexcept

Return read pointer to symmTensor union member

Definition at line 152 of file exprValue.H.

◆ set() [5/8]

void set ( const symmTensor val)
inlinenoexcept

Set symmTensor value

Definition at line 152 of file exprValue.H.

◆ get() [6/8]

const sphericalTensor* get ( ) const
inlinenoexcept

Return read pointer to sphericalTensor union member

Definition at line 152 of file exprValue.H.

◆ set() [6/8]

void set ( const sphericalTensor val)
inlinenoexcept

Set sphericalTensor value

Definition at line 152 of file exprValue.H.

◆ get() [7/8]

const label* get ( ) const
inlinenoexcept

Return read pointer to label union member

Definition at line 152 of file exprValue.H.

◆ set() [7/8]

void set ( const label &  val)
inlinenoexcept

Set label value

Definition at line 152 of file exprValue.H.

◆ get() [8/8]

const bool* get ( ) const
inlinenoexcept

Return read pointer to bool union member

Definition at line 152 of file exprValue.H.

◆ set() [8/8]

void set ( const bool &  val)
inlinenoexcept

Set bool value

Definition at line 152 of file exprValue.H.

Member Data Documentation

◆ scalarValue

scalar scalarValue

Define scalar data member

Definition at line 93 of file exprValue.H.

◆ vectorValue

vector vectorValue

Define vector data member

Definition at line 93 of file exprValue.H.

◆ tensorValue

tensor tensorValue

Define tensor data member

Definition at line 93 of file exprValue.H.

◆ symmTensorValue

symmTensor symmTensorValue

Define symmTensor data member

Definition at line 93 of file exprValue.H.

◆ sphericalTensorValue

sphericalTensor sphericalTensorValue

Define sphericalTensor data member

Definition at line 93 of file exprValue.H.

◆ labelValue

label labelValue

Define label data member

Definition at line 93 of file exprValue.H.

◆ boolValue

bool boolValue

Define bool data member

Definition at line 93 of file exprValue.H.


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