+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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.
- */
-
-/* DEBUG: section 47 Store Directory Routines */
-
-#include "squid.h"
-#include "cbdata.h"
-#include "StoreSearchUFS.h"
-#include "UFSSwapDir.h"
-
-CBDATA_NAMESPACED_CLASS_INIT(Fs::Ufs,StoreSearchUFS);
-
-Fs::Ufs::StoreSearchUFS::StoreSearchUFS(RefCount<UFSSwapDir> aSwapDir) :
- sd(aSwapDir),
- walker(sd->repl->WalkInit(sd->repl)),
- cbdata(nullptr),
- current(nullptr),
- _done(false)
-{}
-
-Fs::Ufs::StoreSearchUFS::~StoreSearchUFS()
-{
- walker->Done(walker);
- walker = nullptr;
-}
-
-void
-Fs::Ufs::StoreSearchUFS::next(void (aCallback)(void *cbdata), void *aCallbackArgs)
-{
- next();
- aCallback(aCallbackArgs);
-}
-
-bool
-Fs::Ufs::StoreSearchUFS::next()
-{
- /* the walker API doesn't make sense. the store entries referred to are already readwrite
- * from their hash table entries
- */
-
- if (walker)
- current = const_cast<StoreEntry *>(walker->Next(walker));
-
- if (current == nullptr)
- _done = true;
-
- return current != nullptr;
-}
-
-bool
-Fs::Ufs::StoreSearchUFS::error() const
-{
- return false;
-}
-
-bool
-Fs::Ufs::StoreSearchUFS::isDone() const
-{
- return _done;
-}
-
-StoreEntry *
-Fs::Ufs::StoreSearchUFS::currentItem()
-{
- return current;
-}
-
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_FS_UFS_STORESEARCHUFS_H
-#define SQUID_FS_UFS_STORESEARCHUFS_H
-
-#include "StoreSearch.h"
-#include "UFSSwapDir.h"
-
-namespace Fs
-{
-namespace Ufs
-{
-
-class StoreSearchUFS : public StoreSearch
-{
- CBDATA_CLASS(StoreSearchUFS);
-
-public:
- StoreSearchUFS(RefCount<UFSSwapDir> sd);
- ~StoreSearchUFS() override;
-
- // TODO: misplaced Iterator API
- /**
- * callback the client when a new StoreEntry is available
- * or an error occurs
- */
- void next(void (callback)(void *cbdata), void *cbdata) override;
-
- /**
- \retval true if a new StoreEntry is immediately available
- \retval false if a new StoreEntry is NOT immediately available
- */
- bool next() override;
-
- bool error() const override;
- bool isDone() const override;
- StoreEntry *currentItem() override;
-
- RefCount<UFSSwapDir> sd;
- RemovalPolicyWalker *walker;
-
-private:
- /// \bug (callback) should be hidden behind a proper human readable name
- void (callback)(void *cbdata);
- void *cbdata;
- StoreEntry * current;
- bool _done;
-
- StoreSearchUFS(StoreSearchUFS const &); //disabled
- StoreSearchUFS& operator=(StoreSearchUFS const &); //disabled
- StoreSearchUFS(); //disabled
-};
-
-} //namespace Ufs
-} //namespace Fs
-#endif /* SQUID_FS_UFS_STORESEARCHUFS_H */
-