DiskIOStrategy.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef SQUID_DISKIOSTRATEGY_H
10#define SQUID_DISKIOSTRATEGY_H
11
12#include "base/RefCount.h"
13#include "Store.h"
14
15class DiskFile;
16
17class ConfigOption;
18
20{
21
22public:
23 virtual ~DiskIOStrategy() {}
24
26 virtual bool shedLoad() = 0;
27
29 virtual int load() = 0;
30
32 virtual RefCount<DiskFile> newFile(char const *path) = 0;
33
35 virtual void sync() {}
36
38 virtual bool unlinkdUseful() const = 0;
39
41 virtual void unlinkFile(char const *) = 0;
42
44 virtual int callback() { return 0; }
45
47 virtual void init() {}
48
50 virtual void statfs(StoreEntry &) const {}
51
53 virtual ConfigOption *getOptionTree() const {return nullptr;}
54};
55
56/* Because we need the DiskFile definition for newFile. */
57#include "DiskFile.h"
58
60{
61
62public:
64
65 bool shedLoad() override { return io->shedLoad(); }
66
67 int load() override { return io->load(); }
68
69 RefCount<DiskFile> newFile (char const *path) override {return io->newFile(path); }
70
71 void sync() override { io->sync(); }
72
73 bool unlinkdUseful() const override { return io->unlinkdUseful(); }
74
75 void unlinkFile(char const *path) override { io->unlinkFile(path); }
76
77 int callback() override { return io->callback(); }
78
79 void init() override { io->init(); }
80
81 void statfs(StoreEntry & sentry) const override { io->statfs(sentry); }
82
83 ConfigOption *getOptionTree() const override { return io->getOptionTree(); }
84
85private:
87};
88
89#endif /* SQUID_DISKIOSTRATEGY_H */
90
virtual int load()=0
virtual int callback()
virtual void sync()
virtual void statfs(StoreEntry &) const
virtual bool unlinkdUseful() const =0
virtual RefCount< DiskFile > newFile(char const *path)=0
virtual bool shedLoad()=0
virtual void init()
virtual ConfigOption * getOptionTree() const
virtual void unlinkFile(char const *)=0
virtual ~DiskIOStrategy()
bool shedLoad() override
void init() override
int load() override
DiskIOStrategy * io
bool unlinkdUseful() const override
int callback() override
RefCount< DiskFile > newFile(char const *path) override
void unlinkFile(char const *path) override
void statfs(StoreEntry &sentry) const override
ConfigOption * getOptionTree() const override
SingletonIOStrategy(DiskIOStrategy *anIO)
void sync() override

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors