blob: 425a70f6a3ceee91d0705f30dc427e0ea8cffb91 (
plain)
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
|
#ifndef EVENT_HH
#define EVENT_HH
#include <memory>
#include <set>
#include <string>
#include <vector>
namespace stuff {
class DB;
class Event {
public:
virtual ~Event() {}
virtual const std::string& name() const = 0;
virtual void set_name(const std::string& name) = 0;
virtual const std::string& text() const = 0;
virtual void set_text(const std::string& text) = 0;
virtual time_t start() const = 0;
virtual void set_start(time_t start) = 0;
virtual void going(std::set<std::string>* going,
std::set<std::string>* not_going) const = 0;
virtual bool is_going(const std::string& name) const = 0;
virtual void update_going(const std::string& name, bool going) = 0;
virtual bool store() = 0;
virtual bool remove() = 0;
static bool setup(DB* db);
static std::unique_ptr<Event> next(std::shared_ptr<DB> db);
static std::vector<std::unique_ptr<Event>> all(std::shared_ptr<DB> db);
static std::unique_ptr<Event> create(std::shared_ptr<DB> db,
const std::string& name, time_t start);
protected:
Event() { }
Event(const Event&) = delete;
Event& operator=(const Event&) = delete;
};
} // namespace stuff
#endif /* EVENT_HH */
|