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 
19 class DiskIOModule;
20 
21 namespace Fs
22 {
23 namespace Ufs
24 {
33 template <class TheSwapDir>
35 {
36 public:
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 
49 protected:
51  char const *moduleName;
52  char const *label;
53 };
54 
55 template <class C>
56 StoreFSufs<C>::StoreFSufs(char const *defaultModuleName, char const *aLabel) : IO(nullptr), moduleName(defaultModuleName), label(aLabel)
57 {
58  FsAdd(*this);
59 }
60 
61 template <class C>
62 char const *
64 {
65  return label;
66 }
67 
68 template <class C>
69 SwapDir *
71 {
72  C *result = new C(type(), moduleName);
73  return result;
74 }
75 
76 template <class C>
77 void
79 {
80  initialised = false;
81 }
82 
83 template <class C>
84 void
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 & operator=(StoreFSufs const &)
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
virtual void done()
Definition: StoreFSufs.h:78
StoreFSufs(StoreFSufs const &)
virtual ~StoreFSufs()
Definition: StoreFSufs.h:39
static StoreFileSystem & GetInstance()
DiskIOModule * IO
Definition: StoreFSufs.h:50
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