gems: add direct fs constructor to Watch_handler

issue #3294
This commit is contained in:
Sebastian Sumpf 2019-04-18 12:53:12 +02:00 committed by Christian Helmuth
parent bc14a32998
commit 399487c85d
1 changed files with 12 additions and 0 deletions

View File

@ -570,6 +570,12 @@ class Genode::Watcher
Directory::join(dir._path, rel_path), handler);
}
Watcher(Vfs::File_system &fs, Directory::Path const &rel_path,
Genode::Allocator &alloc, Vfs::Watch_response_handler &handler)
{
_watch(fs, alloc, rel_path, handler);
}
~Watcher() { _handle->fs().close(_handle); }
};
@ -592,6 +598,12 @@ class Genode::Watch_handler : public Vfs::Watch_response_handler,
Watcher(dir, rel_path, *this), _obj(obj), _member(member)
{ }
Watch_handler(Vfs::File_system &fs, Directory::Path const &rel_path,
Genode::Allocator &alloc, T &obj, void (T::*member)())
:
Watcher(fs,rel_path, alloc, *this), _obj(obj), _member(member)
{ }
void watch_response() override { (_obj.*_member)(); }
};