CMS 3D CMS Logo

ThingAlgorithm.cc
Go to the documentation of this file.
1 #include "ThingAlgorithm.h"
2 #include "DataFormats/TestObjects/interface/Thing.h"
3 
4 namespace edmtest {
5  void ThingAlgorithm::run(ThingCollection& thingCollection) const {
6  thingCollection.reserve(nThings_);
7  auto offset = offset_.fetch_add(offsetDelta_);
8  int nItems = nThings_;
9  if (grow_) {
10  nItems *= offset;
11  }
12  for (int i = 0; i < nItems; ++i) {
13  Thing tc;
14  tc.a = i + offset;
15  thingCollection.push_back(tc);
16  }
17  }
18 } // namespace edmtest
std::atomic< long > offset_
void run(ThingCollection &thingCollection) const