thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
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.
 
 IUnit (const IUnit< T, UT > &iu)
 Copy constructor.
 

Public Attributes

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

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() [1/2]

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.

◆ IUnit() [2/2]

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

Copy constructor.

Definition at line 71 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.

◆ 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.


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