1 #pragma once 2 3 #include <l4/sys/ipc.h> 4 5 #include "opener_context_resource.h" 6 #include "opener_interface.h" 7 #include "paging.h" 8 #include "pages.h" 9 #include "resource.h" 10 11 /* Support for providing access to files. */ 12 13 class OpenerResource : public Resource, public Paging, public Opener 14 { 15 public: 16 explicit OpenerResource(Pages *pages); 17 18 /* Server details. */ 19 20 int expected_items(); 21 22 ipc_server_handler_type handler(); 23 24 void *interface() 25 { return static_cast<Opener *>(this); } 26 27 /* Direct access methods. */ 28 29 Pager *open(const char *path, flags_t flags); 30 31 /* Opener interface methods. */ 32 33 long context(l4_cap_idx_t *context); 34 }; 35 36 // vim: tabstop=4 expandtab shiftwidth=4