1 #pragma once 2 3 #include "mapped_file_object_interface.h" 4 #include "pager.h" 5 6 /* A pager abstraction for a file. */ 7 8 class FilePager : public Pager, public MappedFileObject 9 { 10 public: 11 fileid_t fileid; 12 13 explicit FilePager(fileid_t fileid, PageMapper *mapper, flags_t flags); 14 15 /* Server details. */ 16 17 int expected_items(); 18 19 ipc_server_handler_type handler(); 20 21 void *interface() 22 { return static_cast<MappedFileObject *>(this); } 23 24 /* File methods. */ 25 26 virtual long flush(offset_t populated_size, offset_t *size); 27 28 virtual long resize(offset_t *size); 29 30 /* Pager and mapped file methods. */ 31 32 virtual long map(unsigned long offset, l4_addr_t hot_spot, flags_t flags, l4_snd_fpage_t *region); 33 34 virtual long mmap(offset_t position, offset_t length, offset_t *start_pos, offset_t *end_pos, offset_t *data_end); 35 }; 36 37 // vim: tabstop=4 expandtab shiftwidth=4