]>
Commit | Line | Data |
---|---|---|
59b2d47f | 1 | /* |
b8ae064d | 2 | * Copyright (C) 1996-2023 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 | ||
ff9d9458 FC |
9 | #ifndef SQUID_SRC_DISKIO_DISKIOMODULE_H |
10 | #define SQUID_SRC_DISKIO_DISKIOMODULE_H | |
59b2d47f | 11 | |
c8ea3cc0 | 12 | #include <vector> |
59b2d47f | 13 | |
62ee09ca | 14 | /* forward decls */ |
15 | ||
16 | class CacheManager; | |
17 | ||
b9ae18aa | 18 | class DiskIOStrategy; |
59b2d47f | 19 | |
b9ae18aa | 20 | class DiskIOModule |
59b2d47f | 21 | { |
22 | ||
23 | public: | |
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 | ||
51 | protected: | |
52 | //bool initialised; | |
6b7d87bb | 53 | static void RegisterAllModulesWithCacheManager(void); |
b9ae18aa | 54 | |
55 | private: | |
c8ea3cc0 FC |
56 | static std::vector<DiskIOModule*> &GetModules(); |
57 | static std::vector<DiskIOModule*> *_Modules; | |
59b2d47f | 58 | }; |
59 | ||
ff9d9458 | 60 | #endif /* SQUID_SRC_DISKIO_DISKIOMODULE_H */ |
f53969cc | 61 |