/* * Copyright (C) 1996-2017 The Squid Software Foundation and contributors * * Squid software is distributed under GPLv2+ license and includes * contributions from numerous individuals and organizations. * Please see the COPYING and CONTRIBUTORS files for details. */ #ifndef SQUID_STOREFSUFS_H #define SQUID_STOREFSUFS_H /** \defgroup UFS UFS Storage Filesystem \ingroup FileSystems */ #include "StoreFileSystem.h" class DiskIOModule; namespace Fs { namespace Ufs { /** \ingroup UFS, FileSystems * * Core UFS class. This template provides compile time aliases for * ufs/aufs/diskd to ease configuration conversion - each becomes a * StoreFS module whose createSwapDir method parameterises the common * UFSSwapDir with an IO module instance. */ template class StoreFSufs : public StoreFileSystem { public: static StoreFileSystem &GetInstance(); StoreFSufs(char const *DefaultModuleType, char const *label); virtual ~StoreFSufs() {} virtual char const *type() const; virtual SwapDir *createSwapDir(); virtual void done(); virtual void setup(); /** Not implemented */ StoreFSufs (StoreFSufs const &); StoreFSufs &operator=(StoreFSufs const &); protected: DiskIOModule *IO; char const *moduleName; char const *label; }; template StoreFSufs::StoreFSufs(char const *defaultModuleName, char const *aLabel) : IO(NULL), moduleName(defaultModuleName), label(aLabel) { FsAdd(*this); } template char const * StoreFSufs::type() const { return label; } template SwapDir * StoreFSufs::createSwapDir() { C *result = new C(type(), moduleName); return result; } template void StoreFSufs::done() { initialised = false; } template void StoreFSufs::setup() { assert(!initialised); initialised = true; } } /* namespace Ufs */ } /* namespace Fs */ #endif /* SQUID_STOREFSUFS_H */