//////////////////////////////////////////////////////////////////// /// \class GLG4Gen /// /// \author Phil Jones -- contact person /// /// REVISION HISTORY:\n /// inherited as part of the generic GLG4 software /// //////////////////////////////////////////////////////////////////// #ifndef __GLG4GenList_h__ #define __GLG4GenList_h__ #include #include "GLG4Gen.hh" class TimeOrder_GLG4Gen { public: bool operator() (const GLG4Gen *a, const GLG4Gen *b) const { // use greater than because priority queue top() returns the // element x for which Compare(x, y) == false for all y return a->NextTime() > b->NextTime(); }; }; class GLG4GenList : public std::priority_queue, TimeOrder_GLG4Gen> { public: inline void SubtractTime(double time) { for (std::vector::iterator i=c.begin(); i != c.end(); i++) (*i)->SubtractTime(time); }; }; #endif