2025-02-09 19:58:55 +01:00
|
|
|
#pragma once
|
2025-02-05 12:48:05 +01:00
|
|
|
#include "std_lib_inc.h"
|
2025-02-09 12:34:07 +01:00
|
|
|
#include "Util.h"
|
2025-02-05 12:48:05 +01:00
|
|
|
#ifndef TASK_H
|
|
|
|
#define TASK_H
|
|
|
|
|
2025-02-09 12:34:07 +01:00
|
|
|
using util::Util;
|
|
|
|
|
2025-02-09 22:30:03 +01:00
|
|
|
namespace models
|
|
|
|
{
|
|
|
|
class AddTask;
|
|
|
|
class Task
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
int id;
|
|
|
|
string name;
|
|
|
|
string description;
|
|
|
|
vector<int> children;
|
2025-02-09 12:34:07 +01:00
|
|
|
|
2025-02-09 22:30:03 +01:00
|
|
|
public:
|
|
|
|
Task(const int& id, const string& name, const string& description, const vector<int>& children);
|
2025-02-09 12:34:07 +01:00
|
|
|
|
2025-02-09 22:30:03 +01:00
|
|
|
Task();
|
2025-02-09 12:34:07 +01:00
|
|
|
|
2025-02-09 22:30:03 +01:00
|
|
|
explicit Task(const AddTask& t);
|
2025-02-09 12:34:07 +01:00
|
|
|
|
2025-02-09 22:30:03 +01:00
|
|
|
ostream& write(ostream& stream) const;
|
2025-02-09 12:34:07 +01:00
|
|
|
|
2025-02-09 22:30:03 +01:00
|
|
|
int get_id() const;
|
2025-02-10 14:41:13 +01:00
|
|
|
bool is_active() const;
|
2025-02-09 22:30:03 +01:00
|
|
|
string get_name() const;
|
|
|
|
string get_description() const;
|
|
|
|
vector<int> get_children() const;
|
2025-02-10 00:00:59 +01:00
|
|
|
static Vector<int> read_children(istream &is);
|
2025-02-09 22:30:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
friend ostream& operator<<(ostream& os, const Task& t);
|
|
|
|
friend istream& operator>>(istream& is, Task& t);
|
2025-02-05 12:48:05 +01:00
|
|
|
};
|
2025-02-09 12:34:07 +01:00
|
|
|
|
2025-02-09 22:30:03 +01:00
|
|
|
class AddTask : public Task
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
public:
|
|
|
|
AddTask();
|
|
|
|
AddTask(Task& t);
|
2025-02-09 19:58:55 +01:00
|
|
|
|
2025-02-09 22:30:03 +01:00
|
|
|
friend ostream& operator<<(ostream& os, const AddTask& t);
|
|
|
|
friend istream& operator>>(istream& is, AddTask& t);
|
2025-02-09 19:58:55 +01:00
|
|
|
};
|
2025-02-09 22:30:03 +01:00
|
|
|
|
2025-02-09 19:58:55 +01:00
|
|
|
ostream& operator<<(ostream& os, const AddTask& t);
|
|
|
|
istream& operator>>(istream& is, AddTask& t);
|
|
|
|
|
|
|
|
ostream& operator<<(ostream& os, const Task& t);
|
|
|
|
istream& operator>>(istream& is, Task& t);
|
2025-02-09 22:30:03 +01:00
|
|
|
} // models
|
2025-02-05 12:48:05 +01:00
|
|
|
|
|
|
|
#endif // TASK_H
|