StoreFSufs.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2022 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_STOREFSUFS_H
10#define SQUID_STOREFSUFS_H
11
17#include "StoreFileSystem.h"
18
19class DiskIOModule;
20
21namespace Fs
22{
23namespace Ufs
24{
33template <class TheSwapDir>
35{
36public:
38 StoreFSufs(char const *DefaultModuleType, char const *label);
39 virtual ~StoreFSufs() {}
40
41 virtual char const *type() const;
42 virtual SwapDir *createSwapDir();
43 virtual void done();
44 virtual void setup();
48
49protected:
51 char const *moduleName;
52 char const *label;
53};
54
55template <class C>
56StoreFSufs<C>::StoreFSufs(char const *defaultModuleName, char const *aLabel) : IO(nullptr), moduleName(defaultModuleName), label(aLabel)
57{
58 FsAdd(*this);
59}
60
61template <class C>
62char const *
64{
65 return label;
66}
67
68template <class C>
69SwapDir *
71{
72 C *result = new C(type(), moduleName);
73 return result;
74}
75
76template <class C>
77void
79{
80 initialised = false;
81}
82
83template <class C>
84void
86{
87 assert(!initialised);
88 initialised = true;
89}
90
91} /* namespace Ufs */
92} /* namespace Fs */
93
94#endif /* SQUID_STOREFSUFS_H */
95
#define assert(EX)
Definition: assert.h:19
char const * moduleName
Definition: StoreFSufs.h:51
StoreFSufs(char const *DefaultModuleType, char const *label)
Definition: StoreFSufs.h:56
virtual SwapDir * createSwapDir()
Definition: StoreFSufs.h:70
virtual void setup()
Definition: StoreFSufs.h:85
virtual char const * type() const
Definition: StoreFSufs.h:63
char const * label
Definition: StoreFSufs.h:52
static StoreFileSystem & GetInstance()
virtual void done()
Definition: StoreFSufs.h:78
StoreFSufs(StoreFSufs const &)
virtual ~StoreFSufs()
Definition: StoreFSufs.h:39
DiskIOModule * IO
Definition: StoreFSufs.h:50
StoreFSufs & operator=(StoreFSufs const &)
static void FsAdd(StoreFileSystem &)
manages a single cache_dir
Definition: Disk.h:22
int type
Definition: errorpage.cc:152
static uint32 C
Definition: md4.c:43
Definition: Module.h:13

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors