-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskFactory.cpp
More file actions
30 lines (26 loc) · 855 Bytes
/
TaskFactory.cpp
File metadata and controls
30 lines (26 loc) · 855 Bytes
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
#include "task.hpp"
class TaskFactory{
public:
TaskFactory() {}
~TaskFactory() {}
task* create(std::string name, std::string description, std::string date, int priority){
task* newTask = new task(name, description, date, priority);
return newTask;
}
Base* modifyName(task* base, std::string name){
base->setName(name);
return base;
}
Base* modifyDescription(task* base, std::string description){
base->setDescription(description);
return base;
}
Base* modifyPriority(task* base, int priority){
base->set_priority(priority);
return base;
}
Base* modifyDate(Base* base, std::string date){
base->set_date(date);
return base;
}
};