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

◆ MergeableCounter()

edm::MergeableCounter::MergeableCounter ( )
inline

Definition at line 7 of file MergeableCounter.h.

7 : value() {}

◆ ~MergeableCounter()

edm::MergeableCounter::~MergeableCounter ( )
inline

Definition at line 8 of file MergeableCounter.h.

8 {}

Member Function Documentation

◆ mergeProduct()

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

Definition at line 8 of file MergeableCounter.cc.

8  {
9  if (a.value > 0 && value + a.value < a.value) {
10  edm::LogWarning("MergeableCounter|ProductsNotMergeable")
11  << "The merge would lead to an overflow of the counter" << std::endl;
12  return false;
13  }
14  value += a.value;
15  return true;
16  }

References a.

◆ swap()

void edm::MergeableCounter::swap ( MergeableCounter iOther)

Definition at line 18 of file MergeableCounter.cc.

18 { std::swap(value, iOther.value); }

References std::swap(), and value.

Member Data Documentation

◆ value

int edm::MergeableCounter::value
edm::MergeableCounter::value
int value
Definition: MergeableCounter.h:11
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
edm::LogWarning
Definition: MessageLogger.h:141
a
double a
Definition: hdecay.h:119
value
Definition: value.py:1