Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/Rivet/Tools/Cmp.fhh is written in an unsupported language. File is not indexed.

0001 // -*- C++ -*-
0002 #ifndef RIVET_Cmp_FHH
0003 #define RIVET_Cmp_FHH
0004 
0005 namespace Rivet {
0006 
0007 
0008   // Forward-declare the Cmp template class
0009   template <typename T>
0010   class Cmp;
0011 
0012 
0013   /// Enumeration of possible value-comparison states
0014   enum class CmpState {
0015     UNDEF, EQ, NEQ
0016   };
0017 
0018   /// Representation of a CmpState as a string
0019   inline std::string toString(const CmpState& cmpst) {
0020     switch (cmpst) {
0021       case CmpState::UNDEF: return "Cmp: ??";
0022       case CmpState::EQ:    return "Cmp: ==";
0023       case CmpState::NEQ:   return "Cmp: !=";
0024     }
0025     throw Error("CmpState value not in enum list");
0026   }
0027 
0028   /// Stream a CmpState via its toString representation
0029   inline std::ostream& operator << (std::ostream& os, const CmpState& obj) {
0030     os << toString(obj);
0031     return os;
0032   }
0033 
0034 }
0035 
0036 #endif