Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4DimensionedType< T, ConversionErrorPolicy > Class Template Reference

#include <G4DimensionedType.hh>

Inheritance diagram for G4DimensionedType< T, ConversionErrorPolicy >:
Collaboration 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
 

Detailed Description

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

Definition at line 48 of file G4DimensionedType.hh.

Constructor & Destructor Documentation

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 {}
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 }
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4bool GetUnitValue(const G4String &unit, G4double &value)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

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

Definition at line 107 of file G4DimensionedType.hh.

107 {}

Member Function Documentation

template<typename T , typename ConversionErrorPolicy >
T G4DimensionedType< T, ConversionErrorPolicy >::DimensionedValue ( ) const

Definition at line 125 of file G4DimensionedType.hh.

126 {
127  return fDimensionedValue;
128 }
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 }
template<typename T , typename ConversionErrorPolicy >
T G4DimensionedType< T, ConversionErrorPolicy >::operator() ( ) const

Definition at line 132 of file G4DimensionedType.hh.

133 {
134  return fDimensionedValue;
135 }
template<typename T , typename ConversionErrorPolicy >
bool G4DimensionedType< T, ConversionErrorPolicy >::operator< ( const G4DimensionedType< T > &  rhs) const

Definition at line 153 of file G4DimensionedType.hh.

154 {
155  return fDimensionedValue < rhs.fDimensionedValue;
156 }
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 }
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 }
template<typename T , typename ConversionErrorPolicy >
T G4DimensionedType< T, ConversionErrorPolicy >::RawValue ( ) const

Definition at line 111 of file G4DimensionedType.hh.

112 {
113  return fValue;
114 }
template<typename T , typename ConversionErrorPolicy >
G4String G4DimensionedType< T, ConversionErrorPolicy >::Unit ( ) const

Definition at line 118 of file G4DimensionedType.hh.

119 {
120  return fUnit;
121 }

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