paul@65 | 1 | #pragma once |
paul@65 | 2 | |
paul@65 | 3 | #include "pipe_opener_interface.h" |
paul@65 | 4 | #include "pipe_paging.h" |
paul@65 | 5 | #include "resource.h" |
paul@65 | 6 | |
paul@65 | 7 | /* Support for providing access to pipes. */ |
paul@65 | 8 | |
paul@65 | 9 | class PipeOpenerResource : public Resource, public PipeOpener |
paul@65 | 10 | { |
paul@65 | 11 | protected: |
paul@66 | 12 | long open_endpoint(PipePaging *paging, bool writing, l4_cap_idx_t *endpoint); |
paul@65 | 13 | |
paul@65 | 14 | public: |
paul@66 | 15 | explicit PipeOpenerResource(); |
paul@65 | 16 | |
paul@65 | 17 | /* Server details. */ |
paul@65 | 18 | |
paul@65 | 19 | int expected_items(); |
paul@65 | 20 | |
paul@65 | 21 | ipc_server_handler_type handler(); |
paul@65 | 22 | |
paul@65 | 23 | void *interface() |
paul@65 | 24 | { return static_cast<PipeOpener *>(this); } |
paul@65 | 25 | |
paul@65 | 26 | /* PipeOpener interface methods. */ |
paul@65 | 27 | |
paul@66 | 28 | long pipe(offset_t size, l4_cap_idx_t *reader, l4_cap_idx_t *writer); |
paul@65 | 29 | }; |
paul@65 | 30 | |
paul@65 | 31 | // vim: tabstop=4 expandtab shiftwidth=4 |