Scheduler
ready.cpp
Go to the documentation of this file.
1 
10 #include "ready.h"
11 
12 #include <cassert>
13 
14 #include <scheduler/system.h>
15 #include <scheduler/queue.h>
17 #include <scheduler/process.h>
18 
19 using namespace Scheduler;
20 
21 
23 {
24  assert(task != nullptr);
27  print();
29  return;
30 }
31 
32 std::string Ready::getName()
33 {
34  return "Task ready";
35 }
36 
37 
38 
39 
std::shared_ptr< Process > task
Definition: event.h:60
virtual void print()
print information about the event
Definition: event.cpp:41
static System * getInstance()
Definition: system.cpp:28
static Queue * getReadyQueue()
get a pointer to the system&#39;s ready queue
Definition: queue.cpp:30
static Queue * getWaitQueue()
get a pointer to the system&#39;s wait queue
Definition: queue.cpp:37
void scheduleTask(TriggeringEvent trigger)
This function is the scheduler. When called, it schedule the task to be executed on the processor ama...
std::string getName() override
get the name of the event
Definition: ready.cpp:32
TaskScheduler * getScheduler()
returns the task scheduler object
Definition: system.cpp:110
std::shared_ptr< Process > remove(std::shared_ptr< Process > p)
removes the process from the queue. Note: this does not delete the process. Just remove it from queue...
Definition: queue.cpp:48
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: ready.cpp:22
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 add(std::shared_ptr< Process > p)
add a process to the queue
Definition: queue.cpp:23