]> git.ipfire.org Git - thirdparty/squid.git/blame - src/DiskIO/DiskIOModule.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / DiskIO / DiskIOModule.h
CommitLineData
59b2d47f 1/*
77b1029d 2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
59b2d47f 3 *
bbc27441
AJ
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.
59b2d47f 7 */
8
b9ae18aa 9#ifndef SQUID_DISKIOMODULE_H
10#define SQUID_DISKIOMODULE_H
59b2d47f 11
c8ea3cc0 12#include <vector>
59b2d47f 13
62ee09ca 14/* forward decls */
15
16class CacheManager;
17
b9ae18aa 18class DiskIOStrategy;
59b2d47f 19
b9ae18aa 20class DiskIOModule
59b2d47f 21{
22
23public:
d9691f09 24 /** Poke all compiled modules for self-setup */
b9ae18aa 25 static void SetupAllModules();
26 static void ModuleAdd(DiskIOModule &);
27 static void FreeAllModules();
09c5ae5a 28
b9ae18aa 29 static DiskIOModule *Find(char const *type);
09c5ae5a
AJ
30
31 /** Find *any* usable disk module. This will look for the 'best'
b7717b61 32 * available module for this system.
33 */
34 static DiskIOModule *FindDefault();
c8ea3cc0
FC
35 static std::vector<DiskIOModule*> const &Modules();
36 typedef std::vector<DiskIOModule*>::iterator iterator;
37 typedef std::vector<DiskIOModule*>::const_iterator const_iterator;
b9ae18aa 38 DiskIOModule();
26ac0430 39 virtual ~DiskIOModule() {}
59b2d47f 40
41 virtual void init() = 0;
6fdc2d18 42 //virtual void registerWithCacheManager(void);
1e1a9021 43 virtual void gracefulShutdown() = 0;
b9ae18aa 44 virtual DiskIOStrategy *createStrategy() = 0;
45
46 virtual char const *type () const = 0;
47 // Not implemented
48 DiskIOModule(DiskIOModule const &);
49 DiskIOModule &operator=(DiskIOModule const&);
50
51protected:
52 //bool initialised;
6b7d87bb 53 static void RegisterAllModulesWithCacheManager(void);
b9ae18aa 54
55private:
c8ea3cc0
FC
56 static std::vector<DiskIOModule*> &GetModules();
57 static std::vector<DiskIOModule*> *_Modules;
59b2d47f 58};
59
b9ae18aa 60#endif /* SQUID_DISKIOMODULE_H */
f53969cc 61