File: EnumIO.h
Description:
The IEnum and OEnum classes are used to
facilitate input and output of enums from and to
persistent streams. An Enum can hence be read and written like
this:
is << ienum(x);
os
>> oenum(x);
See
also:
namespace Pythia7
template <typename T>
STRUCT
OEnum
Public members:
OEnum(const T & t): theT(t) {}
OEnum(const OEnum & oe): theT(oe.theT) {}
const T & theT;
template <typename T>
STRUCT
IEnum
Public members:
IEnum(T & t): theT(t) {}
IEnum(const IEnum & ie): theT(ie.theT) {}
T & theT;
template <typename T>
inline OEnum<T> oenum(const T & t) {
return OEnum<T>(t);
template <typename T>
inline IEnum<T> ienum(T & t) {
return IEnum<T>(t);
template <typename OStream, typename T>
OStream & operator<<(OStream & os, const OEnum<T> & e) {
os << long(e.theT);
return os;
template <typename IStream, typename T>
IStream & operator>>(IStream & is, const IEnum<T> & e) {
long l = 0;
is >> l;
e.theT = T(l);
return is;
DEFINED MACROS