From: Amos Jeffries Date: Mon, 20 Oct 2014 06:58:59 +0000 (-0700) Subject: Cleanup: Simplify MEMPROXY_CLASS_* macros X-Git-Tag: merge-candidate-3-v1~535 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=741c2986cddde538fdd7442db31c227239adf930;p=thirdparty%2Fsquid.git Cleanup: Simplify MEMPROXY_CLASS_* macros There are no logical changes in this patch. * Make MEMPROXY_CLASS() macro inline its definitions. * Remove MEMPROXY_CLASS_INLINE * Remove last remaining mention of obsolete MEMPROXY_CLASS_INIT * Adjust MEMPROXY_CLASS() to control its private/public definitions appropriate to their needs. * Shuffle all MEMPROXY_CLASS() macro uses to the top of the relevant classes (in some cases renaming struct to class with public members if necessary) such that the new terminal private: does not affect existing class definitions. --- diff --git a/include/MemPool.h b/include/MemPool.h index b99902e0c9..559c3a9863 100644 --- a/include/MemPool.h +++ b/include/MemPool.h @@ -284,43 +284,26 @@ private: /* help for classes */ /** - \ingroup MemPoolsAPI - \hideinitializer + * \ingroup MemPoolsAPI + * \hideinitializer * + * Pool and account the memory used for the CLASS object. * This macro is intended for use within the declaration of a class. */ #define MEMPROXY_CLASS(CLASS) \ - inline void *operator new(size_t); \ - inline void operator delete(void *); \ - static inline MemAllocatorProxy &Pool() - -/** - \ingroup MemPoolsAPI - \hideinitializer - * - * This macro is intended for use within the .h or .cci of a class as appropriate. - */ -#define MEMPROXY_CLASS_INLINE(CLASS) \ -MemAllocatorProxy& CLASS::Pool() \ -{ \ - static MemAllocatorProxy thePool(#CLASS, sizeof (CLASS)); \ - return thePool; \ -} \ -\ -void * \ -CLASS::operator new (size_t byteCount) \ -{ \ - /* derived classes with different sizes must implement their own new */ \ - assert (byteCount == sizeof (CLASS)); \ -\ - return Pool().alloc(); \ -} \ -\ -void \ -CLASS::operator delete (void *address) \ -{ \ - Pool().freeOne(address); \ -} + private: \ + static inline MemAllocatorProxy &Pool() { \ + static MemAllocatorProxy thePool(#CLASS, sizeof(CLASS)); \ + return thePool; \ + } \ + public: \ + void *operator new(size_t byteCount) { \ + /* derived classes with different sizes must implement their own new */ \ + assert (byteCount == sizeof(CLASS)); \ + return Pool().alloc(); \ + } \ + void operator delete(void *address) {Pool().freeOne(address);} \ + private: /// \ingroup MemPoolsAPI class MemImplementingAllocator : public MemAllocator diff --git a/squid3.dox b/squid3.dox index d3f568172e..f90955c55d 100644 --- a/squid3.dox +++ b/squid3.dox @@ -1313,9 +1313,7 @@ EXPAND_AS_DEFINED = AsyncCallWrapper \ CBDATA_CLASS2 \ CBDATA_CLASS_INIT \ CBDATA_NAMESPACED_CLASS_INIT \ - MEMPROXY_CLASS_INLINE \ MEMPROXY_CLASS \ - MEMPROXY_CLASS_INIT \ STUB \ STUB_NOP \ STUB_RETVAL diff --git a/src/ExternalACL.h b/src/ExternalACL.h index 5727fbedd1..e34e54844d 100644 --- a/src/ExternalACL.h +++ b/src/ExternalACL.h @@ -38,10 +38,9 @@ private: class ACLExternal : public ACL { - -public: MEMPROXY_CLASS(ACLExternal); +public: static void ExternalAclLookup(ACLChecklist * ch, ACLExternal *); ACLExternal(char const *); @@ -70,8 +69,6 @@ protected: char const *class_; }; -MEMPROXY_CLASS_INLINE(ACLExternal); - void parse_externalAclHelper(external_acl **); void dump_externalAclHelper(StoreEntry * sentry, const char *name, const external_acl *); void free_externalAclHelper(external_acl **); diff --git a/src/ExternalACLEntry.h b/src/ExternalACLEntry.h index 7b94cd8ceb..b7ef687aa4 100644 --- a/src/ExternalACLEntry.h +++ b/src/ExternalACLEntry.h @@ -48,11 +48,13 @@ public: /******************************************************************* * external_acl cache entry - * Used opaqueue in the interface + * Used opaque in the interface */ class ExternalACLEntry: public hash_link, public RefCountable { + MEMPROXY_CLASS(ExternalACLEntry); + public: ExternalACLEntry(); ~ExternalACLEntry(); @@ -73,10 +75,6 @@ public: String tag; String log; external_acl *def; - - MEMPROXY_CLASS(ExternalACLEntry); }; -MEMPROXY_CLASS_INLINE(ExternalACLEntry); - #endif diff --git a/src/HttpHdrCc.h b/src/HttpHdrCc.h index c8bdea3f49..3448ad56b5 100644 --- a/src/HttpHdrCc.h +++ b/src/HttpHdrCc.h @@ -21,6 +21,7 @@ class Packer; */ class HttpHdrCc { + MEMPROXY_CLASS(HttpHdrCc); public: static const int32_t MAX_AGE_UNKNOWN=-1; //max-age is unset @@ -145,8 +146,6 @@ public: void packInto(Packer * p) const; - MEMPROXY_CLASS(HttpHdrCc); - /** bit-mask representing what header values are set among those * recognized by squid. * @@ -173,8 +172,6 @@ public: String other; }; -MEMPROXY_CLASS_INLINE(HttpHdrCc); - class StatHist; class StoreEntry; diff --git a/src/HttpHdrSc.h b/src/HttpHdrSc.h index 50dc34cfbe..e542a94af7 100644 --- a/src/HttpHdrSc.h +++ b/src/HttpHdrSc.h @@ -17,6 +17,7 @@ class StatHist; class HttpHdrSc { + MEMPROXY_CLASS(HttpHdrSc); public: HttpHdrSc(const HttpHdrSc &); @@ -35,15 +36,12 @@ public: dlinkAddTail (t, &t->node, &targets); } - MEMPROXY_CLASS(HttpHdrSc); dlink_list targets; private: HttpHdrScTarget * findTarget (const char *target); }; -MEMPROXY_CLASS_INLINE(HttpHdrSc); - /* Http Surrogate Control Header Field */ void httpHdrScStatDumper(StoreEntry * sentry, int idx, double val, double size, int count); void httpHdrScInitModule (void); diff --git a/src/HttpHdrScTarget.h b/src/HttpHdrScTarget.h index c405ad3b53..49d3040a93 100644 --- a/src/HttpHdrScTarget.h +++ b/src/HttpHdrScTarget.h @@ -25,6 +25,8 @@ class StoreEntry; */ class HttpHdrScTarget { + MEMPROXY_CLASS(HttpHdrScTarget); + // parsing is done in HttpHdrSc, need to grant them access. friend class HttpHdrSc; public: @@ -83,7 +85,6 @@ public: void packInto (Packer *p) const; void updateStats(StatHist *) const; - MEMPROXY_CLASS(HttpHdrScTarget); private: bool isSet(http_hdr_sc_type id) const { assert (id >= SC_NO_STORE && id < SC_ENUM_END); @@ -103,8 +104,6 @@ private: dlink_node node; }; -MEMPROXY_CLASS_INLINE(HttpHdrScTarget); - void httpHdrScTargetStatDumper(StoreEntry * sentry, int idx, double val, double size, int count); #endif /* SQUID_HTTPHDRSURROGATECONTROLTARGET_H */ diff --git a/src/HttpHeader.h b/src/HttpHeader.h index b03d1d5523..cbf16ef80d 100644 --- a/src/HttpHeader.h +++ b/src/HttpHeader.h @@ -182,6 +182,7 @@ typedef ssize_t HttpHeaderPos; class HttpHeaderEntry { + MEMPROXY_CLASS(HttpHeaderEntry); public: HttpHeaderEntry(http_hdr_type id, const char *name, const char *value); @@ -191,14 +192,12 @@ public: void packInto(Packer *p) const; int getInt() const; int64_t getInt64() const; - MEMPROXY_CLASS(HttpHeaderEntry); + http_hdr_type id; String name; String value; }; -MEMPROXY_CLASS_INLINE(HttpHeaderEntry); - class ETag; class TimeOrTag; diff --git a/src/HttpHeaderRange.h b/src/HttpHeaderRange.h index b64bb378b4..20f101fc0c 100644 --- a/src/HttpHeaderRange.h +++ b/src/HttpHeaderRange.h @@ -21,9 +21,9 @@ class HttpReply; class HttpHdrRangeSpec { + MEMPROXY_CLASS(HttpHdrRangeSpec); public: - MEMPROXY_CLASS(HttpHdrRangeSpec); typedef Range HttpRange; static int64_t const UnknownPosition; @@ -39,8 +39,6 @@ public: int64_t length; }; -MEMPROXY_CLASS_INLINE(HttpHdrRangeSpec); - /** * There may be more than one byte range specified in the request. * This object holds all range specs in order of their appearence @@ -48,10 +46,9 @@ MEMPROXY_CLASS_INLINE(HttpHdrRangeSpec); */ class HttpHdrRange { - -public: MEMPROXY_CLASS(HttpHdrRange); +public: static size_t ParsedCount; /* Http Range Header Field */ static HttpHdrRange *ParseCreate(const String * range_spec); @@ -89,8 +86,6 @@ private: int64_t clen; }; -MEMPROXY_CLASS_INLINE(HttpHdrRange); - /** * Data for iterating thru range specs */ diff --git a/src/HttpReply.h b/src/HttpReply.h index a6d5daacc9..93aca6615a 100644 --- a/src/HttpReply.h +++ b/src/HttpReply.h @@ -24,11 +24,11 @@ class HttpHdrSc; class HttpReply: public HttpMsg { + MEMPROXY_CLASS(HttpReply); public: typedef RefCount Pointer; - MEMPROXY_CLASS(HttpReply); HttpReply(); ~HttpReply(); @@ -144,6 +144,4 @@ protected: virtual bool parseFirstLine(const char *start, const char *end); }; -MEMPROXY_CLASS_INLINE(HttpReply); - #endif /* SQUID_HTTPREPLY_H */ diff --git a/src/HttpRequest.h b/src/HttpRequest.h index 46227e67f0..5f50fbe703 100644 --- a/src/HttpRequest.h +++ b/src/HttpRequest.h @@ -43,11 +43,11 @@ class DnsLookupDetails; class HttpRequest: public HttpMsg { + MEMPROXY_CLASS(HttpRequest); public: typedef RefCount Pointer; - MEMPROXY_CLASS(HttpRequest); HttpRequest(); HttpRequest(const HttpRequestMethod& aMethod, AnyP::ProtocolType aProtocol, const char *aUrlpath); ~HttpRequest(); @@ -263,6 +263,4 @@ protected: virtual bool inheritProperties(const HttpMsg *aMsg); }; -MEMPROXY_CLASS_INLINE(HttpRequest); - #endif /* SQUID_HTTPREQUEST_H */ diff --git a/src/MemBlob.h b/src/MemBlob.h index f961cbe145..d57d333ba3 100644 --- a/src/MemBlob.h +++ b/src/MemBlob.h @@ -44,12 +44,12 @@ public: */ class MemBlob: public RefCountable { + MEMPROXY_CLASS(MemBlob); + public: typedef RefCount Pointer; typedef uint32_t size_type; - MEMPROXY_CLASS(MemBlob); - /// obtain a const view of class-wide statistics static const MemBlobStats& GetStats(); @@ -120,6 +120,4 @@ private: MemBlob& operator =(const MemBlob &); }; -MEMPROXY_CLASS_INLINE(MemBlob); - #endif /* SQUID_MEMBLOB_H_ */ diff --git a/src/MemObject.h b/src/MemObject.h index c1240180a6..0f38ec9faf 100644 --- a/src/MemObject.h +++ b/src/MemObject.h @@ -29,10 +29,10 @@ class HttpReply; class MemObject { + MEMPROXY_CLASS(MemObject); public: static size_t inUseCount(); - MEMPROXY_CLASS(MemObject); void dump() const; MemObject(); @@ -181,8 +181,6 @@ private: DeferredReadManager deferredReads; }; -MEMPROXY_CLASS_INLINE(MemObject); - /** global current memory removal policy */ extern RemovalPolicy *mem_policy; diff --git a/src/Notes.h b/src/Notes.h index 0e8a92e621..9d2303c50a 100644 --- a/src/Notes.h +++ b/src/Notes.h @@ -128,11 +128,11 @@ public: */ class Entry { + MEMPROXY_CLASS(Entry); public: Entry(const char *aKey, const char *aValue): name(aKey), value(aValue) {} String name; String value; - MEMPROXY_CLASS(Entry); }; NotePairs() {} @@ -208,8 +208,6 @@ private: NotePairs(NotePairs const &); // Not implemented }; -MEMPROXY_CLASS_INLINE(NotePairs::Entry); - class AccessLogEntry; /** * Keep in sync HttpRequest and the corresponding AccessLogEntry objects diff --git a/src/StoreMetaMD5.h b/src/StoreMetaMD5.h index 28e4bae845..6b9431c420 100644 --- a/src/StoreMetaMD5.h +++ b/src/StoreMetaMD5.h @@ -9,19 +9,16 @@ #ifndef SQUID_STOREMETAMD5_H #define SQUID_STOREMETAMD5_H -/* for inheritance */ #include "StoreMeta.h" -/* for MEMPROXY_CLASS() macros */ #include "MemPool.h" /* for STORE_META_KEY_MD5 */ #include "enums.h" class StoreMetaMD5 : public StoreMeta { - -public: MEMPROXY_CLASS(StoreMetaMD5); +public: char getType() const {return STORE_META_KEY_MD5;} bool validLength(int) const; @@ -31,6 +28,4 @@ private: static int md5_mismatches; }; -MEMPROXY_CLASS_INLINE(StoreMetaMD5); - #endif /* SQUID_STOREMETAMD5_H */ diff --git a/src/StoreMetaObjSize.h b/src/StoreMetaObjSize.h index 5557ca000d..a7b6c29873 100644 --- a/src/StoreMetaObjSize.h +++ b/src/StoreMetaObjSize.h @@ -14,13 +14,10 @@ class StoreMetaObjSize : public StoreMeta { - -public: MEMPROXY_CLASS(StoreMetaObjSize); +public: char getType() const {return STORE_META_OBJSIZE;} }; -MEMPROXY_CLASS_INLINE(StoreMetaObjSize); - #endif /* SQUID_STOREMETAOBJSIZE_H */ diff --git a/src/StoreMetaSTD.h b/src/StoreMetaSTD.h index 86148e7b1f..63c6e7a919 100644 --- a/src/StoreMetaSTD.h +++ b/src/StoreMetaSTD.h @@ -10,21 +10,17 @@ #define SQUID_STOREMETASTD_H #include "StoreMeta.h" -/* for MEMPROXY_CLASS() macros */ #include "MemPool.h" class StoreMetaSTD : public StoreMeta { - -public: MEMPROXY_CLASS(StoreMetaSTD); +public: char getType() const {return STORE_META_STD;} bool validLength(int) const; // bool checkConsistency(StoreEntry *) const; }; -MEMPROXY_CLASS_INLINE(StoreMetaSTD); - #endif /* SQUID_STOREMETASTD_H */ diff --git a/src/StoreMetaSTDLFS.h b/src/StoreMetaSTDLFS.h index e819dceee0..b6319f8ab0 100644 --- a/src/StoreMetaSTDLFS.h +++ b/src/StoreMetaSTDLFS.h @@ -9,22 +9,18 @@ #ifndef SQUID_STOREMETASTDLFS_H #define SQUID_STOREMETASTDLFS_H -/* for inheritance */ #include "StoreMeta.h" -/* for MEMPROXY() macros */ #include "MemPool.h" class StoreMetaSTDLFS : public StoreMeta { -public: MEMPROXY_CLASS(StoreMetaSTDLFS); +public: char getType() const {return STORE_META_STD_LFS;} bool validLength(int) const; // bool checkConsistency(StoreEntry *) const; }; -MEMPROXY_CLASS_INLINE(StoreMetaSTDLFS); - #endif /* SQUID_STOREMETASTDLFS_H */ diff --git a/src/StoreMetaURL.h b/src/StoreMetaURL.h index a859a698c6..133d35ba06 100644 --- a/src/StoreMetaURL.h +++ b/src/StoreMetaURL.h @@ -9,21 +9,17 @@ #ifndef SQUID_STOREMETAURL_H #define SQUID_STOREMETAURL_H -/* for inheritance */ #include "StoreMeta.h" -/* for MEMPROXY_CLASS() macros */ #include "MemPool.h" class StoreMetaURL : public StoreMeta { -public: MEMPROXY_CLASS(StoreMetaURL); +public: char getType() const {return STORE_META_URL;} bool checkConsistency(StoreEntry *) const; }; -MEMPROXY_CLASS_INLINE(StoreMetaURL); - #endif /* SQUID_STOREMETAURL_H */ diff --git a/src/StoreMetaVary.h b/src/StoreMetaVary.h index 8e7b15954b..47c068cd84 100644 --- a/src/StoreMetaVary.h +++ b/src/StoreMetaVary.h @@ -9,21 +9,17 @@ #ifndef SQUID_STOREMETAVARY_H #define SQUID_STOREMETAVARY_H -/* for inheritance */ #include "StoreMeta.h" -/* for MEMPROXY_CLASS() macros */ #include "MemPool.h" class StoreMetaVary : public StoreMeta { -public: MEMPROXY_CLASS(StoreMetaVary); +public: char getType() const {return STORE_META_VARY_HEADERS;} bool checkConsistency(StoreEntry *) const; }; -MEMPROXY_CLASS_INLINE(StoreMetaVary); - #endif /* SQUID_STOREMETAVARY_H */ diff --git a/src/StoreSwapLogData.h b/src/StoreSwapLogData.h index dea11775ae..3dcbfb5cf2 100644 --- a/src/StoreSwapLogData.h +++ b/src/StoreSwapLogData.h @@ -84,10 +84,9 @@ operator <<(std::ostream &os, const SwapChecksum24 &sum) */ class StoreSwapLogData { - -public: MEMPROXY_CLASS(StoreSwapLogData); +public: /// type to use for storing time-related members; must be signed typedef int64_t SwappedTime; @@ -177,8 +176,6 @@ public: unsigned char key[SQUID_MD5_DIGEST_LENGTH]; }; -MEMPROXY_CLASS_INLINE(StoreSwapLogData); - /// \ingroup FileFormatSwapStateAPI /// Swap log starts with this binary structure. class StoreSwapLogHeader diff --git a/src/URL.h b/src/URL.h index 59752df83d..d10672b696 100644 --- a/src/URL.h +++ b/src/URL.h @@ -13,14 +13,13 @@ #include "MemPool.h" /** - \ingroup POD - * * The URL class represents a Uniform Resource Location */ class URL { -public: MEMPROXY_CLASS(URL); + +public: URL() : scheme_() {} URL(AnyP::UriScheme const &aScheme) : scheme_(aScheme) {} @@ -57,8 +56,6 @@ private: AnyP::UriScheme scheme_; }; -MEMPROXY_CLASS_INLINE(URL); - class HttpRequest; class HttpRequestMethod; diff --git a/src/acl/Acl.h b/src/acl/Acl.h index 7c5be41b77..1c4582fcfb 100644 --- a/src/acl/Acl.h +++ b/src/acl/Acl.h @@ -209,16 +209,14 @@ operator <<(std::ostream &o, const allow_t a) /// \ingroup ACLAPI class acl_proxy_auth_match_cache { + MEMPROXY_CLASS(acl_proxy_auth_match_cache); public: - MEMPROXY_CLASS(acl_proxy_auth_match_cache); dlink_node link; int matchrv; void *acl_data; }; -MEMPROXY_CLASS_INLINE(acl_proxy_auth_match_cache); - /// \ingroup ACLAPI /// XXX: find a way to remove or at least use a refcounted ACL pointer extern const char *AclMatchedName; /* NULL */ diff --git a/src/acl/AllOf.h b/src/acl/AllOf.h index 66fde82535..aa3118f95b 100644 --- a/src/acl/AllOf.h +++ b/src/acl/AllOf.h @@ -19,9 +19,9 @@ namespace Acl /// acl all-of lines are always ORed together. class AllOf: public Acl::InnerNode { -public: MEMPROXY_CLASS(AllOf); +public: /* ACL API */ virtual char const *typeString() const; virtual ACL *clone() const; @@ -35,7 +35,6 @@ private: static Prototype RegistryProtoype; static AllOf RegistryEntry_; }; -MEMPROXY_CLASS_INLINE(Acl::AllOf); } // namespace Acl diff --git a/src/acl/AnyOf.h b/src/acl/AnyOf.h index c9ba682a0e..c7a7184fb1 100644 --- a/src/acl/AnyOf.h +++ b/src/acl/AnyOf.h @@ -17,9 +17,9 @@ namespace Acl /// Configurable any-of ACL. Each ACL line is a disjuction of ACLs. class AnyOf: public Acl::OrNode { -public: MEMPROXY_CLASS(AnyOf); +public: /* ACL API */ virtual char const *typeString() const; virtual ACL *clone() const; @@ -29,7 +29,6 @@ private: static Prototype RegistryProtoype; static AnyOf RegistryEntry_; }; -MEMPROXY_CLASS_INLINE(Acl::AnyOf); } // namespace Acl diff --git a/src/acl/Arp.h b/src/acl/Arp.h index 106ac922df..c6f61847bd 100644 --- a/src/acl/Arp.h +++ b/src/acl/Arp.h @@ -21,10 +21,9 @@ class Eui48; /// \ingroup ACLAPI class ACLARP : public ACL { - -public: MEMPROXY_CLASS(ACLARP); +public: ACLARP(char const *); ACLARP(ACLARP const &); ~ACLARP(); @@ -44,6 +43,4 @@ protected: char const *class_; }; -MEMPROXY_CLASS_INLINE(ACLARP); - #endif /* SQUID_ACLARP_H */ diff --git a/src/acl/Asn.h b/src/acl/Asn.h index fe92200c52..2b81dcdf26 100644 --- a/src/acl/Asn.h +++ b/src/acl/Asn.h @@ -26,10 +26,9 @@ void asnFreeMemory(void); /// \ingroup ACLAPI class ACLASN : public ACLData { - -public: MEMPROXY_CLASS(ACLASN); +public: virtual ~ACLASN(); virtual bool match(Ip::Address); @@ -47,6 +46,4 @@ private: CbDataList *data; }; -MEMPROXY_CLASS_INLINE(ACLASN); - #endif /* SQUID_ACLASN_H */ diff --git a/src/acl/AtStepData.h b/src/acl/AtStepData.h index be31d5628d..895a8b8c74 100644 --- a/src/acl/AtStepData.h +++ b/src/acl/AtStepData.h @@ -20,10 +20,9 @@ class ACLAtStepData : public ACLData { - -public: MEMPROXY_CLASS(ACLAtStepData); +public: ACLAtStepData(); ACLAtStepData(ACLAtStepData const &); ACLAtStepData &operator= (ACLAtStepData const &); @@ -37,8 +36,6 @@ public: std::list values; }; -MEMPROXY_CLASS_INLINE(ACLAtStepData); - #endif /* USE_OPENSSL */ #endif /* SQUID_ACLSSL_ERRORDATA_H */ diff --git a/src/acl/BoolOps.h b/src/acl/BoolOps.h index a5952eb289..a6193047d1 100644 --- a/src/acl/BoolOps.h +++ b/src/acl/BoolOps.h @@ -21,9 +21,9 @@ namespace Acl /// Implements the "not" or "!" operator. class NotNode: public InnerNode { -public: MEMPROXY_CLASS(NotNode); +public: explicit NotNode(ACL *acl); private: @@ -36,16 +36,15 @@ private: /* Acl::InnerNode API */ virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const; }; -MEMPROXY_CLASS_INLINE(Acl::NotNode); /// An inner ACL expression tree node representing a boolean conjuction (AND) /// operator applied to a list of child tree nodes. /// For example, conditions expressed on a single http_access line are ANDed. class AndNode: public InnerNode { -public: MEMPROXY_CLASS(AndNode); +public: /* ACL API */ virtual char const *typeString() const; virtual ACL *clone() const; @@ -54,16 +53,15 @@ public: private: virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const; }; -MEMPROXY_CLASS_INLINE(Acl::AndNode); /// An inner ACL expression tree node representing a boolean disjuction (OR) /// operator applied to a list of child tree nodes. /// For example, conditions expressed by multiple http_access lines are ORed. class OrNode: public InnerNode { -public: MEMPROXY_CLASS(OrNode); +public: /* ACL API */ virtual char const *typeString() const; virtual ACL *clone() const; @@ -75,7 +73,6 @@ protected: private: virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const; }; -MEMPROXY_CLASS_INLINE(Acl::OrNode); } // namespace Acl diff --git a/src/acl/CertificateData.h b/src/acl/CertificateData.h index 4923fe430a..00562afbb2 100644 --- a/src/acl/CertificateData.h +++ b/src/acl/CertificateData.h @@ -20,10 +20,9 @@ /// \ingroup ACLAPI class ACLCertificateData : public ACLData { - -public: MEMPROXY_CLASS(ACLCertificateData); +public: ACLCertificateData(Ssl::GETX509ATTRIBUTE *, const char *attributes, bool optionalAttr = false); ACLCertificateData(ACLCertificateData const &); ACLCertificateData &operator= (ACLCertificateData const &); @@ -51,6 +50,4 @@ private: Ssl::GETX509ATTRIBUTE *sslAttributeCall; }; -MEMPROXY_CLASS_INLINE(ACLCertificateData); - #endif /* SQUID_ACLCERTIFICATEDATA_H */ diff --git a/src/acl/DestinationIp.h b/src/acl/DestinationIp.h index 1b8d890bd1..c1e630e9f4 100644 --- a/src/acl/DestinationIp.h +++ b/src/acl/DestinationIp.h @@ -8,6 +8,7 @@ #ifndef SQUID_ACLDESTINATIONIP_H #define SQUID_ACLDESTINATIONIP_H + #include "acl/Checklist.h" #include "acl/Ip.h" #include "ipcache.h" @@ -26,10 +27,9 @@ private: class ACLDestinationIP : public ACLIP { - -public: MEMPROXY_CLASS(ACLDestinationIP); +public: ACLDestinationIP(): ACLIP(ACLDestinationIP::SupportedFlags) {} virtual char const *typeString() const; virtual int match(ACLChecklist *checklist); @@ -43,6 +43,4 @@ private: static ACLDestinationIP RegistryEntry_; }; -MEMPROXY_CLASS_INLINE(ACLDestinationIP); - #endif /* SQUID_ACLDESTINATIONIP_H */ diff --git a/src/acl/DomainData.h b/src/acl/DomainData.h index 4821a75806..3ab9866f9a 100644 --- a/src/acl/DomainData.h +++ b/src/acl/DomainData.h @@ -13,13 +13,11 @@ #include "acl/Data.h" #include "splay.h" -/// \ingroup ACLAPI class ACLDomainData : public ACLData { - -public: MEMPROXY_CLASS(ACLDomainData); +public: virtual ~ACLDomainData(); bool match(char const *); virtual SBufList dump() const; @@ -30,6 +28,4 @@ public: SplayNode *domains; }; -MEMPROXY_CLASS_INLINE(ACLDomainData); - #endif /* SQUID_ACLDOMAINDATA_H */ diff --git a/src/acl/Eui64.h b/src/acl/Eui64.h index 25c2a47bb0..d910e6574d 100644 --- a/src/acl/Eui64.h +++ b/src/acl/Eui64.h @@ -18,13 +18,11 @@ namespace Eui class Eui64; }; -/// \ingroup ACLAPI class ACLEui64 : public ACL { + MEMPROXY_CLASS(ACLEui64); public: - MEMPROXY_CLASS(ACLEUI64); - ACLEui64(char const *); ACLEui64(ACLEui64 const &); ~ACLEui64(); @@ -44,6 +42,4 @@ protected: char const *class_; }; -MEMPROXY_CLASS_INLINE(ACLEui64); - #endif /* SQUID_ACLEUI64_H */ diff --git a/src/acl/ExtUser.h b/src/acl/ExtUser.h index 51f0806f33..bb393b9237 100644 --- a/src/acl/ExtUser.h +++ b/src/acl/ExtUser.h @@ -15,13 +15,11 @@ #include "acl/Checklist.h" #include "acl/Data.h" -/// \ingroup ACLAPI class ACLExtUser : public ACL { - -public: MEMPROXY_CLASS(ACLExtUser); +public: ACLExtUser(ACLData *newData, char const *); ACLExtUser (ACLExtUser const &old); ACLExtUser & operator= (ACLExtUser const &rhs); @@ -44,7 +42,5 @@ private: char const *type_; }; -MEMPROXY_CLASS_INLINE(ACLExtUser); - #endif /* USE_AUTH */ #endif /* SQUID_EXTUSER_H */ diff --git a/src/acl/HierCodeData.h b/src/acl/HierCodeData.h index b91e9fc8a3..5f72bc9095 100644 --- a/src/acl/HierCodeData.h +++ b/src/acl/HierCodeData.h @@ -17,10 +17,9 @@ /// \ingroup ACLAPI class ACLHierCodeData : public ACLData { - -public: MEMPROXY_CLASS(ACLHierCodeData); +public: ACLHierCodeData(); ACLHierCodeData(ACLHierCodeData const &); ACLHierCodeData &operator= (ACLHierCodeData const &); @@ -35,6 +34,4 @@ public: bool values[HIER_MAX]; }; -MEMPROXY_CLASS_INLINE(ACLHierCodeData); - #endif /* SQUID_ACLHIERCODEDATA_H */ diff --git a/src/acl/HttpHeaderData.h b/src/acl/HttpHeaderData.h index fbeff1a9a4..e61d193da9 100644 --- a/src/acl/HttpHeaderData.h +++ b/src/acl/HttpHeaderData.h @@ -9,25 +9,16 @@ #ifndef SQUID_ACLHTTPHEADERDATA_H #define SQUID_ACLHTTPHEADERDATA_H -class HttpHeader; -class wordlist; - -/* becaue we inherit from it */ #include "acl/Data.h" -/* for String field */ #include "SquidString.h" -/* for http_hdr_type field */ #include "HttpHeader.h" -/* because weuse its MEMPROXY_CLASS() macros */ #include "MemPool.h" -/// \ingroup ACLAPI class ACLHTTPHeaderData : public ACLData { - -public: MEMPROXY_CLASS(ACLHTTPHeaderData); +public: ACLHTTPHeaderData(); virtual ~ACLHTTPHeaderData(); virtual bool match(HttpHeader* hdr); @@ -42,6 +33,4 @@ private: ACLData * regex_rule; }; -MEMPROXY_CLASS_INLINE(ACLHTTPHeaderData); - #endif /* SQUID_ACLHTTPHEADERDATA_H */ diff --git a/src/acl/HttpStatus.h b/src/acl/HttpStatus.h index 2b404abc79..8d7b76c4be 100644 --- a/src/acl/HttpStatus.h +++ b/src/acl/HttpStatus.h @@ -26,10 +26,9 @@ struct acl_httpstatus_data { /// \ingroup ACLAPI class ACLHTTPStatus : public ACL { - -public: MEMPROXY_CLASS(ACLHTTPStatus); +public: ACLHTTPStatus(char const *); ACLHTTPStatus(ACLHTTPStatus const &); ~ACLHTTPStatus(); @@ -50,6 +49,4 @@ protected: char const *class_; }; -MEMPROXY_CLASS_INLINE(ACLHTTPStatus); - #endif /* SQUID_ACLHTTPSTATUS_H */ diff --git a/src/acl/Ip.h b/src/acl/Ip.h index d1db9e2ebe..36137ecf98 100644 --- a/src/acl/Ip.h +++ b/src/acl/Ip.h @@ -14,12 +14,11 @@ #include "ip/Address.h" #include "splay.h" -/// \ingroup ACLAPI class acl_ip_data { + MEMPROXY_CLASS(acl_ip_data); public: - MEMPROXY_CLASS(acl_ip_data); static acl_ip_data *FactoryParse(char const *); static int NetworkCompare(acl_ip_data * const & a, acl_ip_data * const &b); @@ -42,12 +41,8 @@ private: static bool DecodeMask(const char *asc, Ip::Address &mask, int string_format_type); }; -MEMPROXY_CLASS_INLINE(acl_ip_data); - -/// \ingroup ACLAPI class ACLIP : public ACL { - public: void *operator new(size_t); void operator delete(void *); diff --git a/src/acl/LocalIp.h b/src/acl/LocalIp.h index 32d75f275d..cf1587ac5f 100644 --- a/src/acl/LocalIp.h +++ b/src/acl/LocalIp.h @@ -14,9 +14,9 @@ /// \ingroup ACLAPI class ACLLocalIP : public ACLIP { + MEMPROXY_CLASS(ACLLocalIP); public: - MEMPROXY_CLASS(ACLLocalIP); static ACLLocalIP const &RegistryEntry(); virtual char const *typeString() const; @@ -28,6 +28,4 @@ private: static ACLLocalIP RegistryEntry_; }; -MEMPROXY_CLASS_INLINE(ACLLocalIP); - #endif /* SQUID_ACLLOCALIP_H */ diff --git a/src/acl/MaxConnection.h b/src/acl/MaxConnection.h index 11aa7108e9..3e06b0b213 100644 --- a/src/acl/MaxConnection.h +++ b/src/acl/MaxConnection.h @@ -15,10 +15,9 @@ /// \ingroup ACLAPI class ACLMaxConnection : public ACL { - -public: MEMPROXY_CLASS(ACLMaxConnection); +public: ACLMaxConnection(char const *); ACLMaxConnection(ACLMaxConnection const &); ~ACLMaxConnection(); @@ -40,6 +39,4 @@ protected: int limit; }; -MEMPROXY_CLASS_INLINE(ACLMaxConnection); - #endif /* SQUID_ACLMAXCONNECTION_H */ diff --git a/src/acl/MethodData.h b/src/acl/MethodData.h index 32a59dc152..92a5fd79c4 100644 --- a/src/acl/MethodData.h +++ b/src/acl/MethodData.h @@ -14,13 +14,11 @@ #include "CbDataList.h" #include "HttpRequestMethod.h" -/// \ingroup ACLAPI class ACLMethodData : public ACLData { - -public: MEMPROXY_CLASS(ACLMethodData); +public: ACLMethodData(); ACLMethodData(ACLMethodData const &); ACLMethodData &operator= (ACLMethodData const &); @@ -36,6 +34,4 @@ public: static int ThePurgeCount; ///< PURGE methods seen by parse() }; -MEMPROXY_CLASS_INLINE(ACLMethodData); - #endif /* SQUID_ACLMETHODDATA_H */ diff --git a/src/acl/NoteData.h b/src/acl/NoteData.h index 91ba593997..9bb8591b6e 100644 --- a/src/acl/NoteData.h +++ b/src/acl/NoteData.h @@ -19,9 +19,9 @@ class NotePairs; /// \ingroup ACLAPI class ACLNoteData : public ACLData { -public: MEMPROXY_CLASS(ACLNoteData); +public: ACLNoteData(); virtual ~ACLNoteData(); virtual bool match(HttpRequest* request); @@ -36,6 +36,4 @@ private: ACLData *values; ///< if set, at least one value must match }; -MEMPROXY_CLASS_INLINE(ACLNoteData); - #endif /* SQUID_ACLNOTEDATA_H */ diff --git a/src/acl/ProtocolData.h b/src/acl/ProtocolData.h index 3bd44a1de7..2f5e357e6b 100644 --- a/src/acl/ProtocolData.h +++ b/src/acl/ProtocolData.h @@ -16,10 +16,9 @@ class ACLProtocolData : public ACLData { - -public: MEMPROXY_CLASS(ACLProtocolData); +public: ACLProtocolData(); ACLProtocolData(ACLProtocolData const &); ACLProtocolData &operator= (ACLProtocolData const &); @@ -33,6 +32,4 @@ public: CbDataList *values; }; -MEMPROXY_CLASS_INLINE(ACLProtocolData); - #endif /* SQUID_ACLPROTOCOLDATA_H */ diff --git a/src/acl/Random.h b/src/acl/Random.h index 29bc341d94..da0bb54fdf 100644 --- a/src/acl/Random.h +++ b/src/acl/Random.h @@ -12,13 +12,11 @@ #include "acl/Acl.h" #include "acl/Checklist.h" -/// \ingroup ACLAPI class ACLRandom : public ACL { - -public: MEMPROXY_CLASS(ACLRandom); +public: ACLRandom(char const *); ACLRandom(ACLRandom const &); ~ACLRandom(); @@ -40,6 +38,4 @@ protected: char const *class_; }; -MEMPROXY_CLASS_INLINE(ACLRandom); - #endif /* SQUID_ACL_RANDOM_H */ diff --git a/src/acl/RegexData.h b/src/acl/RegexData.h index 041cdb006d..d8a2a509b4 100644 --- a/src/acl/RegexData.h +++ b/src/acl/RegexData.h @@ -16,10 +16,9 @@ class RegexList; class ACLRegexData : public ACLData { - -public: MEMPROXY_CLASS(ACLRegexData); +public: virtual ~ACLRegexData(); virtual bool match(char const *user); virtual SBufList dump() const; @@ -31,6 +30,4 @@ private: RegexList *data; }; -MEMPROXY_CLASS_INLINE(ACLRegexData); - #endif /* SQUID_ACLREGEXDATA_H */ diff --git a/src/acl/SourceIp.h b/src/acl/SourceIp.h index 5c355dd062..f4fb77b8df 100644 --- a/src/acl/SourceIp.h +++ b/src/acl/SourceIp.h @@ -8,14 +8,14 @@ #ifndef SQUID_ACLSOURCEIP_H #define SQUID_ACLSOURCEIP_H + #include "acl/Ip.h" class ACLSourceIP : public ACLIP { - -public: MEMPROXY_CLASS(ACLSourceIP); +public: virtual char const *typeString() const; virtual int match(ACLChecklist *checklist); virtual ACL *clone()const; @@ -25,6 +25,4 @@ private: static ACLSourceIP RegistryEntry_; }; -MEMPROXY_CLASS_INLINE(ACLSourceIP); - #endif /* SQUID_ACLSOURCEIP_H */ diff --git a/src/acl/SslErrorData.h b/src/acl/SslErrorData.h index 81e3ea0b13..eaf249681f 100644 --- a/src/acl/SslErrorData.h +++ b/src/acl/SslErrorData.h @@ -8,6 +8,7 @@ #ifndef SQUID_ACLSSL_ERRORDATA_H #define SQUID_ACLSSL_ERRORDATA_H + #include "acl/Acl.h" #include "acl/Data.h" #include "CbDataList.h" @@ -17,10 +18,9 @@ class ACLSslErrorData : public ACLData { - -public: MEMPROXY_CLASS(ACLSslErrorData); +public: ACLSslErrorData(); ACLSslErrorData(ACLSslErrorData const &); ACLSslErrorData &operator= (ACLSslErrorData const &); @@ -34,6 +34,4 @@ public: Ssl::Errors *values; }; -MEMPROXY_CLASS_INLINE(ACLSslErrorData); - #endif /* SQUID_ACLSSL_ERRORDATA_H */ diff --git a/src/acl/StringData.h b/src/acl/StringData.h index 7857bcd1b5..da0ad3b5bb 100644 --- a/src/acl/StringData.h +++ b/src/acl/StringData.h @@ -8,16 +8,16 @@ #ifndef SQUID_ACLSTRINGDATA_H #define SQUID_ACLSTRINGDATA_H + #include "acl/Acl.h" #include "acl/Data.h" #include "splay.h" class ACLStringData : public ACLData { - -public: MEMPROXY_CLASS(ACLStringData); +public: ACLStringData(); ACLStringData(ACLStringData const &); ACLStringData &operator= (ACLStringData const &); @@ -33,8 +33,4 @@ public: SplayNode *values; }; -/* TODO move into .cci files */ - -MEMPROXY_CLASS_INLINE(ACLStringData); - #endif /* SQUID_ACLSTRINGDATA_H */ diff --git a/src/acl/TimeData.h b/src/acl/TimeData.h index 30e5554422..1a6f8598a5 100644 --- a/src/acl/TimeData.h +++ b/src/acl/TimeData.h @@ -8,16 +8,16 @@ #ifndef SQUID_ACLTIMEDATA_H #define SQUID_ACLTIMEDATA_H + #include "acl/Acl.h" #include "acl/Data.h" #include "splay.h" class ACLTimeData : public ACLData { - -public: MEMPROXY_CLASS(ACLTimeData); +public: ACLTimeData(); ACLTimeData(ACLTimeData const &); ACLTimeData&operator=(ACLTimeData const &); @@ -35,6 +35,4 @@ private: ACLTimeData *next; }; -MEMPROXY_CLASS_INLINE(ACLTimeData); - #endif /* SQUID_ACLTIMEDATA_H */ diff --git a/src/acl/UserData.h b/src/acl/UserData.h index edcc1ce7cb..6fe94686ab 100644 --- a/src/acl/UserData.h +++ b/src/acl/UserData.h @@ -8,16 +8,16 @@ #ifndef SQUID_ACLUSERDATA_H #define SQUID_ACLUSERDATA_H + #include "acl/Acl.h" #include "acl/Data.h" #include "splay.h" class ACLUserData : public ACLData { - -public: MEMPROXY_CLASS(ACLUserData); +public: virtual ~ACLUserData(); bool match(char const *user); virtual SBufList dump() const; @@ -33,6 +33,4 @@ public: } flags; }; -MEMPROXY_CLASS_INLINE(ACLUserData); - #endif /* SQUID_ACLUSERDATA_H */ diff --git a/src/auth/AclMaxUserIp.h b/src/auth/AclMaxUserIp.h index f15e7555a4..63026c959d 100644 --- a/src/auth/AclMaxUserIp.h +++ b/src/auth/AclMaxUserIp.h @@ -15,12 +15,11 @@ #include "acl/Checklist.h" #include "auth/UserRequest.h" -/// \ingroup ACLAPI class ACLMaxUserIP : public ACL { -public: MEMPROXY_CLASS(ACLMaxUserIP); +public: ACLMaxUserIP(char const *theClass); ACLMaxUserIP(ACLMaxUserIP const &old); ~ACLMaxUserIP(); @@ -49,7 +48,5 @@ private: int maximum; }; -MEMPROXY_CLASS_INLINE(ACLMaxUserIP); - #endif /* USE_AUTH */ #endif /* SQUID_ACLMAXUSERIP_H */ diff --git a/src/auth/AclProxyAuth.h b/src/auth/AclProxyAuth.h index a42b47b036..b95b1e49bc 100644 --- a/src/auth/AclProxyAuth.h +++ b/src/auth/AclProxyAuth.h @@ -29,9 +29,9 @@ private: class ACLProxyAuth : public ACL { -public: MEMPROXY_CLASS(ACLProxyAuth); +public: ~ACLProxyAuth(); ACLProxyAuth(ACLData *, char const *); ACLProxyAuth(ACLProxyAuth const &); @@ -60,7 +60,5 @@ private: char const *type_; }; -MEMPROXY_CLASS_INLINE(ACLProxyAuth); - #endif /* USE_AUTH */ #endif /* SQUID_ACLPROXYAUTH_H */ diff --git a/src/auth/Gadgets.h b/src/auth/Gadgets.h index 5135e647a4..a7ee818cc6 100644 --- a/src/auth/Gadgets.h +++ b/src/auth/Gadgets.h @@ -30,11 +30,9 @@ */ class AuthUserHashPointer : public hash_link { - /* first two items must be same as hash_link */ - -public: MEMPROXY_CLASS(AuthUserHashPointer); +public: AuthUserHashPointer(Auth::User::Pointer); ~AuthUserHashPointer() { auth_user = NULL; }; @@ -44,8 +42,6 @@ private: Auth::User::Pointer auth_user; }; -MEMPROXY_CLASS_INLINE(AuthUserHashPointer); - namespace Auth { class Scheme; diff --git a/src/auth/QueueNode.h b/src/auth/QueueNode.h index 2d5fdf1eaa..5854b120b3 100644 --- a/src/auth/QueueNode.h +++ b/src/auth/QueueNode.h @@ -24,6 +24,7 @@ namespace Auth */ class QueueNode { + MEMPROXY_CLASS(Auth::QueueNode); private: // we store CBDATA here, copy is not safe @@ -50,12 +51,8 @@ public: Auth::UserRequest::Pointer auth_user_request; AUTHCB *handler; void *data; - - MEMPROXY_CLASS(Auth::QueueNode); }; -MEMPROXY_CLASS_INLINE(Auth::QueueNode); - } // namespace Auth #endif /* SQUID_SRC_AUTH_QUEUENODE_H */ diff --git a/src/auth/UserRequest.h b/src/auth/UserRequest.h index ab54933144..91b2d04a4b 100644 --- a/src/auth/UserRequest.h +++ b/src/auth/UserRequest.h @@ -36,6 +36,8 @@ class HttpRequest; */ class AuthUserIP { + MEMPROXY_CLASS(AuthUserIP); + public: AuthUserIP(const Ip::Address &ip, time_t t) : ipaddr(ip), ip_expiretime(t) {} @@ -49,12 +51,8 @@ public: * (user,IP) pair plus authenticate_ip_ttl seconds */ time_t ip_expiretime; - - MEMPROXY_CLASS(AuthUserIP); }; -MEMPROXY_CLASS_INLINE(AuthUserIP); - // TODO: make auth schedule AsyncCalls? typedef void AUTHCB(void*); diff --git a/src/auth/basic/User.h b/src/auth/basic/User.h index 5aaaccadd7..f128937cb2 100644 --- a/src/auth/basic/User.h +++ b/src/auth/basic/User.h @@ -24,9 +24,9 @@ namespace Basic /** User credentials for the Basic authentication protocol */ class User : public Auth::User { -public: MEMPROXY_CLASS(Auth::Basic::User); +public: User(Auth::Config *, const char *requestRealm); ~User(); bool authenticated() const; @@ -44,8 +44,6 @@ private: Auth::UserRequest::Pointer currentRequest; }; -MEMPROXY_CLASS_INLINE(Auth::Basic::User); - } // namespace Basic } // namespace Auth diff --git a/src/auth/basic/UserRequest.h b/src/auth/basic/UserRequest.h index acddc3bff1..7ef90696aa 100644 --- a/src/auth/basic/UserRequest.h +++ b/src/auth/basic/UserRequest.h @@ -25,9 +25,9 @@ namespace Basic class UserRequest : public Auth::UserRequest { -public: MEMPROXY_CLASS(Auth::Basic::UserRequest); +public: UserRequest() {} virtual ~UserRequest() { assert(LockCount()==0); } @@ -44,6 +44,4 @@ private: } // namespace Basic } // namespace Auth -MEMPROXY_CLASS_INLINE(Auth::Basic::UserRequest); - #endif /* _SQUID_SRC_AUTH_BASIC_USERREQUEST_H */ diff --git a/src/auth/digest/User.h b/src/auth/digest/User.h index 1c5f5d7984..8f8d4748f0 100644 --- a/src/auth/digest/User.h +++ b/src/auth/digest/User.h @@ -19,9 +19,9 @@ namespace Digest /** User credentials for the Digest authentication protocol */ class User : public Auth::User { -public: MEMPROXY_CLASS(Auth::Digest::User); +public: User(Auth::Config *, const char *requestRealm); ~User(); int authenticated() const; @@ -37,8 +37,6 @@ public: digest_nonce_h * currentNonce(); }; -MEMPROXY_CLASS_INLINE(Auth::Digest::User); - } // namespace Digest } // namespace Auth diff --git a/src/auth/digest/UserRequest.h b/src/auth/digest/UserRequest.h index e0ba9c78cf..b1e0e317aa 100644 --- a/src/auth/digest/UserRequest.h +++ b/src/auth/digest/UserRequest.h @@ -26,10 +26,9 @@ namespace Digest */ class UserRequest : public Auth::UserRequest { - -public: MEMPROXY_CLASS(Auth::Digest::UserRequest); +public: UserRequest(); virtual ~UserRequest(); @@ -69,6 +68,4 @@ private: } // namespace Digest } // namespace Auth -MEMPROXY_CLASS_INLINE(Auth::Digest::UserRequest); - #endif /* _SQUID_SRC_AUTH_DIGEST_USERREQUEST_H */ diff --git a/src/auth/negotiate/User.h b/src/auth/negotiate/User.h index 59c95d201e..ed2f45f39f 100644 --- a/src/auth/negotiate/User.h +++ b/src/auth/negotiate/User.h @@ -22,8 +22,9 @@ namespace Negotiate /** User credentials for the Negotiate authentication protocol */ class User : public Auth::User { -public: MEMPROXY_CLASS(Auth::Negotiate::User); + +public: User(Auth::Config *, const char *requestRealm); ~User(); virtual int32_t ttl() const; @@ -31,8 +32,6 @@ public: dlink_list proxy_auth_list; }; -MEMPROXY_CLASS_INLINE(Auth::Negotiate::User); - } // namespace Negotiate } // namespace Auth diff --git a/src/auth/negotiate/UserRequest.h b/src/auth/negotiate/UserRequest.h index 59d5c7b700..c1f8db6f7a 100644 --- a/src/auth/negotiate/UserRequest.h +++ b/src/auth/negotiate/UserRequest.h @@ -25,10 +25,9 @@ namespace Negotiate /// \ingroup AuthNegotiateAPI class UserRequest : public Auth::UserRequest { - -public: MEMPROXY_CLASS(Auth::Negotiate::UserRequest); +public: UserRequest(); virtual ~UserRequest(); virtual int authenticated() const; @@ -66,6 +65,4 @@ private: } // namespace Negotiate } // namespace Auth -MEMPROXY_CLASS_INLINE(Auth::Negotiate::UserRequest); - #endif /* _SQUID_SRC_AUTH_NEGOTIATE_USERREQUEST_H */ diff --git a/src/auth/ntlm/User.h b/src/auth/ntlm/User.h index 3814759b11..e4302c200d 100644 --- a/src/auth/ntlm/User.h +++ b/src/auth/ntlm/User.h @@ -22,8 +22,9 @@ namespace Ntlm /** User credentials for the NTLM authentication protocol */ class User : public Auth::User { -public: MEMPROXY_CLASS(Auth::Ntlm::User); + +public: User(Auth::Config *, const char *requestRealm); ~User(); @@ -32,8 +33,6 @@ public: dlink_list proxy_auth_list; }; -MEMPROXY_CLASS_INLINE(Auth::Ntlm::User); - } // namespace Ntlm } // namespace Auth diff --git a/src/auth/ntlm/UserRequest.h b/src/auth/ntlm/UserRequest.h index 126d85db28..74d349246f 100644 --- a/src/auth/ntlm/UserRequest.h +++ b/src/auth/ntlm/UserRequest.h @@ -24,10 +24,9 @@ namespace Ntlm class UserRequest : public Auth::UserRequest { - -public: MEMPROXY_CLASS(Auth::Ntlm::UserRequest); +public: UserRequest(); virtual ~UserRequest(); virtual int authenticated() const; @@ -61,6 +60,4 @@ private: } // namespace Ntlm } // namespace Auth -MEMPROXY_CLASS_INLINE(Auth::Ntlm::UserRequest); - #endif /* _SQUID_SRC_AUTH_NTLM_USERREQUEST_H */ diff --git a/src/cbdata.cc b/src/cbdata.cc index e7148d233a..e9bd582284 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -63,6 +63,14 @@ public: /// \ingroup CBDATAInternal class cbdata { +#if !HASHED_CBDATA +public: + void *operator new(size_t size, void *where); + void operator delete(void *where, void *where2); +#else + MEMPROXY_CLASS(cndata); +#endif + /** \todo examine making cbdata templated on this - so we get type * safe access to data - RBC 20030902 */ public: @@ -75,13 +83,6 @@ public: void dump(StoreEntry *)const; #endif -#if !HASHED_CBDATA - void *operator new(size_t size, void *where); - void operator delete(void *where, void *where2); -#else - MEMPROXY_CLASS(cndata); -#endif - ~cbdata(); int valid; int32_t locks; @@ -145,8 +146,6 @@ cbdata::MakeOffset() void **dataOffset = &zero->data; return (long)dataOffset; } -#else -MEMPROXY_CLASS_INLINE(cbdata); #endif static OBJH cbdataDump; diff --git a/src/comm/Connection.h b/src/comm/Connection.h index 7d131ad194..30dcb193d8 100644 --- a/src/comm/Connection.h +++ b/src/comm/Connection.h @@ -59,9 +59,9 @@ namespace Comm */ class Connection : public RefCountable { -public: MEMPROXY_CLASS(Comm::Connection); +public: Connection(); /** Clear the connection properties and close any open socket. */ @@ -144,8 +144,6 @@ private: }; // namespace Comm -MEMPROXY_CLASS_INLINE(Comm::Connection); - // NP: Order and namespace here is very important. // * The second define inlines the first. // * Stream inheritance overloading is searched in the global scope first. diff --git a/src/esi/Assign.h b/src/esi/Assign.h index b9edcb654e..4d55013a53 100644 --- a/src/esi/Assign.h +++ b/src/esi/Assign.h @@ -15,12 +15,9 @@ #include "esi/VarState.h" #include "SquidString.h" -/* ESIVariableExpression */ -/* This is a variable that is itself and expression */ - +/** This is a variable that is itself an expression */ class ESIVariableExpression : public ESIVarState::Variable { - public: ~ESIVariableExpression(); ESIVariableExpression (String const &value); @@ -30,15 +27,13 @@ private: String expression; }; -/* ESIAssign */ - class ESIContext; class ESIAssign : public ESIElement { + MEMPROXY_CLASS(ESIAssign); public: - MEMPROXY_CLASS(ESIAssign); ESIAssign (esiTreeParentPtr, int, const char **, ESIContext *); ESIAssign (ESIAssign const &); ESIAssign &operator=(ESIAssign const &); @@ -61,6 +56,4 @@ private: String unevaluatedVariable; }; -MEMPROXY_CLASS_INLINE(ESIAssign); - #endif /* SQUID_ESIASSIGN_H */ diff --git a/src/esi/Esi.cc b/src/esi/Esi.cc index 7b6fff0949..13f96a0279 100644 --- a/src/esi/Esi.cc +++ b/src/esi/Esi.cc @@ -81,10 +81,11 @@ typedef ESIContext::esiKick_t esiKick_t; /* some core operators */ -/* esiComment */ - -struct esiComment : public ESIElement { +class esiComment : public ESIElement +{ MEMPROXY_CLASS(esiComment); + +public: ~esiComment(); esiComment(); Pointer makeCacheable() const; @@ -94,8 +95,6 @@ struct esiComment : public ESIElement { void finish(); }; -MEMPROXY_CLASS_INLINE(esiComment); - #include "esi/Literal.h" #include "esi/Sequence.h" @@ -123,11 +122,11 @@ CBDATA_TYPE (esiRemove); static FREE esiRemoveFree; static ESIElement * esiRemoveNew(void); -/* esiTry */ - -struct esiTry : public ESIElement { +class esiTry : public ESIElement +{ MEMPROXY_CLASS(esiTry); +public: esiTry(esiTreeParentPtr aParent); ~esiTry(); @@ -158,15 +157,13 @@ private: esiProcessResult_t bestAttemptRV() const; }; -MEMPROXY_CLASS_INLINE(esiTry); - #include "esi/Var.h" -/* esiChoose */ - -struct esiChoose : public ESIElement { +class esiChoose : public ESIElement +{ MEMPROXY_CLASS(esiChoose); +public: esiChoose(esiTreeParentPtr); ~esiChoose(); @@ -194,12 +191,11 @@ private: void selectElement(); }; -MEMPROXY_CLASS_INLINE(esiChoose); - -/* esiWhen */ - -struct esiWhen : public esiSequence { +class esiWhen : public esiSequence +{ MEMPROXY_CLASS(esiWhen); + +public: esiWhen(esiTreeParentPtr aParent, int attributes, const char **attr, ESIVarState *); ~esiWhen(); Pointer makeCacheable() const; @@ -217,10 +213,6 @@ private: void evaluate(); }; -MEMPROXY_CLASS_INLINE(esiWhen); - -/* esiOtherwise */ - struct esiOtherwise : public esiSequence { // void *operator new (size_t byteCount); // void operator delete (void *address); diff --git a/src/esi/Include.h b/src/esi/Include.h index 51fe8eb6b5..22b0175cb9 100644 --- a/src/esi/Include.h +++ b/src/esi/Include.h @@ -35,14 +35,11 @@ private: CBDATA_CLASS2(ESIStreamContext); }; -/* ESIInclude */ - class ESIInclude : public ESIElement { - -public: MEMPROXY_CLASS(ESIInclude); +public: ESIInclude(esiTreeParentPtr, int attributes, const char **attr, ESIContext *); ~ESIInclude(); void render(ESISegment::Pointer); @@ -76,6 +73,4 @@ private: void prepareRequestHeaders(HttpHeader &tempheaders, ESIVarState *vars); }; -MEMPROXY_CLASS_INLINE(ESIInclude); - #endif /* SQUID_ESIINCLUDE_H */ diff --git a/src/esi/Literal.h b/src/esi/Literal.h index 70a4558701..8b54ff5002 100644 --- a/src/esi/Literal.h +++ b/src/esi/Literal.h @@ -14,11 +14,12 @@ #include "esi/Element.h" class ESIContext; -/* esiLiteral */ -struct esiLiteral : public ESIElement { +class esiLiteral : public ESIElement +{ MEMPROXY_CLASS(esiLiteral); +public: esiLiteral(ESISegment::Pointer); esiLiteral(ESIContext *, const char *s, int len); ~esiLiteral(); @@ -41,6 +42,4 @@ private: esiLiteral(esiLiteral const &); }; -MEMPROXY_CLASS_INLINE(esiLiteral); - #endif /* SQUID_ESILITERAL_H */ diff --git a/src/esi/Sequence.h b/src/esi/Sequence.h index 4128fe3f32..c3e2ed33d5 100644 --- a/src/esi/Sequence.h +++ b/src/esi/Sequence.h @@ -19,10 +19,9 @@ class esiSequence : public ESIElement { - -public: MEMPROXY_CLASS(esiSequence); +public: esiSequence(esiTreeParentPtr, bool = false); ~esiSequence(); @@ -65,6 +64,4 @@ private: void processStep(int dovars); }; -MEMPROXY_CLASS_INLINE(esiSequence); - #endif /* SQUID_ESISEQUENCE_H */ diff --git a/src/event.h b/src/event.h index 3636398a9f..5967b7af00 100644 --- a/src/event.h +++ b/src/event.h @@ -27,11 +27,11 @@ int eventFind(EVH *, void *); class ev_entry { + MEMPROXY_CLASS(ev_entry); public: ev_entry(char const * name, EVH * func, void *arg, double when, int weight, bool cbdata=true); ~ev_entry(); - MEMPROXY_CLASS(ev_entry); const char *name; EVH *func; void *arg; @@ -43,8 +43,6 @@ public: ev_entry *next; }; -MEMPROXY_CLASS_INLINE(ev_entry); - // manages time-based events class EventScheduler : public AsyncEngine { diff --git a/src/external_acl.cc b/src/external_acl.cc index 35bc9ab92a..d1114fd4bb 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -68,9 +68,10 @@ static ExternalACLEntryPointer external_acl_cache_add(external_acl * def, const class external_acl_format : public RefCountable { + MEMPROXY_CLASS(external_acl_format); + public: typedef RefCount Pointer; - MEMPROXY_CLASS(external_acl_format); external_acl_format() : type(Format::LFT_NONE), header(NULL), member(NULL), separator(' '), header_id(HDR_BAD_HDR) {} ~external_acl_format() { @@ -86,8 +87,6 @@ public: http_hdr_type header_id; }; -MEMPROXY_CLASS_INLINE(external_acl_format); - class external_acl { diff --git a/src/fs/rock/RockIoState.h b/src/fs/rock/RockIoState.h index 479bd9c04f..be52e7ba1f 100644 --- a/src/fs/rock/RockIoState.h +++ b/src/fs/rock/RockIoState.h @@ -23,6 +23,8 @@ class SwapDir; /// \ingroup Rock class IoState: public ::StoreIOState { + MEMPROXY_CLASS(IoState); + public: typedef RefCount Pointer; @@ -45,8 +47,6 @@ public: /// called by SwapDir::writeCompleted() after the last write and on error void finishedWriting(const int errFlag); - MEMPROXY_CLASS(IoState); - /* one and only one of these will be set and locked; access via *Anchor() */ const Ipc::StoreMapAnchor *readableAnchor_; ///< starting point for reading Ipc::StoreMapAnchor *writeableAnchor_; ///< starting point for writing @@ -74,8 +74,6 @@ private: MemBlob theBuf; // use for write content accumulation only }; -MEMPROXY_CLASS_INLINE(IoState); - } // namespace Rock #endif /* SQUID_FS_ROCK_IO_STATE_H */ diff --git a/src/fs/ufs/UFSStoreState.h b/src/fs/ufs/UFSStoreState.h index 3c16d84428..7095d325f1 100644 --- a/src/fs/ufs/UFSStoreState.h +++ b/src/fs/ufs/UFSStoreState.h @@ -44,8 +44,8 @@ protected: class _queued_read { - public: MEMPROXY_CLASS(UFSStoreState::_queued_read); + public: char *buf; size_t size; off_t offset; @@ -56,8 +56,8 @@ protected: class _queued_write { - public: MEMPROXY_CLASS(UFSStoreState::_queued_write); + public: char const *buf; size_t size; off_t offset; @@ -99,9 +99,6 @@ private: CBDATA_CLASS2(UFSStoreState); }; -MEMPROXY_CLASS_INLINE(UFSStoreState::_queued_read); -MEMPROXY_CLASS_INLINE(UFSStoreState::_queued_write); - } //namespace Ufs } //namespace Fs diff --git a/src/helper/Request.h b/src/helper/Request.h index 9c4fbc076a..0b00d65bc2 100644 --- a/src/helper/Request.h +++ b/src/helper/Request.h @@ -16,6 +16,8 @@ namespace Helper class Request { + MEMPROXY_CLASS(Helper::Request); + public: Request(HLPCB *c, void *d, const char *b) : buf(b ? xstrdup(b) : NULL), @@ -31,7 +33,6 @@ public: xfree(buf); } - MEMPROXY_CLASS(Helper::Request); char *buf; HLPCB *callback; void *data; @@ -42,6 +43,4 @@ public: } // namespace Helper -MEMPROXY_CLASS_INLINE(Helper::Request); - #endif /* _SQUID_SRC_HELPER_REQUEST_H */ diff --git a/src/htcp.cc b/src/htcp.cc index 00a10b3c1e..129a3aaa45 100644 --- a/src/htcp.cc +++ b/src/htcp.cc @@ -135,10 +135,9 @@ struct _htcpAuthHeader { class htcpSpecifier : public StoreClient { - -public: MEMPROXY_CLASS(htcpSpecifier); +public: void created (StoreEntry *newEntry); void checkHit(); void checkedHit(StoreEntry *e); @@ -158,8 +157,6 @@ private: htcpDataHeader *dhdr; }; -MEMPROXY_CLASS_INLINE(htcpSpecifier); - struct _htcpDetail { char *resp_hdrs; char *entity_hdrs; diff --git a/src/ident/AclIdent.h b/src/ident/AclIdent.h index 0313083bc2..e0d2280eb6 100644 --- a/src/ident/AclIdent.h +++ b/src/ident/AclIdent.h @@ -32,10 +32,9 @@ private: /// \ingroup ACLAPI class ACLIdent : public ACL { - -public: MEMPROXY_CLASS(ACLIdent); +public: ACLIdent(ACLData *newData, char const *); ACLIdent (ACLIdent const &old); ACLIdent & operator= (ACLIdent const &rhs); @@ -59,7 +58,5 @@ private: char const *type_; }; -MEMPROXY_CLASS_INLINE(ACLIdent); - #endif /* USE_IDENT */ #endif /* SQUID_IDENT_ACLIDENT_H */ diff --git a/src/mem_node.h b/src/mem_node.h index c904e9b9f0..9e3235aedd 100644 --- a/src/mem_node.h +++ b/src/mem_node.h @@ -16,12 +16,12 @@ class mem_node { + MEMPROXY_CLASS(mem_node); public: static size_t InUseCount(); static size_t StoreMemSize(); - MEMPROXY_CLASS(mem_node); mem_node(int64_t); ~mem_node(); size_t space() const; @@ -38,8 +38,6 @@ public: bool write_pending; }; -MEMPROXY_CLASS_INLINE(mem_node); - inline std::ostream & operator << (std::ostream &os, mem_node &aNode) { diff --git a/src/mime.cc b/src/mime.cc index 07936205e4..e39e3dbb13 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -37,6 +37,8 @@ static char const *mimeGetIcon(const char *fn); class MimeIcon : public StoreClient { + MEMPROXY_CLASS(MimeIcon); + public: explicit MimeIcon(const char *aName); ~MimeIcon(); @@ -44,16 +46,16 @@ public: char const * getName() const; void load(); void created(StoreEntry *newEntry); - MEMPROXY_CLASS(MimeIcon); private: const char *icon_; char *url_; }; -MEMPROXY_CLASS_INLINE(MimeIcon); class MimeEntry { + MEMPROXY_CLASS(MimeEntry); + public: explicit MimeEntry(const char *aPattern, const regex_t &compiledPattern, const char *aContentType, @@ -61,7 +63,6 @@ public: bool optionViewEnable, bool optionDownloadEnable, const char *anIconName); ~MimeEntry(); - MEMPROXY_CLASS(MimeEntry); const char *pattern; regex_t compiled_pattern; @@ -73,7 +74,6 @@ public: MimeIcon theIcon; MimeEntry *next; }; -MEMPROXY_CLASS_INLINE(MimeEntry); static MimeEntry *MimeTable = NULL; static MimeEntry **MimeTableTail = &MimeTable; diff --git a/src/tests/CapturingStoreEntry.h b/src/tests/CapturingStoreEntry.h index d62207c83b..6b5cb78362 100644 --- a/src/tests/CapturingStoreEntry.h +++ b/src/tests/CapturingStoreEntry.h @@ -16,10 +16,9 @@ class CapturingStoreEntry : public StoreEntry { - -public: MEMPROXY_CLASS(CapturingStoreEntry); +public: CapturingStoreEntry() : _buffer_calls(0), _flush_calls(0) {} String _appended_text; @@ -39,6 +38,4 @@ public: } }; -MEMPROXY_CLASS_INLINE(CapturingStoreEntry); - #endif diff --git a/src/tests/stub_event.cc b/src/tests/stub_event.cc index 0311ed2f18..ffee9ef82e 100644 --- a/src/tests/stub_event.cc +++ b/src/tests/stub_event.cc @@ -21,11 +21,8 @@ int eventFind(EVH *, void *) STUB_RETVAL(-1) // ev_entry::ev_entry(char const * name, EVH * func, void *arg, double when, int weight, bool cbdata) STUB // ev_entry::~ev_entry() STUB -// MEMPROXY_CLASS(ev_entry); // EVH *func; -//MEMPROXY_CLASS_INLINE(ev_entry); - EventScheduler::EventScheduler() STUB EventScheduler::~EventScheduler() STUB void EventScheduler::cancel(EVH * func, void * arg) STUB diff --git a/src/wordlist.h b/src/wordlist.h index 61bc723231..916fca52a6 100644 --- a/src/wordlist.h +++ b/src/wordlist.h @@ -20,14 +20,13 @@ */ class wordlist { -public: MEMPROXY_CLASS(wordlist); + +public: char *key; wordlist *next; }; -MEMPROXY_CLASS_INLINE(wordlist); - class MemBuf; /** Add a null-terminated c-string to a wordlist