CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/CondCore/RegressionTest/src/PrimitivePayload.cc

Go to the documentation of this file.
00001 #include "CondCore/RegressionTest/interface/PrimitivePayload.h"
00002 #include <sstream>
00003 
00004 PrimitivePayload::PrimitivePayload():
00005   m_i(-1),
00006   t_bool(false),
00007   t_uchar(0),
00008   t_char(-1),
00009   t_short(-1),
00010   t_ushort(0),
00011   t_int(-1),
00012   t_uint(0),
00013   t_long(-1),
00014   t_ulong(0),
00015   t_llong(-1),
00016   t_float(0.),
00017   t_double(0.),
00018   t_string(""),
00019   t_enum(A){
00020 }
00021 
00022 PrimitivePayload::PrimitivePayload( int seed ):
00023   m_i(seed + 9999),
00024   t_bool(false),
00025   t_uchar(seed),
00026   t_char(seed),
00027   t_short(seed),
00028   t_ushort(seed),
00029   t_int(seed),
00030   t_uint(seed),
00031   t_long(seed),
00032   t_ulong(seed),
00033   t_llong(seed),
00034   t_float(seed),
00035   t_double(seed),
00036   t_string(""),
00037   t_enum(A){
00038   if( seed % 2== 0 ){
00039     t_bool = true;
00040     t_enum = D;
00041   }
00042   std::stringstream ss;
00043   ss << seed;
00044   t_string = ss.str(); 
00045 }
00046 
00047 bool PrimitivePayload::operator ==(const PrimitivePayload& rhs) const {
00048   if( m_i != rhs.m_i ) return false;
00049   if( t_bool != rhs.t_bool ) return false;
00050   if( t_uchar != rhs.t_uchar ) return false;
00051   if( t_char != rhs.t_char ) return false;
00052   if( t_short != rhs.t_short ) return false;
00053   if( t_ushort != rhs.t_ushort ) return false;
00054   if( t_int != rhs.t_int ) return false;
00055   if( t_uint != rhs.t_uint ) return false;
00056   if( t_long != rhs.t_long ) return false;
00057   if( t_ulong != rhs.t_ulong ) return false;
00058   if( t_llong != rhs.t_llong ) return false;
00059   if( t_float != rhs.t_float ) return false;
00060   if( t_double != rhs.t_double ) return false;
00061   if( t_string != rhs.t_string ) return false;
00062   if( t_enum != rhs.t_enum ) return false;
00063   return true;
00064 }
00065 bool PrimitivePayload::operator !=(const PrimitivePayload& rhs) const {
00066   return !operator==(rhs);
00067 }