Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:36

0001 #ifndef Integration_ThingAlgorithm_h
0002 #define Integration_ThingAlgorithm_h
0003 
0004 /** \class ThingAlgorithm
0005  *
0006  ************************************************************/
0007 #include "DataFormats/TestObjects/interface/ThingCollectionfwd.h"
0008 #include <atomic>
0009 
0010 namespace edmtest {
0011   class ThingAlgorithm {
0012   public:
0013     ThingAlgorithm(long iOffsetDelta = 0, int nThings = 20, bool grow = false)
0014         : offset_(0), offsetDelta_(iOffsetDelta), nThings_(nThings), grow_(grow) {}
0015 
0016     /// Runs the algorithm and returns a list of Things
0017     /// The user declares the vector and calls this method.
0018     void run(ThingCollection& thingCollection) const;
0019 
0020   private:
0021     mutable std::atomic<long> offset_;
0022     const long offsetDelta_;
0023     const int nThings_;
0024     const bool grow_;
0025   };
0026 
0027 }  // namespace edmtest
0028 
0029 #endif