Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include "ThingAlgorithm.h"
#include "DataFormats/TestObjects/interface/Thing.h"

namespace edmtest {
  void ThingAlgorithm::run(ThingCollection& thingCollection) const {
    thingCollection.reserve(nThings_);
    auto offset = offset_.fetch_add(offsetDelta_);
    int nItems = nThings_;
    if (grow_) {
      nItems *= offset;
    }
    for (int i = 0; i < nItems; ++i) {
      Thing tc;
      tc.a = i + offset;
      thingCollection.push_back(tc);
    }
  }
}  // namespace edmtest