core: fold event-related functions into event class

Not strictly necessary, but more idiomatic C++ and less
polution of the global namespace. This one is so trivial
that there seems to be no reason not to do it.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-25 20:12:10 +02:00 committed by bstoeger
parent c27314d603
commit e237f29fb2
12 changed files with 28 additions and 29 deletions

View file

@ -48,6 +48,10 @@ struct event {
~event();
bool operator==(const event &b2) const;
bool is_gaschange() const;
bool is_divemodechange() const;
event_severity get_severity() const;
};
class event_loop
@ -83,10 +87,6 @@ public:
divemode_t next(int time);
};
extern bool event_is_gaschange(const struct event &ev);
extern bool event_is_divemodechange(const struct event &ev);
extern enum event_severity get_event_severity(const struct event &ev);
extern const struct event *get_first_event(const struct divecomputer &dc, const std::string &name);
extern struct event *get_first_event(struct divecomputer &dc, const std::string &name);