StoreFSufs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 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_SRC_FS_UFS_STOREFSUFS_H
10 #define SQUID_SRC_FS_UFS_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  ~StoreFSufs() override {}
40 
41  /* StoreFileSystem API */
42  const char *type() const override;
43  SwapDir *createSwapDir() override;
44 
45 protected:
47  char const *moduleName;
48  char const *label;
49 };
50 
51 template <class C>
52 StoreFSufs<C>::StoreFSufs(char const *defaultModuleName, char const *aLabel) : IO(nullptr), moduleName(defaultModuleName), label(aLabel)
53 {
54  FsAdd(*this);
55 }
56 
57 template <class C>
58 char const *
60 {
61  return label;
62 }
63 
64 template <class C>
65 SwapDir *
67 {
68  C *result = new C(type(), moduleName);
69  return result;
70 }
71 
72 } /* namespace Ufs */
73 } /* namespace Fs */
74 
75 #endif /* SQUID_SRC_FS_UFS_STOREFSUFS_H */
76 
manages a single cache_dir
Definition: Disk.h:21
DiskIOModule * IO
Definition: StoreFSufs.h:46
SwapDir * createSwapDir() override
Definition: StoreFSufs.h:66
static void FsAdd(StoreFileSystem &)
const char * label
Definition: StoreFSufs.h:48
const char * moduleName
Definition: StoreFSufs.h:47
const char * type() const override
Definition: StoreFSufs.h:59
static uint32 C
Definition: md4.c:43
static StoreFileSystem & GetInstance()
Definition: Module.h:12
~StoreFSufs() override
Definition: StoreFSufs.h:39
StoreFSufs(char const *DefaultModuleType, char const *label)
Definition: StoreFSufs.h:52

 

Introduction

Documentation

Support

Miscellaneous