-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogger.hxx
85 lines (70 loc) · 1.6 KB
/
Logger.hxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef LOGGER_H
#define LOGGER_H
#include "Task.hxx"
#include <list>
#include <iostream>
#include <string>
#include <algorithm>
#include <fstream>
/**
* Logger class declaration
* @author Richard Kerr
* @author Dillon Koval
*/
class Logger
{
public:
/**
* Constructor
* @param output file, verbose boolean
* Opens output file if applicable
*/
Logger(bool);
/**
* Destructor
*/
~Logger();
/**
* Adds a finished task to the tasklist
*/
void addTask(Task* task);
/**
* Writes pertinent information about task to output file
*/
void readTasks();
/**
* If in verbose mode, writes out which tasks have run
*/
void reportRun(Task* task);
/**
* If in verbose mode, writes out the current time
*/
void reportStep(int time);
/**
* Reports a task blocking
*/
void reportBlock(Task* task);
/**
* Reports a task unblocking
*/
void reportUnblock(Task* task);
/**
* Reports a task finishing
*/
void reportFinish(Task* task);
/**
* Reports a task missing deadline
*/
void reportMissedDeadline(Task* task);
/**
* Returns number of missed deadlines
*/
int getDeadlineMissed();
private:
std::list<Task*> taskList;
std::ofstream output;
std::string fileName_;
bool verbose;
int deadlineMissed;
};
#endif