Make some fdevent member functions pure virtual.

...because that makes our coverage numbers look better. But since there
are only two concrete classes anyway, we weren't gaining much from the
default implementation and it's arguably more intention-revealing now.

Test: treehugger
Change-Id: I7a8a3195023048b1a84277358b857222692d96ee
This commit is contained in:
Elliott Hughes 2020-05-12 16:17:11 -07:00
parent a269c7c3d1
commit 631fe1e6df
3 changed files with 9 additions and 2 deletions

View file

@ -79,8 +79,8 @@ struct fdevent_context {
unique_fd Destroy(fdevent* fde);
protected:
virtual void Register(fdevent*) {}
virtual void Unregister(fdevent*) {}
virtual void Register(fdevent*) = 0;
virtual void Unregister(fdevent*) = 0;
public:
// Change which events should cause notifications.

View file

@ -211,3 +211,7 @@ void fdevent_context_poll::Interrupt() {
PLOG(FATAL) << "failed to write to fdevent interrupt fd";
}
}
void fdevent_context_poll::Register(fdevent*) {}
void fdevent_context_poll::Unregister(fdevent*) {}

View file

@ -48,6 +48,9 @@ struct fdevent_context_poll final : public fdevent_context {
fdevent_context_poll();
virtual ~fdevent_context_poll();
virtual void Register(fdevent* fde) final;
virtual void Unregister(fdevent* fde) final;
virtual void Set(fdevent* fde, unsigned events) final;
virtual void Loop() final;