From: Francesco Chemolli Date: Fri, 3 Jan 2014 10:32:53 +0000 (+0100) Subject: Got rid of Store.cci X-Git-Tag: SQUID_3_5_0_1~440^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04ebce5515f51ee9b8e81a6c70f3abc3aeb38302;p=thirdparty%2Fsquid.git Got rid of Store.cci --- diff --git a/src/Makefile.am b/src/Makefile.am index 00c1ee6b81..bb6b1aa030 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -591,7 +591,6 @@ noinst_HEADERS = \ client_side_request.cci \ MemBuf.cci \ MemBuf.h \ - Store.cci \ StoreEntryStream.h \ String.cci \ SquidString.h \ diff --git a/src/Store.cci b/src/Store.cci deleted file mode 100644 index 01add65b16..0000000000 --- a/src/Store.cci +++ /dev/null @@ -1,63 +0,0 @@ -/* - * DEBUG: section 20 Storage Manager - * AUTHOR: Harvest Derived - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - -#include "HttpReply.h" -#include "MemObject.h" - -/** - \retval true Store contains 0 bytes of data. - \retval false Store contains 1 or more bytes of data. - \retval false Store contains negative content !!!!!! - */ -bool -StoreEntry::isEmpty () const -{ - assert (mem_obj); - return mem_obj->endOffset() == 0; -} - -/// \retval * - Always NULL for 'null' filesystem. -HttpReply const * -NullStoreEntry::getReply() const -{ - return NULL; -} - -/// \retval N/A Kills squid with fatal error if called before Store Root is set. -Store & -Store::Root() -{ - if (CurrentRoot == NULL) - fatal("No Store Root has been set"); - - return *CurrentRoot; -} diff --git a/src/Store.h b/src/Store.h index b5325782ce..c1fad115e9 100644 --- a/src/Store.h +++ b/src/Store.h @@ -41,6 +41,7 @@ #include "hash.h" #include "HttpReply.h" #include "HttpRequestMethod.h" +#include "MemObject.h" #include "Range.h" #include "RemovalPolicy.h" #include "StoreIOBuffer.h" @@ -56,7 +57,6 @@ class AsyncCall; class HttpRequest; -class MemObject; class Packer; class RequestFlags; class StoreClient; @@ -84,7 +84,16 @@ public: virtual HttpReply const *getReply() const; virtual void write (StoreIOBuffer); - virtual _SQUID_INLINE_ bool isEmpty() const; + + /** Check if the Store entry is emtpty + * \retval true Store contains 0 bytes of data. + * \retval false Store contains 1 or more bytes of data. + * \retval false Store contains negative content !!!!!! + */ + virtual bool isEmpty() const { + assert (mem_obj); + return mem_obj->endOffset() == 0; + } virtual bool isAccepting() const; virtual size_t bytesWanted(Range const aRange, bool ignoreDelayPool = false) const; virtual void complete(); @@ -251,7 +260,7 @@ public: } const char *getMD5Text() const; - _SQUID_INLINE_ HttpReply const *getReply() const; + HttpReply const *getReply() const { return NULL; } void write (StoreIOBuffer) {} bool isEmpty () const {return true;} @@ -284,7 +293,11 @@ class Store : public RefCountable public: /** The root store */ - static _SQUID_INLINE_ Store &Root(); + static Store &Root() { + if (CurrentRoot == NULL) + fatal("No Store Root has been set"); + return *CurrentRoot; + } static void Root(Store *); static void Root(RefCount); static void Stats(StoreEntry * output); @@ -504,8 +517,4 @@ void packerToStoreInit(Packer * p, StoreEntry * e); /// \ingroup StoreAPI void storeGetMemSpace(int size); -#if _USE_INLINE_ -#include "Store.cci" -#endif - #endif /* SQUID_STORE_H */ diff --git a/src/store.cc b/src/store.cc index 08e06d3416..593db046d9 100644 --- a/src/store.cc +++ b/src/store.cc @@ -2085,7 +2085,3 @@ NullStoreEntry::getSerialisedMetaData() { return NULL; } - -#if !_USE_INLINE_ -#include "Store.cci" -#endif diff --git a/src/tests/stub_store.cc b/src/tests/stub_store.cc index 83b642e0c5..72b94c94af 100644 --- a/src/tests/stub_store.cc +++ b/src/tests/stub_store.cc @@ -136,14 +136,3 @@ void storeReplAdd(const char *, REMOVALPOLICYCREATE *) STUB void destroyStoreEntry(void *) STUB // in Packer.cc !? void packerToStoreInit(Packer * p, StoreEntry * e) STUB void storeGetMemSpace(int size) STUB - -#if !_USE_INLINE_ /* stubs for Store.cci */ -bool StoreEntry::isEmpty () const STUB_RETVAL(true) -HttpReply const *NullStoreEntry::getReply() const STUB_RETVAL(NULL) - -Store &Store::Root() -{ - CPPUNIT_ASSERT(CurrentRoot != NULL); - return *CurrentRoot; -} -#endif /* !_USE_INLINE_ */