-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.h
45 lines (34 loc) · 1.01 KB
/
task.h
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
#ifndef TASK_H
#define TASK_H
#include <vector>
#include <string>
#include <unordered_set>
using std::vector;
using std::string;
using std::unordered_set;
class Task {
private:
string name; // name of the task
string description; // optional task description
int priority; // used to keep track of priority of task
unordered_set<string> tags; // holds all of the tasks tags
public:
// constructors
Task( const string& name );
Task( const string& name, int priority );
// getters
int getPriority() const;
const string& getName() const;
const string& getDesc() const;
const unordered_set<string>& getTags() const;
// setters
void setPriority( int p );
void setDesc( const string& desc );
void addTag( const string& tag );
void removeTag( const string& tag );
// useful
bool hasTag( const string& tag ) const;
bool operator< ( const Task& other ) const;
bool active() const;
};
#endif