Geant4 9.6.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 48 of file G4DimensionedType.hh.

Constructor & Destructor Documentation

◆ G4DimensionedType() [1/2]

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

Definition at line 87 of file G4DimensionedType.hh.

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

◆ G4DimensionedType() [2/2]

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

Definition at line 94 of file G4DimensionedType.hh.

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

◆ ~G4DimensionedType()

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

Definition at line 107 of file G4DimensionedType.hh.

107{}

Member Function Documentation

◆ DimensionedValue()

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

Definition at line 125 of file G4DimensionedType.hh.

126{
127 return fDimensionedValue;
128}

◆ operator!=()

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

Definition at line 146 of file G4DimensionedType.hh.

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

◆ operator()()

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

Definition at line 132 of file G4DimensionedType.hh.

133{
134 return fDimensionedValue;
135}

◆ operator<()

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

Definition at line 152 of file G4DimensionedType.hh.

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

◆ operator==()

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

Definition at line 139 of file G4DimensionedType.hh.

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

◆ operator>()

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

Definition at line 160 of file G4DimensionedType.hh.

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

◆ RawValue()

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

Definition at line 111 of file G4DimensionedType.hh.

112{
113 return fValue;
114}

Referenced by operator<<().

◆ Unit()

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

Definition at line 118 of file G4DimensionedType.hh.

119{
120 return fUnit;
121}

Referenced by operator<<().


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