]> git.ipfire.org Git - thirdparty/squid.git/blame - src/DiskIO/DiskIOModule.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / DiskIO / DiskIOModule.h
CommitLineData
59b2d47f 1/*
bbc27441 2 * Copyright (C) 1996-2014 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:
b9ae18aa 24 static void SetupAllModules();
25 static void ModuleAdd(DiskIOModule &);
26 static void FreeAllModules();
09c5ae5a
AJ
27
28 /** Poke all compiled modules for self-setup */
29 static void PokeAllModules();
30
b9ae18aa 31 static DiskIOModule *Find(char const *type);
09c5ae5a
AJ
32
33 /** Find *any* usable disk module. This will look for the 'best'
b7717b61 34 * available module for this system.
35 */
36 static DiskIOModule *FindDefault();
c8ea3cc0
FC
37 static std::vector<DiskIOModule*> const &Modules();
38 typedef std::vector<DiskIOModule*>::iterator iterator;
39 typedef std::vector<DiskIOModule*>::const_iterator const_iterator;
b9ae18aa 40 DiskIOModule();
26ac0430 41 virtual ~DiskIOModule() {}
59b2d47f 42
43 virtual void init() = 0;
6fdc2d18 44 //virtual void registerWithCacheManager(void);
1e1a9021 45 virtual void gracefulShutdown() = 0;
b9ae18aa 46 virtual DiskIOStrategy *createStrategy() = 0;
47
48 virtual char const *type () const = 0;
49 // Not implemented
50 DiskIOModule(DiskIOModule const &);
51 DiskIOModule &operator=(DiskIOModule const&);
52
53protected:
54 //bool initialised;
6b7d87bb 55 static void RegisterAllModulesWithCacheManager(void);
b9ae18aa 56
57private:
c8ea3cc0
FC
58 static std::vector<DiskIOModule*> &GetModules();
59 static std::vector<DiskIOModule*> *_Modules;
59b2d47f 60};
61
b9ae18aa 62#endif /* SQUID_DISKIOMODULE_H */
f53969cc 63