StoreFSufs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2019 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:
37  static StoreFileSystem &GetInstance();
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();
46  StoreFSufs (StoreFSufs const &);
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(NULL), 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 {
88  initialised = true;
89 }
90 
91 } /* namespace Ufs */
92 } /* namespace Fs */
93 
94 #endif /* SQUID_STOREFSUFS_H */
95 
#define assert(EX)
Definition: assert.h:17
static uint32 C
Definition: md4.c:43
char const * label
Definition: StoreFSufs.h:52
static StoreFileSystem & GetInstance()
StoreFSufs & operator=(StoreFSufs const &)
virtual ~StoreFSufs()
Definition: StoreFSufs.h:39
virtual char const * type() const
Definition: StoreFSufs.h:63
virtual void setup()
Definition: StoreFSufs.h:85
StoreFSufs(char const *DefaultModuleType, char const *label)
Definition: StoreFSufs.h:56
static void FsAdd(StoreFileSystem &)
DiskIOModule * IO
Definition: StoreFSufs.h:50
virtual SwapDir * createSwapDir()
Definition: StoreFSufs.h:70
Definition: Module.h:12
char const * moduleName
Definition: StoreFSufs.h:51
virtual void done()
Definition: StoreFSufs.h:78
#define NULL
Definition: types.h:166
manages a single cache_dir
Definition: Disk.h:21

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors