paul@93 | 1 | /* |
paul@93 | 2 | * A pipe accessor merely resetting allocated memory for use. |
paul@93 | 3 | * |
paul@93 | 4 | * Copyright (C) 2021 Paul Boddie <paul@boddie.org.uk> |
paul@93 | 5 | * |
paul@93 | 6 | * This program is free software; you can redistribute it and/or |
paul@93 | 7 | * modify it under the terms of the GNU General Public License as |
paul@93 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@93 | 9 | * the License, or (at your option) any later version. |
paul@93 | 10 | * |
paul@93 | 11 | * This program is distributed in the hope that it will be useful, |
paul@93 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@93 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@93 | 14 | * GNU General Public License for more details. |
paul@93 | 15 | * |
paul@93 | 16 | * You should have received a copy of the GNU General Public License |
paul@93 | 17 | * along with this program; if not, write to the Free Software |
paul@93 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@93 | 19 | * Boston, MA 02110-1301, USA |
paul@93 | 20 | */ |
paul@93 | 21 | |
paul@65 | 22 | #pragma once |
paul@65 | 23 | |
paul@94 | 24 | #include <fsserver/accessor.h> |
paul@65 | 25 | |
paul@93 | 26 | |
paul@93 | 27 | |
paul@65 | 28 | /* A pipe accessor, providing flexpages for pipe sections. */ |
paul@65 | 29 | |
paul@65 | 30 | class PipeAccessor : public Accessor |
paul@65 | 31 | { |
paul@65 | 32 | protected: |
paul@101 | 33 | offset_t _size; |
paul@65 | 34 | |
paul@65 | 35 | /* Data transfer helper methods. */ |
paul@65 | 36 | |
paul@65 | 37 | virtual void fill_populated(Flexpage *flexpage); |
paul@65 | 38 | |
paul@65 | 39 | virtual void flush_populated(Flexpage *flexpage); |
paul@65 | 40 | |
paul@65 | 41 | public: |
paul@65 | 42 | explicit PipeAccessor(); |
paul@65 | 43 | |
paul@101 | 44 | virtual offset_t get_size(); |
paul@101 | 45 | |
paul@101 | 46 | virtual void set_size(offset_t size); |
paul@65 | 47 | }; |
paul@65 | 48 | |
paul@65 | 49 | // vim: tabstop=4 expandtab shiftwidth=4 |