L4Re/departure

Annotated libfsserver/include/fsserver/file_object_registry.h

209:8233b51eeab0
2021-09-27 Paul Boddie Renamed FilePaging to FileObjectRegistry.
paul@93 1
/*
paul@200 2
 * A registry of filesystem objects.
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@9 22
#pragma once
paul@9 23
paul@202 24
#include <fsserver/directory_provider.h>
paul@144 25
#include <fsserver/file_opening.h>
paul@200 26
#include <fsserver/file_provider.h>
paul@202 27
#include <fsserver/file_registry.h>
paul@94 28
#include <fsserver/pager.h>
paul@144 29
#include <fsserver/pages.h>
paul@9 30
paul@9 31
paul@9 32
paul@200 33
/* A registry of filesystem objects. */
paul@9 34
paul@209 35
class FileObjectRegistry : public FileRegistry
paul@9 36
{
paul@9 37
protected:
paul@79 38
    Pages *_pages;
paul@9 39
paul@202 40
    /* Resource initialisation methods. */
paul@144 41
paul@144 42
    map_flags_t get_flags(flags_t flags);
paul@144 43
paul@202 44
    long get_directory_provider(FileOpening *opening, const char *path,
paul@202 45
                                flags_t flags, fileid_t fileid,
paul@202 46
                                DirectoryProvider **directory_provider);
paul@202 47
paul@202 48
    long get_file_provider(FileOpening *opening, const char *path,
paul@202 49
                           flags_t flags, fileid_t fileid,
paul@202 50
                           FileProvider **file_provider);
paul@193 51
paul@79 52
public:
paul@209 53
    explicit FileObjectRegistry(Pages *pages);
paul@79 54
paul@208 55
    /* Resource discovery methods. */
paul@208 56
paul@208 57
    long find_directory_provider(fileid_t fileid,
paul@208 58
                                 DirectoryProvider **directory_provider);
paul@208 59
paul@202 60
    /* Resource initialisation methods. */
paul@144 61
paul@202 62
    long get_directory(FileOpening *opening, const char *path, flags_t flags,
paul@202 63
                       fileid_t fileid, Resource **resource);
paul@79 64
paul@202 65
    long get_pager(FileOpening *opening, const char *path, flags_t flags,
paul@202 66
                   fileid_t fileid, Pager **pager);
paul@9 67
};
paul@9 68
paul@9 69
// vim: tabstop=4 expandtab shiftwidth=4