source: squid-ssl/trunk/fuentes/src/DiskIO/DiskIOModule.h @ 5495

Last change on this file since 5495 was 5495, checked in by Juanma, 4 years ago

Initial release

File size: 1.6 KB
Line 
1/*
2 * Copyright (C) 1996-2015 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_DISKIOMODULE_H
10#define SQUID_DISKIOMODULE_H
11
12#include <vector>
13
14/* forward decls */
15
16class CacheManager;
17
18class DiskIOStrategy;
19
20class DiskIOModule
21{
22
23public:
24    static void SetupAllModules();
25    static void ModuleAdd(DiskIOModule &);
26    static void FreeAllModules();
27
28    /** Poke all compiled modules for self-setup */
29    static void PokeAllModules();
30
31    static DiskIOModule *Find(char const *type);
32
33    /** Find *any* usable disk module. This will look for the 'best'
34     * available module for this system.
35     */
36    static DiskIOModule *FindDefault();
37    static std::vector<DiskIOModule*> const &Modules();
38    typedef std::vector<DiskIOModule*>::iterator iterator;
39    typedef std::vector<DiskIOModule*>::const_iterator const_iterator;
40    DiskIOModule();
41    virtual ~DiskIOModule() {}
42
43    virtual void init() = 0;
44    //virtual void registerWithCacheManager(void);
45    virtual void gracefulShutdown() = 0;
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;
55    static void RegisterAllModulesWithCacheManager(void);
56
57private:
58    static std::vector<DiskIOModule*> &GetModules();
59    static std::vector<DiskIOModule*> *_Modules;
60};
61
62#endif /* SQUID_DISKIOMODULE_H */
63
Note: See TracBrowser for help on using the repository browser.