Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DimensionedType< T, ConversionErrorPolicy > Class Template Reference

#include <G4DimensionedType.hh>

+ Inheritance diagram for G4DimensionedType< T, ConversionErrorPolicy >:

Public Member Functions

 G4DimensionedType ()
 
 G4DimensionedType (const T &value, const G4String &unit)
 
virtual ~G4DimensionedType ()
 
RawValue () const
 
G4String Unit () const
 
DimensionedValue () const
 
operator() () const
 
bool operator== (const G4DimensionedType< T > &rhs) const
 
bool operator!= (const G4DimensionedType< T > &rhs) const
 
bool operator< (const G4DimensionedType< T > &rhs) const
 
bool operator> (const G4DimensionedType< T > &rhs) const
 
- Public Member Functions inherited from G4ConversionFatalError
void ReportError (const G4String &input, const G4String &message) const
 

Detailed Description

template<typename T, typename ConversionErrorPolicy = G4ConversionFatalError>
class G4DimensionedType< T, ConversionErrorPolicy >

Definition at line 47 of file G4DimensionedType.hh.

Constructor & Destructor Documentation

◆ G4DimensionedType() [1/2]

template<typename T , typename ConversionErrorPolicy >
G4DimensionedType< T, ConversionErrorPolicy >::G4DimensionedType

Definition at line 86 of file G4DimensionedType.hh.

87 :fValue(0)
88 ,fUnit("Undefined")
89 ,fDimensionedValue(0)
90{}

◆ G4DimensionedType() [2/2]

template<typename T , typename ConversionErrorPolicy >
G4DimensionedType< T, ConversionErrorPolicy >::G4DimensionedType ( const T &  value,
const G4String unit 
)

Definition at line 93 of file G4DimensionedType.hh.

94 :fValue(value)
95 ,fUnit(unit)
96{
97 G4double unitValue(0);
98
99 // Convert unit string to unit value
100 if (!G4DimensionedTypeUtils::GetUnitValue(unit, unitValue)) ConversionErrorPolicy::ReportError(unit, "Invalid unit");
101
102 fDimensionedValue = value*unitValue;
103}
double G4double
Definition: G4Types.hh:83
G4bool GetUnitValue(const G4String &unit, G4double &value)

◆ ~G4DimensionedType()

template<typename T , typename ConversionErrorPolicy >
G4DimensionedType< T, ConversionErrorPolicy >::~G4DimensionedType
virtual

Definition at line 106 of file G4DimensionedType.hh.

106{}

Member Function Documentation

◆ DimensionedValue()

template<typename T , typename ConversionErrorPolicy >
T G4DimensionedType< T, ConversionErrorPolicy >::DimensionedValue

Definition at line 124 of file G4DimensionedType.hh.

125{
126 return fDimensionedValue;
127}

◆ operator!=()

template<typename T , typename ConversionErrorPolicy >
bool G4DimensionedType< T, ConversionErrorPolicy >::operator!= ( const G4DimensionedType< T > &  rhs) const

Definition at line 145 of file G4DimensionedType.hh.

146{
147 return fDimensionedValue != rhs.fDimensionedValue;
148}

◆ operator()()

template<typename T , typename ConversionErrorPolicy >
T G4DimensionedType< T, ConversionErrorPolicy >::operator()

Definition at line 131 of file G4DimensionedType.hh.

132{
133 return fDimensionedValue;
134}

◆ operator<()

template<typename T , typename ConversionErrorPolicy >
bool G4DimensionedType< T, ConversionErrorPolicy >::operator< ( const G4DimensionedType< T > &  rhs) const

Definition at line 151 of file G4DimensionedType.hh.

153{
154 return fDimensionedValue < rhs.fDimensionedValue;
155}

◆ operator==()

template<typename T , typename ConversionErrorPolicy >
bool G4DimensionedType< T, ConversionErrorPolicy >::operator== ( const G4DimensionedType< T > &  rhs) const

Definition at line 138 of file G4DimensionedType.hh.

139{
140 return fDimensionedValue == rhs.fDimensionedValue;
141}

◆ operator>()

template<typename T , typename ConversionErrorPolicy >
bool G4DimensionedType< T, ConversionErrorPolicy >::operator> ( const G4DimensionedType< T > &  rhs) const

Definition at line 159 of file G4DimensionedType.hh.

160{
161 return fDimensionedValue > rhs.fDimensionedValue;
162}

◆ RawValue()

template<typename T , typename ConversionErrorPolicy >
T G4DimensionedType< T, ConversionErrorPolicy >::RawValue

Definition at line 110 of file G4DimensionedType.hh.

111{
112 return fValue;
113}

Referenced by operator<<().

◆ Unit()

template<typename T , typename ConversionErrorPolicy >
G4String G4DimensionedType< T, ConversionErrorPolicy >::Unit

Definition at line 117 of file G4DimensionedType.hh.

118{
119 return fUnit;
120}

Referenced by operator<<().


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