CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
edm::MergeableCounter Struct Reference

#include <MergeableCounter.h>

Public Member Functions

 MergeableCounter ()
 
bool mergeProduct (MergeableCounter const &newThing)
 
void swap (MergeableCounter &iOther)
 
 ~MergeableCounter ()
 

Public Attributes

int value
 

Detailed Description

Definition at line 6 of file MergeableCounter.h.

Constructor & Destructor Documentation

edm::MergeableCounter::MergeableCounter ( )
inline

Definition at line 7 of file MergeableCounter.h.

edm::MergeableCounter::~MergeableCounter ( )
inline

Definition at line 8 of file MergeableCounter.h.

References mergeProduct(), and swap().

8 {}

Member Function Documentation

bool edm::MergeableCounter::mergeProduct ( MergeableCounter const &  newThing)

Definition at line 9 of file MergeableCounter.cc.

References value.

Referenced by ~MergeableCounter().

10  {
11  if (a.value > 0 && value+a.value < a.value){
12  edm::LogWarning("MergeableCounter|ProductsNotMergeable")
13  << "The merge would lead to an overflow of the counter" << std::endl;
14  return false;
15  }
16  value += a.value;
17  return true;
18  }
Definition: value.py:1
double a
Definition: hdecay.h:121
void edm::MergeableCounter::swap ( MergeableCounter iOther)

Definition at line 20 of file MergeableCounter.cc.

References std::swap(), and value.

Referenced by ~MergeableCounter().

20  {
21  std::swap(value, iOther.value);
22  }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: value.py:1

Member Data Documentation

int edm::MergeableCounter::value