Scheduler
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
terminates.cpp
Go to the documentation of this file.
1 
10 #include "terminates.h"
11 
12 
13 #include <cassert>
14 #include <scheduler/system.h>
16 #include <scheduler/process.h>
18 #include <scheduler/time.h>
19 
20 
21 using namespace Scheduler;
22 
23 
25 {
26  assert(task != nullptr);
27  print();
28 
31  scheduler->clearRunningTask(task);
32  scheduler->scheduleTask(eventType);
33  return;
34 }
35 
36 std::string Terminates::getName()
37 {
38  return "Task terminates";
39 }
40 
41 
std::shared_ptr< Process > task
Definition: event.h:60
virtual void print()
print information about the event
Definition: event.cpp:41
std::string getName() override
get the name of the event
Definition: terminates.cpp:36
static double getTime()
Definition: time.cpp:16
static System * getInstance()
Definition: system.cpp:28
void scheduleTask(TriggeringEvent trigger)
This function is the scheduler. When called, it schedule the task to be executed on the processor ama...
void put(double currentTime, std::shared_ptr< Process > p)
TaskScheduler * getScheduler()
returns the task scheduler object
Definition: system.cpp:110
void clearRunningTask(std::shared_ptr< Process > p)
static SpecialMailbox * getInstance()
TriggeringEvent eventType
The event type is need by the scheduling discipline, to determine if this kind of event triggers invo...
Definition: event.h:64
void process() override
handle the the event TODO: &#39;process&#39; is maybe not the best word for that, given that our simulator ac...
Definition: terminates.cpp:24