CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/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 }