3#include "facilities/Scheduler.h"
4#include "facilities/ScheduledEvent.h"
16 assert( s_instance==0);
37 insert(std::make_pair(m_time+deltaT, event));
44 while( !empty() && m_running ) {
47 std::pair<double, ScheduledEvent*> entry = *begin();
55 (*m_log) <<
"\t" << entry.first <<
'\t' << entry.second->name() << std::endl ;
57 entry.second->execute();
68 out <<
"\nScheduler stack: current time = " <<
elapsed_time() << std::endl;
69 out <<
"\ttime\tclass name\n";
70 for( const_iterator it= begin(); it !=end(); ++it){
71 std::pair<double, ScheduledEvent*> entry = *it;
72 out <<
"\t" << entry.first <<
'\t' << entry.second->name() << std::endl ;
81 out <<
"\nSchedule event: current time = " <<
elapsed_time() << std::endl;
82 out <<
"\ttime\tEvent\n";
void printOn(std::ostream &out) const
static Scheduler * instance()
GPStime elapsed_time() const
void setLog(std::ostream &out)
void schedule(double deltaT, ScheduledEvent *event)
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")