CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/DataFormats/Common/src/MergeableCounter.cc

Go to the documentation of this file.
00001 #include "DataFormats/Common/interface/MergeableCounter.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 
00004 namespace edm 
00005 {
00006 
00007   bool MergeableCounter::mergeProduct(MergeableCounter const& a) 
00008   {
00009     if (a.value > 0 && value+a.value < a.value){
00010       edm::LogWarning("MergeableCounter|ProductsNotMergeable")
00011         << "The merge would lead to an overflow of the counter" << std::endl;
00012       return false;
00013     }
00014     value += a.value;
00015     return true;
00016   }
00017 
00018 }