DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
UnitBase< T, NativeType >::Evaluator Struct Reference

#include <DLG4Units.hh>

Collaboration diagram for UnitBase< T, NativeType >::Evaluator:
[legend]

Public Member Functions

 Evaluator (UnitBase &p, G4double s)
 
 Evaluator (const Evaluator &)=delete
 
 Evaluator (Evaluator &&)=delete
 
Evaluatoroperator= (const Evaluator &)=delete
 
Evaluatoroperator= (Evaluator &&)=delete
 
void operator= (NativeType val) &&
 
 operator NativeType () const
 

Public Attributes

UnitBaseparent
 
G4double scale
 

Friends

std::istream & operator>> (std::istream &is, Evaluator &&ev)
 

Detailed Description

template<class T, typename NativeType>
struct DLG4::Units::UnitBase< T, NativeType >::Evaluator

Definition at line 99 of file DLG4Units.hh.

Constructor & Destructor Documentation

◆ Evaluator() [1/3]

template<class T , typename NativeType >
Evaluator ( UnitBase p,
G4double  s 
)
inline

Definition at line 104 of file DLG4Units.hh.

◆ Evaluator() [2/3]

template<class T , typename NativeType >
Evaluator ( const Evaluator )
delete

◆ Evaluator() [3/3]

template<class T , typename NativeType >
Evaluator ( Evaluator &&  )
delete

Member Function Documentation

◆ operator NativeType()

template<class T , typename NativeType >
operator NativeType ( ) const
inline

Definition at line 123 of file DLG4Units.hh.

123 {
124 parent.CheckValue("Evaluator");
125 return *(parent.NativeValue_) / scale;
126 }
void CheckValue(const G4String &context) const
Definition DLG4Units.hh:262
std::optional< NativeType > NativeValue_
Definition DLG4Units.hh:96

◆ operator=() [1/3]

template<class T , typename NativeType >
Evaluator & operator= ( const Evaluator )
delete

◆ operator=() [2/3]

template<class T , typename NativeType >
Evaluator & operator= ( Evaluator &&  )
delete

◆ operator=() [3/3]

template<class T , typename NativeType >
void operator= ( NativeType  val) &&
inline

Definition at line 121 of file DLG4Units.hh.

121{ parent.NativeValue_ = val * scale; }

Friends And Related Symbol Documentation

◆ operator>>

template<class T , typename NativeType >
std::istream & operator>> ( std::istream &  is,
Evaluator &&  ev 
)
friend

Definition at line 128 of file DLG4Units.hh.

128 {
129 NativeType temp_val;
130 if (is >> temp_val) {
131 // Use existing rvalue assignment mechanism to update the parent
132 std::move(ev) = temp_val;
133 }
134 return is;
135 }
std::conditional_t< std::is_base_of_v< Unit3Vec, T >, G4ThreeVector, std::conditional_t< std::is_base_of_v< UnitTag, T >, G4double, T > > NativeType
Definition DLG4Units.hh:615

Member Data Documentation

◆ parent

template<class T , typename NativeType >
UnitBase& parent

Definition at line 100 of file DLG4Units.hh.

◆ scale

template<class T , typename NativeType >
G4double scale

Definition at line 101 of file DLG4Units.hh.


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