thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
ThePEG::IUnit< T, UT > Struct Template Reference

The IUnit class is used to facilitate input of unitful numbers from and to a persistent stream. More...

#include <UnitIO.h>

Public Member Functions

 IUnit (T &t, const UT &u)
 Constructor given an object to be read assuming the given unit. More...
 
 IUnit (const IUnit< T, UT > &iu)
 Copy constructor.
 

Public Attributes

T & theX
 Reference to the object to be read. More...
 
const UT & theUnit
 The unit assumed when reading the object. More...
 

Detailed Description

template<typename T, typename UT>
struct ThePEG::IUnit< T, UT >

The IUnit class is used to facilitate input of unitful numbers from and to a persistent stream.

An Energy can hence be read like this:
is >> iunit(x, GeV);
Also containers of unitful numbers may be read like this, as well as LorentzVector and ThreeVector.

See also
PersistentOStream
PersistentIStream

Definition at line 64 of file UnitIO.h.

Constructor & Destructor Documentation

◆ IUnit()

template<typename T, typename UT>
ThePEG::IUnit< T, UT >::IUnit ( T &  t,
const UT &  u 
)
inline

Constructor given an object to be read assuming the given unit.

Definition at line 68 of file UnitIO.h.

Member Data Documentation

◆ theUnit

template<typename T, typename UT>
const UT& ThePEG::IUnit< T, UT >::theUnit

The unit assumed when reading the object.

Definition at line 77 of file UnitIO.h.

Referenced by ThePEG::operator>>().

◆ theX

template<typename T, typename UT>
T& ThePEG::IUnit< T, UT >::theX

Reference to the object to be read.

Definition at line 74 of file UnitIO.h.

Referenced by ThePEG::operator>>().


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