]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: Simplify CBDATA API and rename CBDATA_CLASS
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 2 Nov 2014 00:10:01 +0000 (17:10 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 2 Nov 2014 00:10:01 +0000 (17:10 -0700)
There are no logic changes here.

* Rename CBDATA_CLASS2() to CBDATA_CLASS()

* Remove cbdata*Dbg() duplicate interface for CBDATA.
  Inline it with the CBDATA_CLASS() API

* update public:/private: class section handling in CBDATA_CLASS() and
  place all uses at the top of class definition as with MEMPROXY_CLASS()
  and typedef coding style.
 - this highlights TunnelStateData API as previously broken in regards
   to private members. Leave it public: for now with TODO on fixing.

80 files changed:
include/CbDataList.h
squid3.dox
src/BodyPipe.cc
src/BodyPipe.h
src/ClientInfo.h
src/ClientRequestContext.h
src/DiskIO/AIO/AIODiskFile.h
src/DiskIO/Blocking/BlockingFile.h
src/DiskIO/DiskDaemon/DiskdFile.h
src/DiskIO/DiskThreads/DiskThreadsDiskFile.h
src/DiskIO/IpcIo/IpcIoFile.h
src/DiskIO/Mmapped/MmappedFile.h
src/DiskIO/ReadRequest.h
src/DiskIO/WriteRequest.h
src/FwdState.h
src/MemBuf.h
src/PeerDigest.h
src/PeerPoolMgr.h
src/PeerSelectState.h
src/RemovalPolicy.h
src/StoreClient.h
src/StoreHashIndex.h
src/acl/Asn.cc
src/acl/FilledChecklist.h
src/acl/Tree.h
src/adaptation/AccessCheck.h
src/adaptation/Iterator.h
src/adaptation/ecap/XactionRep.h
src/adaptation/icap/ModXact.h
src/adaptation/icap/OptXact.h
src/adaptation/icap/ServiceRep.h
src/adaptation/icap/Xaction.h
src/auth/State.h
src/base/AsyncCall.h
src/cbdata.cc
src/cbdata.h
src/client_side.h
src/client_side_reply.h
src/client_side_request.h
src/clients/FtpClient.h
src/clients/FtpGateway.cc
src/clients/FtpRelay.cc
src/comm/ConnOpener.h
src/comm/TcpAcceptor.h
src/errorpage.h
src/esi/Context.h
src/esi/Include.h
src/fs/rock/RockIoRequests.h
src/fs/rock/RockRebuild.h
src/fs/ufs/RebuildState.h
src/fs/ufs/StoreSearchUFS.h
src/fs/ufs/UFSStoreState.h
src/gopher.cc
src/helper.h
src/http.h
src/ident/Ident.cc
src/ipc/Coordinator.h
src/ipc/Forwarder.h
src/ipc/Inquirer.h
src/ipc/Strand.h
src/ipc/UdsOp.h
src/log/TcpLogger.h
src/mgr/ActionWriter.h
src/mgr/Filler.h
src/mgr/Forwarder.h
src/mgr/Inquirer.h
src/mgr/StoreToCommWriter.h
src/pconn.h
src/redirect.cc
src/servers/FtpServer.h
src/servers/HttpServer.cc
src/snmp/Forwarder.h
src/snmp/Inquirer.h
src/ssl/PeerConnector.h
src/ssl/ServerBump.h
src/ssl/helper.cc
src/stat.cc
src/tunnel.cc
src/urn.cc
src/whois.cc

index 67964f701443b6900fe20455e62e524d0c2fb676..62fb7d97a2dc6e21cbe02d896b9869836ffd0770 100644 (file)
@@ -6,19 +6,19 @@
  * Please see the COPYING and CONTRIBUTORS files for details.
  */
 
-#ifndef SQUID_LIST_H
-#define SQUID_LIST_H
+#ifndef SQUID_CBDATALIST_H
+#define SQUID_CBDATALIST_H
 
-/** \todo FUBAR: cbdata.h is over in src/ */
+/* XXX: layering violation. cbdata.h is over in src/ */
 #include "../src/cbdata.h"
 
-/// \ingroup POD
 template <class C>
 class CbDataList
 {
+    CBDATA_CLASS(CbDataList);
 
 public:
-    CbDataList (C const &);
+    CbDataList(C const &);
     ~CbDataList();
 
     /// If element is already in the list, returns false.
@@ -32,12 +32,8 @@ public:
     CbDataList *next;
     C element;
     bool empty() const { return this == NULL; }
-
-private:
-    CBDATA_CLASS2(CbDataList);
 };
 
-/// \ingroup POD
 template<class C>
 class CbDataListContainer
 {
@@ -52,7 +48,6 @@ public:
     CbDataList<C> *head;
 };
 
-/// \ingroup POD
 template<class C>
 class CbDataListIterator
 {
@@ -72,8 +67,6 @@ private:
     CbDataList<C> *next_entry;
 };
 
-/* implementation follows */
-
 /** \cond AUTODOCS_IGNORE */
 template <class C>
 cbdata_type CbDataList<C>::CBDATA_CbDataList = CBDATA_UNKNOWN;
@@ -203,4 +196,4 @@ CbDataListContainer<C>::empty() const
     return head == NULL;
 }
 
-#endif /* SQUID_LIST_H */
+#endif /* SQUID_CBDATALIST_H */
index f90955c55df9150b44e353be577a39d096c448e1..3b173e4346c6ccb0cff31890959bf478adeae013 100644 (file)
@@ -1310,7 +1310,7 @@ EXPAND_AS_DEFINED      = AsyncCallWrapper \
                          AsyncCall \
                          AsyncCallEnter \
                          AsyncCallExit \
-                         CBDATA_CLASS2 \
+                         CBDATA_CLASS \
                          CBDATA_CLASS_INIT \
                          CBDATA_NAMESPACED_CLASS_INIT \
                          MEMPROXY_CLASS \
index 8a73a6ce5615cc17f3c03809e22e35bf471da101..f90ef99baca7aad79fa7b11df707155ed024bd73 100644 (file)
@@ -17,6 +17,8 @@ CBDATA_CLASS_INIT(BodyPipe);
 // data from a BodyPipe
 class BodySink: public BodyConsumer
 {
+    CBDATA_CLASS(BodySink);
+
 public:
     BodySink(const BodyPipe::Pointer &bp): AsyncJob("BodySink"), body_pipe(bp) {}
     virtual ~BodySink() { assert(!body_pipe); }
@@ -35,8 +37,6 @@ public:
 
 private:
     BodyPipe::Pointer body_pipe; ///< the pipe we are consuming from
-
-    CBDATA_CLASS2(BodySink);
 };
 
 CBDATA_CLASS_INIT(BodySink);
index 7ee8d38ab017f8dc4b8debff99a7afa4c6495d4d..83f7bcfc35fc3f1f65e3079163280da7de8bdb82 100644 (file)
@@ -89,6 +89,8 @@ private:
  */
 class BodyPipe: public RefCountable
 {
+    CBDATA_CLASS(BodyPipe);
+
 public:
     typedef RefCount<BodyPipe> Pointer;
     typedef BodyProducer Producer;
@@ -164,8 +166,6 @@ private:
     bool mustAutoConsume; // consume when there is no consumer
     bool abortedConsumption; ///< called BodyProducer::noteBodyConsumerAborted
     bool isCheckedOut; // to keep track of checkout violations
-
-    CBDATA_CLASS2(BodyPipe);
 };
 
 #endif /* SQUID_BODY_PIPE_H */
index 7fb081bdd1754005007ce9808c03e9f5e3c0c61f..4c356e48a3e90a1f5273d7b0a4d9614af55f44a5 100644 (file)
@@ -88,6 +88,8 @@ public:
 // a queue of Comm clients waiting for I/O quota controlled by delay pools
 class CommQuotaQueue
 {
+    CBDATA_CLASS(CommQuotaQueue);
+
 public:
     CommQuotaQueue(ClientInfo *info);
     ~CommQuotaQueue();
@@ -108,8 +110,6 @@ private:
     // TODO: optimize using a Ring- or List-based store?
     typedef std::deque<int> Store;
     Store fds; ///< descriptor queue
-
-    CBDATA_CLASS2(CommQuotaQueue);
 };
 #endif /* USE_DELAY_POOLS */
 
index 91a612942739a04d5dc48d7376e40007baf86412..709a8ef92393d87c3bd9b6e901e852d12697fde8 100644 (file)
@@ -25,6 +25,7 @@ class ErrorState;
 
 class ClientRequestContext : public RefCountable
 {
+    CBDATA_CLASS(ClientRequestContext);
 
 public:
     ClientRequestContext(ClientHttpRequest *);
@@ -89,9 +90,6 @@ public:
 #endif
     ErrorState *error; ///< saved error page for centralized/delayed processing
     bool readNextRequest; ///< whether Squid should read after error handling
-
-private:
-    CBDATA_CLASS2(ClientRequestContext);
 };
 
 #endif /* SQUID_CLIENTREQUESTCONTEXT_H */
index ba357a1fc5ad77c621d5fd094ba97d6e00565018..7b613cca5a0a87ce67ac40aa7b0ccc84799a817c 100644 (file)
@@ -20,6 +20,7 @@ class AIODiskIOStrategy;
 
 class AIODiskFile : public DiskFile
 {
+    CBDATA_CLASS(AIODiskFile);
 
 public:
 
@@ -53,7 +54,6 @@ private:
     RefCount<IORequestor> ioRequestor;
     bool closed;
     bool error_;
-    CBDATA_CLASS2(AIODiskFile);
 };
 
 #endif /* USE_DISKIO_AIO */
index 02707fbc2d68408e311dacefd9ec58b899ef85aa..75f2fee3b157c6032ab68189fdb147e473588ef4 100644 (file)
@@ -17,6 +17,7 @@
 
 class BlockingFile : public DiskFile
 {
+    CBDATA_CLASS(BlockingFile);
 
 public:
     BlockingFile(char const *path);
@@ -46,8 +47,6 @@ private:
     void doClose();
     void readDone(int fd, const char *buf, int len, int errflag);
     void writeDone(int fd, int errflag, size_t len);
-
-    CBDATA_CLASS2(BlockingFile);
 };
 
 #endif /* SQUID_BLOCKINGFILE_H */
index 3055c7aef1062406446b7ae5a017a9614ec52e81..6d82f856ae638d623bebd9bfcc09029ef887abd6 100644 (file)
@@ -23,6 +23,7 @@ struct diomsg;
  */
 class DiskdFile : public DiskFile
 {
+    CBDATA_CLASS(DiskdFile);
 
 public:
     DiskdFile(char const *path, DiskdIOStrategy *);
@@ -58,8 +59,6 @@ private:
     void ioAway();
     void ioCompleted();
     size_t inProgressIOs;
-
-    CBDATA_CLASS2(DiskdFile);
 };
 
 #endif
index 59da4a5ecfdc119b64647278dde4dcc875f7c9a0..7906776e0c29f9a87e7b1078edf2254523a1ffa0 100644 (file)
@@ -16,6 +16,7 @@
 
 class DiskThreadsDiskFile : public DiskFile
 {
+    CBDATA_CLASS(DiskThreadsDiskFile);
 
 public:
     DiskThreadsDiskFile(char const *path, DiskThreadsIOStrategy *);
@@ -60,8 +61,6 @@ private:
 
     void readDone(int fd, const char *buf, int len, int errflag, RefCount<ReadRequest> request);
     void writeDone(int fd, int errflag, size_t len, RefCount<WriteRequest> request);
-
-    CBDATA_CLASS2(DiskThreadsDiskFile);
 };
 
 #include "DiskIO/ReadRequest.h"
@@ -69,15 +68,13 @@ private:
 template <class RT>
 class IoResult
 {
+    CBDATA_CLASS(IoResult);
 
 public:
     IoResult(RefCount<DiskThreadsDiskFile> aFile, RefCount<RT> aRequest) : file(aFile), request(aRequest) {}
 
     RefCount<DiskThreadsDiskFile> file;
     RefCount<RT> request;
-
-private:
-    CBDATA_CLASS2(IoResult);
 };
 
 template <class RT>
index dded3873ee49a4d05803b5d3c9c93225f2530908..0bddd239e7632d02f1d90e2c3d681d5eebed03ae 100644 (file)
@@ -57,6 +57,7 @@ class IpcIoPendingRequest;
 
 class IpcIoFile: public DiskFile
 {
+    CBDATA_CLASS(IpcIoFile);
 
 public:
     typedef RefCount<IpcIoFile> Pointer;
@@ -143,8 +144,6 @@ private:
 
     /// whether we are waiting for an event to handle still queued I/O requests
     static bool DiskerHandleMoreRequestsScheduled;
-
-    CBDATA_CLASS2(IpcIoFile);
 };
 
 /// keeps original I/O request parameters while disker is handling the request
index dc14f52cdea1135198149e50905a4db67743ef1d..b473bf8a863b960a514e730fd75cfb8d00ae8c1f 100644 (file)
@@ -15,6 +15,7 @@
 
 class MmappedFile : public DiskFile
 {
+    CBDATA_CLASS(MmappedFile);
 
 public:
     MmappedFile(char const *path);
@@ -45,8 +46,6 @@ private:
     bool error_;
 
     void doClose();
-
-    CBDATA_CLASS2(MmappedFile);
 };
 
 #endif /* SQUID_MMAPPEDFILE_H */
index c337666976dce3d40a06ad44b6b30889a603398b..bbd8e3d67bc1c5f73078b2776b1ead6988b88753 100644 (file)
@@ -14,6 +14,7 @@
 
 class ReadRequest : public RefCountable
 {
+    CBDATA_CLASS(ReadRequest);
 
 public:
     typedef RefCount<ReadRequest> Pointer;
@@ -23,9 +24,6 @@ public:
     char *buf;
     off_t offset;
     size_t len;
-
-private:
-    CBDATA_CLASS2(ReadRequest);
 };
 
 #endif /* SQUID_READREQUEST_H */
index bb56478d0389ace097973718ac1d6cb50fb6993f..3ae936546824c3ba23d9270b04c6c5bf4c149710 100644 (file)
@@ -14,6 +14,7 @@
 
 class WriteRequest : public RefCountable
 {
+    CBDATA_CLASS(WriteRequest);
 
 public:
     typedef RefCount<WriteRequest> Pointer;
@@ -24,9 +25,6 @@ public:
     off_t offset;
     size_t len;
     FREE *free_func;
-
-private:
-    CBDATA_CLASS2(WriteRequest);
 };
 
 #endif /* SQUID_WRITEREQUEST_H */
index e8ca030c452427edf10bc5c0b418afe30378aa01..b7bead3ffdcbb8b322454668678446a99b91a292 100644 (file)
@@ -57,6 +57,8 @@ class HelperReply;
 
 class FwdState : public RefCountable
 {
+    CBDATA_CLASS(FwdState);
+
 public:
     typedef RefCount<FwdState> Pointer;
     ~FwdState();
@@ -153,9 +155,6 @@ private:
     /// possible pconn race states
     typedef enum { raceImpossible, racePossible, raceHappened } PconnRace;
     PconnRace pconnRace; ///< current pconn race state
-
-    // NP: keep this last. It plays with private/public
-    CBDATA_CLASS2(FwdState);
 };
 
 void getOutgoingAddress(HttpRequest * request, Comm::ConnectionPointer conn);
index b652ad25492da234512f2bc4b56dedbff1b4d685..337c53b4a36f2a00f9557228d7c5639d59176766 100644 (file)
@@ -18,6 +18,8 @@
  */
 class MemBuf
 {
+    CBDATA_CLASS(MemBuf);
+
 public:
     MemBuf():
         buf(NULL),
@@ -155,9 +157,6 @@ public:
 
     unsigned valid:1;          /* to be used for debugging only! */
 #endif
-
-private:
-    CBDATA_CLASS2(MemBuf);
 };
 
 /** returns free() function to be used, _freezes_ the object! */
index 9fabde9cc9503fa1c3e42cfb4f7c99d25dbbf9fb..6e2de11a3366471d2c1583495cde93103dce93c2 100644 (file)
@@ -70,6 +70,7 @@ public:
 
 class PeerDigest
 {
+    CBDATA_CLASS(PeerDigest);
 
 public:
     CachePeer *peer;          /**< pointer back to peer structure, argh */
@@ -104,9 +105,6 @@ public:
             kb_t kbytes;
         } sent, recv;
     } stats;
-
-private:
-    CBDATA_CLASS2(PeerDigest);
 };
 
 extern const Version CacheDigestVer;
index 323b587d56621dad5d758cf35f2dbff849098696..6fa33a7e32a28539e5646af6b34924e9ff13e68c 100644 (file)
@@ -26,6 +26,8 @@ class PeerConnectorAnswer;
 /// Maintains an fixed-size "standby" PconnPool for a single CachePeer.
 class PeerPoolMgr: public AsyncJob
 {
+    CBDATA_CLASS(PeerPoolMgr);
+
 public:
     typedef CbcPointer<PeerPoolMgr> Pointer;
 
@@ -70,8 +72,6 @@ private:
     AsyncCall::Pointer securer; ///< whether we are securing a connection
     AsyncCall::Pointer closer; ///< monitors conn while we are securing it
     unsigned int addrUsed; ///< counter for cycling through peer addresses
-
-    CBDATA_CLASS2(PeerPoolMgr);
 };
 
 #endif /* SQUID_PEERPOOLMGR_H */
index 78ec00a74e719f6c87c47c09fcb2dbebd947fd47..d18b3e83a89c45003540189e9213113eb05a62a4 100644 (file)
@@ -45,6 +45,7 @@ public:
 
 class ps_state
 {
+    CBDATA_CLASS(ps_state);
 
 public:
     ps_state();
@@ -86,8 +87,6 @@ public:
     peer_t hit_type;
     ping_data ping;
     ACLChecklist *acl_checklist;
-private:
-    CBDATA_CLASS2(ps_state);
 };
 
 #endif /* SQUID_PEERSELECTSTATE_H */
index 8c40002ebf713d183f37fd352287b1759aa531d7..d4d35ce07662c8a6a8d61757e3d0ceae0faf6a5d 100644 (file)
@@ -35,6 +35,8 @@ public:
 
 class RemovalPolicy
 {
+    CBDATA_CLASS(RemovalPolicy);
+
 public:
     const char *_type;
     void *_data;
@@ -46,31 +48,29 @@ public:
     RemovalPolicyWalker *(*WalkInit) (RemovalPolicy * policy);
     RemovalPurgeWalker *(*PurgeInit) (RemovalPolicy * policy, int max_scan);
     void (*Stats) (RemovalPolicy * policy, StoreEntry * entry);
-private:
-    CBDATA_CLASS2(RemovalPolicy);
 };
 
 class RemovalPolicyWalker
 {
+    CBDATA_CLASS(RemovalPolicyWalker);
+
 public:
     RemovalPolicy *_policy;
     void *_data;
     const StoreEntry *(*Next) (RemovalPolicyWalker * walker);
     void (*Done) (RemovalPolicyWalker * walker);
-private:
-    CBDATA_CLASS2(RemovalPolicyWalker);
 };
 
 class RemovalPurgeWalker
 {
+    CBDATA_CLASS(RemovalPurgeWalker);
+
 public:
     RemovalPolicy *_policy;
     void *_data;
     int scanned, max_scan, locked;
     StoreEntry *(*Next) (RemovalPurgeWalker * walker);
     void (*Done) (RemovalPurgeWalker * walker);
-private:
-    CBDATA_CLASS2(RemovalPurgeWalker);
 };
 
 RemovalPolicy *createRemovalPolicy(RemovalPolicySettings * settings);
index 7fd869adcdf5ace554deba214e2c0d3f205f714a..28c37d7d1ed8a8f73447413baf5b3df578c596dd 100644 (file)
@@ -34,6 +34,7 @@ public:
 
 class store_client
 {
+    CBDATA_CLASS(store_client);
 
 public:
     store_client(StoreEntry *);
@@ -97,9 +98,6 @@ public:
         STCB *callback_handler;
         void *callback_data;
     } _callback;
-
-private:
-    CBDATA_CLASS2(store_client);
 };
 
 void storeClientCopy(store_client *, StoreEntry *, StoreIOBuffer, STCB *, void *);
index 1ad74a6a3d8717681f144c514ee7d4a9700019d5..5d0a646afed8e6236ffbd40ef3fa139d77bcdacb 100644 (file)
@@ -70,6 +70,7 @@ class StoreHashIndexEntry : public StoreEntry
 
 class StoreSearchHashIndex : public StoreSearch
 {
+    CBDATA_CLASS(StoreSearchHashIndex);
 
 public:
     StoreSearchHashIndex(RefCount<StoreHashIndex> sd);
@@ -95,9 +96,6 @@ private:
     bool _done;
     int bucket;
     std::vector<StoreEntry *> entries;
-
-    // keep this last. it plays with private/public
-    CBDATA_CLASS2(StoreSearchHashIndex);
 };
 
 #endif /* SQUID_STOREHASHINDEX_H */
index b8a79bd706509241eb7a8c0ffb52b02b58b8d163..10cc067cee58708c7f68b653fe4301bd3c21e88d 100644 (file)
@@ -67,6 +67,8 @@ struct as_info {
 
 class ASState
 {
+    CBDATA_CLASS(ASState);
+
 public:
     ASState();
     ~ASState();
@@ -79,8 +81,6 @@ public:
     int reqofs;
     char reqbuf[AS_REQBUF_SZ];
     bool dataRead;
-private:
-    CBDATA_CLASS2(ASState);
 };
 
 CBDATA_CLASS_INIT(ASState);
index 3b40a12350bcd3257396bd8926183989cd9b2cbd..fe5be227110b7ebf92d45db069f84c2f39f95399 100644 (file)
@@ -28,9 +28,12 @@ class HttpReply;
 
 /** \ingroup ACLAPI
     ACLChecklist filled with specific data, representing Squid and transaction
-    state for access checks along with some data-specific checking methods */
+    state for access checks along with some data-specific checking methods
+ */
 class ACLFilledChecklist: public ACLChecklist
 {
+    CBDATA_CLASS(ACLFilledChecklist);
+
 public:
     ACLFilledChecklist();
     ACLFilledChecklist(const acl_access *, HttpRequest *, const char *ident);
@@ -97,8 +100,6 @@ private:
     ACLFilledChecklist(const ACLFilledChecklist &);
     /// not implemented; will cause link failures if used
     ACLFilledChecklist &operator=(const ACLFilledChecklist &);
-
-    CBDATA_CLASS2(ACLFilledChecklist);
 };
 
 /// convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*>
index 5b7a6b39f3f2aaf92e0ebbc5920cc44f9440b1ac..339b1acc18d83af505c775ae4bc68ecc0222276b 100644 (file)
@@ -19,6 +19,10 @@ namespace Acl
 /// unique properties: cbdata protection and optional rule actions.
 class Tree: public OrNode
 {
+    // XXX: We should use refcounting instead, but it requires making ACLs
+    // refcounted as well. Otherwise, async lookups will reach deleted ACLs.
+    CBDATA_CLASS(Tree);
+
 public:
     /// dumps <name, action, rule, new line> tuples
     /// action.kind is mapped to a string using the supplied conversion table
@@ -41,11 +45,6 @@ protected:
     /// if not empty, contains actions corresponding to InnerNode::nodes
     typedef std::vector<allow_t> Actions;
     Actions actions;
-
-private:
-    // XXX: We should use refcounting instead, but it requires making ACLs
-    // refcounted as well. Otherwise, async lookups will reach deleted ACLs.
-    CBDATA_CLASS2(Tree);
 };
 
 } // namespace Acl
index 5f3104808b8f4370a59220c15d2af37d65ba2312..15735b2eb58edfd5c446e270f7e594e538356aeb 100644 (file)
@@ -29,6 +29,8 @@ class AccessRule;
 // checks adaptation_access rules to find a matching adaptation service
 class AccessCheck: public virtual AsyncJob
 {
+    CBDATA_CLASS(AccessCheck);
+
 public:
     typedef void AccessCheckCallback(ServiceGroupPointer group, void *data);
 
@@ -67,9 +69,6 @@ protected:
 
     bool usedDynamicRules();
     void check();
-
-private:
-    CBDATA_CLASS2(AccessCheck);
 };
 
 } // namespace Adaptation
index 60e085ecc9a2d926a1d982bf1d9fd7d180c3c7db..11c49e8607ba8125672bd67734b2954f12fea4e6 100644 (file)
@@ -32,6 +32,8 @@ namespace Adaptation
 /// iterates services in ServiceGroup, starting adaptation launchers
 class Iterator: public Initiate, public Initiator
 {
+    CBDATA_CLASS(Iterator);
+
 public:
     Iterator(HttpMsg *virginHeader, HttpRequest *virginCause,
              AccessLogEntry::Pointer &alp,
@@ -71,8 +73,6 @@ protected:
     CbcPointer<Adaptation::Initiate> theLauncher; ///< current transaction launcher
     int iterations; ///< number of steps initiated
     bool adapted; ///< whether the virgin message has been replaced
-
-    CBDATA_CLASS2(Iterator);
 };
 
 } // namespace Adaptation
index 4a74d78cbb4abe14fc30b9fc3e535b146fb5c2f0..5601636f17c7b30931a13e21eb8e0bf2849358ed 100644 (file)
@@ -32,6 +32,8 @@ namespace Ecap
 class XactionRep : public Adaptation::Initiate, public libecap::host::Xaction,
         public BodyConsumer, public BodyProducer
 {
+    CBDATA_CLASS(XactionRep);
+
 public:
     XactionRep(HttpMsg *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, const Adaptation::ServicePointer &service);
     virtual ~XactionRep();
@@ -69,7 +71,7 @@ public:
     virtual void noteBodyProductionEnded(RefCount<BodyPipe> bp);
     virtual void noteBodyProducerAborted(RefCount<BodyPipe> bp);
 
-    //  Initiate API
+    // Initiate API
     virtual void noteInitiatorAborted();
 
     // AsyncJob API (via Initiate)
@@ -121,8 +123,6 @@ private:
     bool abProductionFinished; // whether adapter has finished producing ab
     bool abProductionAtEnd;    // whether adapter produced a complete ab
     AccessLogEntry::Pointer al; ///< Master transaction AccessLogEntry
-
-    CBDATA_CLASS2(XactionRep);
 };
 
 } // namespace Ecap
index b47c16050c597f4a7041a2c4a45bf2d269825c9a..78d18db6215fb00cfba75f9713d424c9d5dc7be4 100644 (file)
@@ -108,6 +108,7 @@ private:
 
 class ModXact: public Xaction, public BodyProducer, public BodyConsumer
 {
+    CBDATA_CLASS(ModXact);
 
 public:
     ModXact(HttpMsg *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, ServiceRep::Pointer &s);
@@ -316,13 +317,14 @@ private:
     } state;
 
     AccessLogEntry::Pointer alMaster; ///< Master transaction AccessLogEntry
-    CBDATA_CLASS2(ModXact);
 };
 
 // An Launcher that stores ModXact construction info and
 // creates ModXact when needed
 class ModXactLauncher: public Launcher
 {
+    CBDATA_CLASS(ModXactLauncher);
+
 public:
     ModXactLauncher(HttpMsg *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, Adaptation::ServicePointer s);
 
@@ -337,9 +339,6 @@ protected:
     InOut virgin;
 
     AccessLogEntry::Pointer al;
-
-private:
-    CBDATA_CLASS2(ModXactLauncher);
 };
 
 } // namespace Icap
index d16dd0bd151fc73fade926895d6697cbb17bf915..e6b0f3b5a9c34b059228e51ade189fc582579151 100644 (file)
@@ -24,6 +24,7 @@ namespace Icap
 
 class OptXact: public Xaction
 {
+    CBDATA_CLASS(OptXact);
 
 public:
     OptXact(ServiceRep::Pointer &aService);
@@ -46,22 +47,19 @@ private:
     virtual void finalizeLogInfo();
 
     bool readAll; ///< read the entire OPTIONS response
-
-    CBDATA_CLASS2(OptXact);
 };
 
 // An Launcher that stores OptXact construction info and
 // creates OptXact when needed
 class OptXactLauncher: public Launcher
 {
+    CBDATA_CLASS(OptXactLauncher);
+
 public:
     OptXactLauncher(Adaptation::ServicePointer aService);
 
 protected:
     virtual Xaction *createXaction();
-
-private:
-    CBDATA_CLASS2(OptXactLauncher);
 };
 
 } // namespace Icap
index bb2723238d7b84a6f4c691cb4bfbd9ba1b4fc5dc..27c4824da8967c2028640b608245fdeb1113a186 100644 (file)
@@ -59,6 +59,7 @@ class OptXact;
 class ServiceRep : public RefCountable, public Adaptation::Service,
         public Adaptation::Initiator
 {
+    CBDATA_CLASS(ServiceRep);
 
 public:
     typedef RefCount<ServiceRep> Pointer;
@@ -182,7 +183,6 @@ private:
 
     mutable bool wasAnnouncedUp; // prevent sequential same-state announcements
     bool isDetached;
-    CBDATA_CLASS2(ServiceRep);
 };
 
 class ModXact;
index 756484d8de578ff594975663780ef1366c78c694..f9c051358e24e58deb83c78dc25e0d21d24fd5d7 100644 (file)
@@ -164,7 +164,6 @@ protected:
 
 private:
     Comm::ConnOpener *cs;
-    //CBDATA_CLASS2(Xaction);
 };
 
 } // namespace Icap
index f33c38b0f8fb5722a83adfd60738b8083dd30e78..6be0965ef4fe1d7a343ec28cd282611893163351 100644 (file)
@@ -22,6 +22,8 @@ namespace Auth
  */
 class StateData
 {
+    CBDATA_CLASS(StateData);
+
 public:
     StateData(const UserRequest::Pointer &r, AUTHCB *h, void *d) :
             data(cbdataReference(d)),
@@ -36,9 +38,6 @@ public:
     void *data;
     UserRequest::Pointer auth_user_request;
     AUTHCB *handler;
-
-private:
-    CBDATA_CLASS2(StateData);
 };
 
 } // namespace Auth
index 145f81242d8ba170c36015332cbd44d3edd9ab23..062109da6f098a73426d3e8e1429eecbecb5cec4 100644 (file)
@@ -38,7 +38,7 @@ class AsyncCallQueue;
 
 /**
  \todo add unique call IDs
- \todo CBDATA_CLASS2 kids
+ \todo CBDATA_CLASS kids
  \ingroup AsyncCallsAPI
  */
 class AsyncCall: public RefCountable
index 382a68fec8f705ca616e06155a75aae9179dd078..48882fb00e784d7e81ce33c87424e46bc6400382 100644 (file)
@@ -259,11 +259,7 @@ cbdataRegisterWithCacheManager(void)
 }
 
 void *
-#if USE_CBDATA_DEBUG
-cbdataInternalAllocDbg(cbdata_type type, const char *file, int line)
-#else
-cbdataInternalAlloc(cbdata_type type)
-#endif
+cbdataInternalAlloc(cbdata_type type, const char *file, int line)
 {
     cbdata *c;
     void *p;
@@ -302,11 +298,7 @@ cbdataInternalAlloc(cbdata_type type)
 }
 
 void *
-#if USE_CBDATA_DEBUG
-cbdataInternalFreeDbg(void *p, const char *file, int line)
-#else
-cbdataInternalFree(void *p)
-#endif
+cbdataInternalFree(void *p, const char *file, int line)
 {
     cbdata *c;
 #if HASHED_CBDATA
index af6bafb30fbefd0eb47d653de37d8ed35832d134..c4fa4f2dbb4260a96fa953658af53e74037cdf2b 100644 (file)
  *
  \par
  *     To add new module specific data types to the allocator one uses the
- *     macro CBDATA_CLASS2() in the class private section, and CBDATA_CLASS_INIT()
+ *     macro CBDATA_CLASS() in the class private section, and CBDATA_CLASS_INIT()
  *      or CBDATA_NAMESPACED_CLASS_INIT() in the .cc file.
  *      This creates new(), delete() and toCbdata() methods
  *     definition in class scope. Any allocate calls must be made with
@@ -177,86 +177,41 @@ static const cbdata_type CBDATA_UNKNOWN = 0;
 /// \ingroup CBDATAAPI
 void cbdataRegisterWithCacheManager(void);
 
-#if USE_CBDATA_DEBUG
-void *cbdataInternalAllocDbg(cbdata_type type, const char *, int);
-void *cbdataInternalFreeDbg(void *p, const char *, int);
-void cbdataInternalLockDbg(const void *p, const char *, int);
-void cbdataInternalUnlockDbg(const void *p, const char *, int);
-int cbdataInternalReferenceDoneValidDbg(void **p, void **tp, const char *, int);
-#else
-
-/// \ingroup CBDATAAPI
-void *cbdataInternalAlloc(cbdata_type type);
-
-/// \ingroup CBDATAAPI
-void *cbdataInternalFree(void *p);
-
-/// \ingroup CBDATAAPI
-void cbdataInternalLock(const void *p);
-
-/// \ingroup CBDATAAPI
-void cbdataInternalUnlock(const void *p);
-
-/// \ingroup CBDATAAPI
-int cbdataInternalReferenceDoneValid(void **p, void **tp);
-
-#endif /* !CBDATA_DEBUG */
-
 /**
- \ingroup CBDATAAPI
- *
- \param p      A cbdata entry reference pointer.
- *
- \retval 0     A reference is stale. The pointer refers to a entry freed by cbdataFree().
- \retval true  The reference is valid and active.
- */
-int cbdataReferenceValid(const void *p);
-
-/// \ingroup CBDATAAPI
-cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size, FREE * free_func);
-
-/* cbdata macros */
-#if USE_CBDATA_DEBUG
-#define cbdataAlloc(type)      ((type *)cbdataInternalAllocDbg(CBDATA_##type,__FILE__,__LINE__))
-#define cbdataFree(var)                do {if (var) {cbdataInternalFreeDbg(var,__FILE__,__LINE__); var = NULL;}} while(0)
-#define cbdataInternalLock(a)          cbdataInternalLockDbg(a,__FILE__,__LINE__)
-#define cbdataInternalUnlock(a)                cbdataInternalUnlockDbg(a,__FILE__,__LINE__)
-#define cbdataReferenceValidDone(var, ptr) cbdataInternalReferenceDoneValidDbg((void **)&(var), (ptr), __FILE__,__LINE__)
-#define CBDATA_CLASS2(type)    \
-       private: \
-       static cbdata_type CBDATA_##type; \
-       public: \
-               void *operator new(size_t size) { \
-                 assert(size == sizeof(type)); \
-                 if (!CBDATA_##type) \
-                      CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type), NULL); \
-                 return cbdataInternalAllocDbg(CBDATA_##type,__FILE__,__LINE__); \
-               } \
-               void operator delete (void *address) { \
-                 if (address) cbdataInternalFreeDbg(address,__FILE__,__LINE__); \
-               } \
-                void *toCbdata() { return this; }
-#else /* USE_CBDATA_DEBUG */
-
-/**
- \ingroup CBDATAAPI
  * Allocates a new entry of a registered CBDATA type.
+ * \deprecated use CBDATA_CLASS() instead
  */
-#define cbdataAlloc(type) ((type *)cbdataInternalAlloc(CBDATA_##type))
+void *cbdataInternalAlloc(cbdata_type type, const char *, int);
+/// \deprecated use CBDATA_CLASS() instead
+#define cbdataAlloc(type) ((type *)cbdataInternalAlloc(CBDATA_##type,__FILE__,__LINE__))
 
 /**
- \ingroup CBDATAAPI
- \par
- *    Frees a entry allocated by cbdataAlloc().
+ * Frees a entry allocated by cbdataAlloc().
  *
  \note  If there are active references to the entry then the entry
  *      will be freed with the last reference is removed. However,
  *      cbdataReferenceValid() will return false for those references.
+ * \deprecated use CBDATA_CLASS() instead
  */
-#define cbdataFree(var)                do {if (var) {cbdataInternalFree(var); var = NULL;}} while(0)
+void *cbdataInternalFree(void *p, const char *, int);
+/// \deprecated use CBDATA_CLASS() instead
+#define cbdataFree(var)                do {if (var) {cbdataInternalFree(var,__FILE__,__LINE__); var = NULL;}} while(0)
+
+#if USE_CBDATA_DEBUG
+void cbdataInternalLockDbg(const void *p, const char *, int);
+#define cbdataInternalLock(a)          cbdataInternalLockDbg(a,__FILE__,__LINE__)
+
+void cbdataInternalUnlockDbg(const void *p, const char *, int);
+#define cbdataInternalUnlock(a)                cbdataInternalUnlockDbg(a,__FILE__,__LINE__)
+
+int cbdataInternalReferenceDoneValidDbg(void **p, void **tp, const char *, int);
+#define cbdataReferenceValidDone(var, ptr) cbdataInternalReferenceDoneValidDbg((void **)&(var), (ptr), __FILE__,__LINE__)
+
+#else
+void cbdataInternalLock(const void *p);
+void cbdataInternalUnlock(const void *p);
 
 /**
- \ingroup CBDATAAPI
  * Removes a reference created by cbdataReference() and checks
  * it for validity. Meant to be used on the last dereference,
  * usually to make a callback.
@@ -271,31 +226,42 @@ cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size,
  \param var    The reference variable. Will be automatically cleared to NULL.
  \param ptr    A temporary pointer to the referenced data (if valid).
  */
+int cbdataInternalReferenceDoneValid(void **p, void **tp);
 #define cbdataReferenceValidDone(var, ptr) cbdataInternalReferenceDoneValid((void **)&(var), (ptr))
 
+#endif /* !CBDATA_DEBUG */
+
 /**
- * \ingroup CBDATAAPI
+ * \param p    A cbdata entry reference pointer.
  *
- * This needs to be defined LAST in the class definition. It plays with private/public states in C++.
+ * \retval 0   A reference is stale. The pointer refers to a entry freed by cbdataFree().
+ * \retval true        The reference is valid and active.
  */
-#define CBDATA_CLASS2(type)    \
-       private: \
-       static cbdata_type CBDATA_##type; \
+int cbdataReferenceValid(const void *p);
+
+/// \ingroup CBDATAAPI
+cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size, FREE * free_func);
+
+/**
+ * This needs to be defined FIRST in the class definition.
+ * It plays with private/public states in C++.
+ */
+#define CBDATA_CLASS(type)     \
        public: \
                void *operator new(size_t size) { \
                  assert(size == sizeof(type)); \
                  if (!CBDATA_##type) \
                       CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type), NULL); \
-                 return (type *)cbdataInternalAlloc(CBDATA_##type); \
+                 return (type *)cbdataInternalAlloc(CBDATA_##type,__FILE__,__LINE__); \
                } \
                void operator delete (void *address) { \
-                 if (address) cbdataInternalFree(address);\
+                 if (address) cbdataInternalFree(address,__FILE__,__LINE__);\
                } \
-                void *toCbdata() { return this; }
-#endif /* !CBDATA_DEBUG */
+                void *toCbdata() { return this; } \
+       private: \
+       static cbdata_type CBDATA_##type;
 
 /**
- \ingroup CBDATAAPI
  \par
  *    Creates a new reference to a cbdata entry. Used when you need to
  *    store a reference in another structure. The reference can later
@@ -322,13 +288,13 @@ cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size,
 #define CBDATA_NAMESPACED_CLASS_INIT(namespace, type) cbdata_type namespace::type::CBDATA_##type = CBDATA_UNKNOWN
 
 /**
- \ingroup CBDATAAPI
  * Macro that defines a new cbdata datatype. Similar to a variable
  * or struct definition. Scope is always local to the file/block
  * where it is defined and all calls to cbdataAlloc() for this type
  * must be within the same scope as the CBDATA_TYPE declaration.
  * Allocated entries may be referenced or freed anywhere with no
  * restrictions on scope.
+ * \deprecated Use CBDATA_CLASS() instead
  */
 #define CBDATA_TYPE(type)      static cbdata_type CBDATA_##type = CBDATA_UNKNOWN
 
@@ -346,14 +312,14 @@ cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size,
 #define CBDATA_INIT_TYPE_FREECB(type, free_func) do { if (!CBDATA_##type) CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type), free_func); } while (false)
 
 /**
- \ingroup CBDATAAPI
- *
  * Initializes the cbdatatype. Must be called prior to the first use of cbdataAlloc() for the type.
  *
  \par
  * Alternative to CBDATA_INIT_TYPE_FREECB()
  *
  \param type           Type being initialized
+ *
+ * \deprecated Use CBDATA_CLASS() instead
  */
 #define CBDATA_INIT_TYPE(type) CBDATA_INIT_TYPE_FREECB(type, NULL)
 
@@ -366,6 +332,8 @@ cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size,
  */
 class generic_cbdata
 {
+    CBDATA_CLASS(generic_cbdata);
+
 public:
 
     generic_cbdata(void * aData) : data(aData) {}
@@ -383,9 +351,6 @@ public:
      \todo CODE: make this a private field.
      */
     void *data; /* the wrapped data */
-
-private:
-    CBDATA_CLASS2(generic_cbdata);
 };
 
 #endif /* SQUID_CBDATA_H */
index ca59a36a888c9b674974b0da857e0770ed5f7102..fc6c1a8825803fb61866a508ee0d7a078aff4eab 100644 (file)
@@ -67,6 +67,7 @@ class PortCfg;
  */
 class ClientSocketContext : public RefCountable
 {
+    CBDATA_CLASS(ClientSocketContext);
 
 public:
     typedef RefCount<ClientSocketContext> Pointer;
@@ -144,8 +145,6 @@ private:
 
     bool mayUseConnection_; /* This request may use the connection. Don't read anymore requests for now */
     bool connRegistered_;
-
-    CBDATA_CLASS2(ClientSocketContext);
 };
 
 class ConnectionDetail;
index 8b88bc247961f13a3daca6f06d7b043b8dc90ec0..b1c7d80720bce79dd2ff847de0e356c681668edd 100644 (file)
@@ -21,6 +21,7 @@ class ErrorState;
 
 class clientReplyContext : public RefCountable, public StoreClient
 {
+    CBDATA_CLASS(clientReplyContext);
 
 public:
     static STCB CacheHit;
@@ -132,8 +133,6 @@ private:
     StoreEntry *old_entry;
     store_client *old_sc;      /* ... for entry to be validated */
     bool deleting;
-
-    CBDATA_CLASS2(clientReplyContext);
 };
 
 #endif /* SQUID_CLIENTSIDEREPLY_H */
index c8d2cd80d8202f0b9ee3960401f79add3c1d2e6e..d448265e9704ce0cf5ea02db2dd0befb9cd5740c 100644 (file)
@@ -35,6 +35,7 @@ class ClientHttpRequest
         public BodyConsumer     // to receive reply bodies in request satisf. mode
 #endif
 {
+    CBDATA_CLASS(ClientHttpRequest);
 
 public:
     ClientHttpRequest(ConnStateData *csd);
@@ -167,9 +168,6 @@ private:
     bool request_satisfaction_mode;
     int64_t request_satisfaction_offset;
 #endif
-
-private:
-    CBDATA_CLASS2(ClientHttpRequest);
 };
 
 /* client http based routines */
index 028aa614583d1feadd1ae16a6147c0b8dc6bec25..453cc5d07f4d96ee5c70310e23ecdf43b19d30be 100644 (file)
@@ -91,6 +91,8 @@ public:
 /// FTP client functionality shared among FTP Gateway and Relay clients.
 class Client: public ::Client
 {
+    CBDATA_CLASS(Client);
+
 public:
     explicit Client(FwdState *fwdState);
     virtual ~Client();
@@ -189,8 +191,6 @@ private:
     /// XXX: An old hack for FTP servers like ftp.netscape.com that may not
     /// respond to PASV. Use faster connect timeout instead of read timeout.
     bool shortenReadTimeout;
-
-    CBDATA_CLASS2(Client);
 };
 
 } // namespace Ftp
index 1ce0f7ac848427fc3d64502a5badd7533e98074a..7e605b0df4b0054308770b3358112aa53df3f440 100644 (file)
@@ -92,6 +92,8 @@ typedef void (StateMethod)(Ftp::Gateway *);
 /// converts one or more FTP responses into the final HTTP response.
 class Gateway : public Ftp::Client
 {
+    CBDATA_CLASS(Gateway);
+
 public:
     Gateway(FwdState *);
     virtual ~Gateway();
@@ -169,8 +171,6 @@ private:
     virtual bool mayReadVirginReplyBody() const;
     // BodyConsumer for HTTP: consume request body.
     virtual void handleRequestBodyProducerAborted();
-
-    CBDATA_CLASS2(Gateway);
 };
 
 } // namespace Ftp
index 190595f2668069ace7cabcb4077977f20a438dac..1b62d35ed3e63e03bb16e5e8b75555c06979f655 100644 (file)
@@ -31,6 +31,8 @@ namespace Ftp
 /// and then relaying FTP replies back to our FTP server.
 class Relay: public Ftp::Client
 {
+    CBDATA_CLASS(Relay);
+
 public:
     explicit Relay(FwdState *const fwdState);
     virtual ~Relay();
@@ -95,8 +97,6 @@ protected:
         char *lastReply; ///< last line of reply: reply status plus message
         int replyCode; ///< the reply status
     } savedReply; ///< set and delayed while we are tracking using PWD
-
-    CBDATA_CLASS2(Relay);
 };
 
 } // namespace Ftp
index 238c7aa78e2cd1aa6891caee9ebbd6e88f26b907..49465d36269559c8b3c1fcad4a9f52402dc3b75d 100644 (file)
@@ -24,6 +24,8 @@ namespace Comm
  */
 class ConnOpener : public AsyncJob
 {
+    CBDATA_CLASS(ConnOpener);
+
 protected:
     virtual void start();
     virtual void swanSong();
@@ -85,8 +87,6 @@ private:
         /// [that we can cancel], but it will probably become one eventually.
         bool sleep_;
     } calls_;
-
-    CBDATA_CLASS2(ConnOpener);
 };
 
 }; // namespace Comm
index 2de17bb8dd4a1540a18204ba60f1bc384237c617..f8c45578be1c55606c8672bb0dacf745609f06bd 100644 (file)
@@ -37,6 +37,8 @@ class AcceptLimiter;
  */
 class TcpAcceptor : public AsyncJob
 {
+    CBDATA_CLASS(TcpAcceptor);
+
 public:
     typedef CbcPointer<Comm::TcpAcceptor> Pointer;
 
@@ -102,8 +104,6 @@ private:
     Comm::Flag oldAccept(Comm::ConnectionPointer &details);
     void setListen();
     void handleClosure(const CommCloseCbParams &io);
-
-    CBDATA_CLASS2(TcpAcceptor);
 };
 
 } // namespace Comm
index 561f9eae43ec321d56ff6b2f2e5ce7cb3d358922..3f69e4893db03a8da483fb23dcbeef0780733cc5 100644 (file)
@@ -73,6 +73,8 @@ class MemBuf;
 /// \ingroup ErrorPageAPI
 class ErrorState
 {
+    CBDATA_CLASS(ErrorState);
+
 public:
     ErrorState(err_type type, Http::StatusCode, HttpRequest * request);
     ErrorState(); // not implemented.
@@ -166,8 +168,6 @@ public:
     /// type-specific detail about the transaction error;
     /// overwrites xerrno; overwritten by detail, if any.
     int detailCode;
-private:
-    CBDATA_CLASS2(ErrorState);
 };
 
 /**
index 030c0c2d97cc19c3bf900834068b5e07532ae405..d9091ec4b97b7f758a71861ccf1861d1083361ce 100644 (file)
@@ -22,6 +22,7 @@ class ClientHttpRequest;
 
 class ESIContext : public esiTreeParent, public ESIParserClient
 {
+    CBDATA_CLASS(ESIContext);
 
 public:
     typedef RefCount<ESIContext> Pointer;
@@ -155,8 +156,6 @@ private:
     virtual void parserDefault (const char *s, int len);
     virtual void parserComment (const char *s);
     bool processing;
-
-    CBDATA_CLASS2(ESIContext);
 };
 
 #endif /* SQUID_ESICONTEXT_H */
index 22b0175cb9b8ddeadf4a62d17ef678b86d24ea09..bef8f30768d9564ef6845105dd40f91d69d896ed 100644 (file)
@@ -20,6 +20,7 @@ typedef RefCount<ESIInclude> ESIIncludePtr;
 
 class ESIStreamContext : public RefCountable
 {
+    CBDATA_CLASS(ESIStreamContext);
 
 public:
     typedef RefCount<ESIStreamContext> Pointer;
@@ -30,9 +31,6 @@ public:
     ESIIncludePtr include;
     ESISegment::Pointer localbuffer;
     ESISegment::Pointer buffer;
-
-private:
-    CBDATA_CLASS2(ESIStreamContext);
 };
 
 class ESIInclude : public ESIElement
index 9e1b3b0cfd1555693764483742e6bb10c5fd0783..a5193e03fadf8b8499efe7f80269503036ff9f71 100644 (file)
@@ -18,20 +18,19 @@ class DiskFile;
 namespace Rock
 {
 
-/// \ingroup Rock
 class ReadRequest: public ::ReadRequest
 {
+    CBDATA_CLASS(ReadRequest);
+
 public:
     ReadRequest(const ::ReadRequest &base, const IoState::Pointer &anSio);
     IoState::Pointer sio;
-
-private:
-    CBDATA_CLASS2(ReadRequest);
 };
 
-/// \ingroup Rock
 class WriteRequest: public ::WriteRequest
 {
+    CBDATA_CLASS(WriteRequest);
+
 public:
     WriteRequest(const ::WriteRequest &base, const IoState::Pointer &anSio);
     IoState::Pointer sio;
@@ -44,9 +43,6 @@ public:
 
     /// whether this is the last request for the entry
     bool eof;
-
-private:
-    CBDATA_CLASS2(WriteRequest);
 };
 
 } // namespace Rock
index 07340ae02d5a75ef3fffc508ac4b93a605871be3..30103bd743a20d295e6f76d24e1ddfcf2e9c6305 100644 (file)
@@ -24,6 +24,8 @@ class LoadingEntry;
 /// manages store rebuild process: loading meta information from db on disk
 class Rebuild: public AsyncJob
 {
+    CBDATA_CLASS(Rebuild);
+
 public:
     Rebuild(SwapDir *dir);
     ~Rebuild();
@@ -76,8 +78,6 @@ private:
     StoreRebuildData counts;
 
     static void Steps(void *data);
-
-    CBDATA_CLASS2(Rebuild);
 };
 
 } // namespace Rock
index 2584ef8d6d6f938eccd9e8dd045afb3ce85e5cba..4be3edc0c758f6f52094960a22075a7864804f4a 100644 (file)
@@ -21,9 +21,10 @@ namespace Fs
 namespace Ufs
 {
 
-/// \ingroup UFS
 class RebuildState : public RefCountable
 {
+    CBDATA_CLASS(RebuildState);
+
 public:
     static EVH RebuildStep;
 
@@ -59,7 +60,6 @@ public:
     StoreRebuildData counts;
 
 private:
-    CBDATA_CLASS2(RebuildState);
     void rebuildFromDirectory();
     void rebuildFromSwapLog();
     void rebuildStep();
index e8badcd0e1614781f6d2755ae65af8bf1a307b77..fa9df4739f034b3a02283b19c61de08d91631db9 100644 (file)
@@ -17,9 +17,10 @@ namespace Fs
 namespace Ufs
 {
 
-/// \ingroup UFS
 class StoreSearchUFS : public StoreSearch
 {
+    CBDATA_CLASS(StoreSearchUFS);
+
 public:
     StoreSearchUFS(RefCount<UFSSwapDir> sd);
     virtual ~StoreSearchUFS();
@@ -45,7 +46,6 @@ public:
     RemovalPolicyWalker *walker;
 
 private:
-    CBDATA_CLASS2(StoreSearchUFS);
     /// \bug (callback) should be hidden behind a proper human readable name
     void (callback)(void *cbdata);
     void *cbdata;
index 7095d325f11429e1e70be35e6a5a6cd43f04cbdf..69c5c9eb507bd37dd321823049030f016c8cced1 100644 (file)
@@ -17,9 +17,11 @@ namespace Fs
 {
 namespace Ufs
 {
-/// \ingroup UFS
+
 class UFSStoreState : public StoreIOState, public IORequestor
 {
+    CBDATA_CLASS(UFSStoreState);
+
 public:
     UFSStoreState(SwapDir * SD, StoreEntry * anEntry, STIOCB * callback_, void *callback_data_);
     ~UFSStoreState();
@@ -96,7 +98,6 @@ private:
     void openDone();
     void freePending();
     void doWrite();
-    CBDATA_CLASS2(UFSStoreState);
 };
 
 } //namespace Ufs
index 141aea5ee18fba1761010da66142764f7c30527c..f5634cbaebf047267dfb47659fe6b23f227eb4a2 100644 (file)
@@ -78,6 +78,8 @@
  */
 class GopherStateData
 {
+    CBDATA_CLASS(GopherStateData);
+
 public:
     GopherStateData(FwdState *aFwd) :
         entry(aFwd->entry),
@@ -120,9 +122,6 @@ public:
     Comm::ConnectionPointer serverConn;
     FwdState::Pointer fwd;
     char replybuf[BUFSIZ];
-
-private:
-    CBDATA_CLASS2(GopherStateData);
 };
 
 CBDATA_CLASS_INIT(GopherStateData);
index 16c24a0b684c47affc8dbd4ac95495923b6f9042..074f51ebbab703e4a83c00f4264e8dbd130012b0 100644 (file)
@@ -22,6 +22,8 @@
 
 class helper
 {
+    CBDATA_CLASS(helper);
+
 public:
     inline helper(const char *name) :
             cmdline(NULL),
@@ -52,24 +54,20 @@ public:
         int queue_size;
         int avg_svc_time;
     } stats;
-
-private:
-    CBDATA_CLASS2(helper);
 };
 
 class statefulhelper : public helper
 {
+    CBDATA_CLASS(statefulhelper);
+
 public:
-    inline statefulhelper(const char *name) : helper(name), datapool(NULL), IsAvailable(NULL), OnEmptyQueue(NULL) {};
-    inline ~statefulhelper() {};
+    inline statefulhelper(const char *name) : helper(name), datapool(NULL), IsAvailable(NULL), OnEmptyQueue(NULL) {}
+    inline ~statefulhelper() {}
 
 public:
     MemAllocator *datapool;
     HLPSAVAIL *IsAvailable;
     HLPSONEQ *OnEmptyQueue;
-
-private:
-    CBDATA_CLASS2(statefulhelper);
 };
 
 /**
@@ -132,19 +130,20 @@ class MemBuf;
 
 class helper_server : public HelperServerBase
 {
+    CBDATA_CLASS(helper_server);
+
 public:
     MemBuf *wqueue;
     MemBuf *writebuf;
 
     helper *parent;
     Helper::Request **requests;
-
-private:
-    CBDATA_CLASS2(helper_server);
 };
 
 class helper_stateful_server : public HelperServerBase
 {
+    CBDATA_CLASS(helper_stateful_server);
+
 public:
     /* MemBuf wqueue; */
     /* MemBuf writebuf; */
@@ -153,9 +152,6 @@ public:
     Helper::Request *request;
 
     void *data;                        /* State data used by the calling routines */
-
-private:
-    CBDATA_CLASS2(helper_stateful_server);
 };
 
 /* helper.c */
index a710c366013f836f1366c95e250909828d2af28e..e4606e5e9ac3b89f7223e7c16f8cd5e4288ca7c6 100644 (file)
@@ -19,6 +19,7 @@ class HttpHeader;
 
 class HttpStateData : public Client
 {
+    CBDATA_CLASS(HttpStateData);
 
 public:
     HttpStateData(FwdState *);
@@ -110,8 +111,6 @@ private:
     bool peerSupportsConnectionPinning() const;
 
     ChunkedCodingParser *httpChunkDecoder;
-private:
-    CBDATA_CLASS2(HttpStateData);
 };
 
 int httpCachable(const HttpRequestMethod&);
index 09c42e6bbc0904c5e96ad2fd8d9e1900d5fad257..3169c1ef3a94dea5a87c5f3feffa587c39bdb333 100644 (file)
@@ -38,6 +38,11 @@ typedef struct _IdentClient {
 
 class IdentStateData
 {
+public:
+    hash_link hash;            /* must be first */
+private:
+    CBDATA_CLASS(IdentStateData);
+
 public:
     /* AsyncJob API emulated */
     void deleteThis(const char *aReason);
@@ -46,14 +51,10 @@ public:
     /// notify all waiting IdentClient callbacks
     void notify(const char *result);
 
-    hash_link hash;            /* must be first */
     Comm::ConnectionPointer conn;
     MemBuf queryMsg;  ///< the lookup message sent to IDENT server
     IdentClient *clients;
     char buf[IDENT_BUFSIZE];
-
-private:
-    CBDATA_CLASS2(IdentStateData);
 };
 
 CBDATA_CLASS_INIT(IdentStateData);
index bd90750e2067281c68c26a4c7a1b4e513b07043f..d5ae68190c34e092a2ecff2f313c885a4e947855 100644 (file)
@@ -29,6 +29,8 @@ namespace Ipc
 ///  Coordinates shared activities of Strands (Squid processes or threads)
 class Coordinator: public Port
 {
+    CBDATA_CLASS(Coordinator);
+
 public:
     static Coordinator* Instance();
 
@@ -77,8 +79,6 @@ private:
 private:
     Coordinator(const Coordinator&); // not implemented
     Coordinator& operator =(const Coordinator&); // not implemented
-
-    CBDATA_CLASS2(Coordinator);
 };
 
 } // namespace Ipc
index 212b48ef731aa0e15de33dd7ec1a5f2e9672ee19..93af9b9c011cc5171da659c2cd7f7ad716308847 100644 (file)
@@ -27,6 +27,8 @@ namespace Ipc
  */
 class Forwarder: public AsyncJob
 {
+    CBDATA_CLASS(Forwarder);
+
 public:
     Forwarder(Request::Pointer aRequest, double aTimeout);
     virtual ~Forwarder();
@@ -64,8 +66,6 @@ protected:
     static RequestsMap TheRequestsMap; ///< pending Coordinator requests
 
     static unsigned int LastRequestId; ///< last requestId used
-
-    CBDATA_CLASS2(Forwarder);
 };
 
 } // namespace Ipc
index 4a7a8f0a48f902644c05fee2db127a37d573f11a..c4d1e37dfac71cbccb8acc4ac37b372b975170e3 100644 (file)
@@ -26,6 +26,8 @@ namespace Ipc
 /// aggregating individual strand responses and dumping the result if needed
 class Inquirer: public AsyncJob
 {
+    CBDATA_CLASS(Inquirer);
+
 public:
     Inquirer(Request::Pointer aRequest, const Ipc::StrandCoords& coords, double aTimeout);
     virtual ~Inquirer();
@@ -78,8 +80,6 @@ protected:
     static RequestsMap TheRequestsMap; ///< pending strand requests
 
     static unsigned int LastRequestId; ///< last requestId used
-
-    CBDATA_CLASS2(Inquirer);
 };
 
 } // namespace Ipc
index bf41bbd4a0b25f512c1cf429214270fd54f87c4c..9c16ea2fe44784885106e3a0036d9a1b0c8eb675 100644 (file)
@@ -26,6 +26,8 @@ class StrandCoord;
 /// Receives coordination messages on behalf of its process or thread
 class Strand: public Port
 {
+    CBDATA_CLASS(Strand);
+
 public:
     Strand();
 
@@ -51,8 +53,6 @@ private:
 private:
     Strand(const Strand&); // not implemented
     Strand& operator =(const Strand&); // not implemented
-
-    CBDATA_CLASS2(Strand);
 };
 
 }
index 84be3949d8c5c9798bd734616ec0b4c173f27945..00459173a6426d474a968cb29294a5fe15840e45 100644 (file)
@@ -66,6 +66,8 @@ struct sockaddr_un PathToAddress(const String &pathAddr);
 /// attempts to send an IPC message a few times, with a timeout
 class UdsSender: public UdsOp
 {
+    CBDATA_CLASS(UdsSender);
+
 public:
     UdsSender(const String& pathAddr, const TypedMsgHdr& aMessage);
 
@@ -94,8 +96,6 @@ private:
 private:
     UdsSender(const UdsSender&); // not implemented
     UdsSender& operator= (const UdsSender&); // not implemented
-
-    CBDATA_CLASS2(UdsSender);
 };
 
 void SendMessage(const String& toAddress, const TypedMsgHdr& message);
index 23d594633f9f4d4e6e96ee9df2b69eefe96c632b..7798439c22018ee56e9dd13806b6e641d7547fac 100644 (file)
@@ -26,6 +26,8 @@ namespace Log
  */
 class TcpLogger : public AsyncJob
 {
+    CBDATA_CLASS(TcpLogger);
+
 public:
     typedef CbcPointer<TcpLogger> Pointer;
 
@@ -103,8 +105,6 @@ private:
 
     uint64_t connectFailures; ///< number of sequential connection failures
     uint64_t drops; ///< number of records dropped during the current outage
-
-    CBDATA_CLASS2(TcpLogger);
 };
 
 } // namespace Log
index 6266b0f509be985412faf2e846eefffdf041be75..471334c3cdeaeb5d5139b7cb10bffce0bfebb9ff 100644 (file)
@@ -22,6 +22,8 @@ namespace Mgr
 /// Comm-writes it using parent StoreToCommWriter.
 class ActionWriter: public StoreToCommWriter
 {
+    CBDATA_CLASS(ActionWriter);
+
 public:
     ActionWriter(const Action::Pointer &anAction, const Comm::ConnectionPointer &conn);
 
@@ -31,8 +33,6 @@ protected:
 
 private:
     Action::Pointer action; ///< action that fills the entry
-
-    CBDATA_CLASS2(ActionWriter);
 };
 
 } // namespace Mgr
index 202ab3d2b19f89fe265cbd706302658469f65ab5..10590f412ab9df1b2a12dec4288cf13d6550ed05 100644 (file)
@@ -22,6 +22,8 @@ namespace Mgr
 /// provides Coordinator with a local cache manager response
 class Filler: public StoreToCommWriter
 {
+    CBDATA_CLASS(Filler);
+
 public:
     Filler(const Action::Pointer &anAction, const Comm::ConnectionPointer &conn, unsigned int aRequestId);
 
@@ -33,8 +35,6 @@ protected:
 private:
     Action::Pointer action; ///< action that will run() and sendResponse()
     unsigned int requestId; ///< the ID of the Request we are responding to
-
-    CBDATA_CLASS2(Filler);
 };
 
 } // namespace Mgr
index df4f927d310c42e23f7f98e8e683173b1f04aa99..20d1c5939563488fb4ebcc0607250ed730988f22 100644 (file)
@@ -29,6 +29,8 @@ namespace Mgr
  */
 class Forwarder: public Ipc::Forwarder
 {
+    CBDATA_CLASS(Forwarder);
+
 public:
     Forwarder(const Comm::ConnectionPointer &aConn, const ActionParams &aParams, HttpRequest* aRequest,
               StoreEntry* anEntry);
@@ -51,8 +53,6 @@ private:
     StoreEntry* entry; ///< Store entry expecting the response
     Comm::ConnectionPointer conn; ///< HTTP client connection descriptor
     AsyncCall::Pointer closer; ///< comm_close handler for the HTTP connection
-
-    CBDATA_CLASS2(Forwarder);
 };
 
 } // namespace Mgr
index c786ec81ea581dfae2d2344a941d0ffec1ddb5fb..6ba0f672758d1963e8260dd291b11913281293c2 100644 (file)
@@ -25,6 +25,8 @@ namespace Mgr
 /// aggregating individual strand responses and dumping the result if needed
 class Inquirer: public Ipc::Inquirer
 {
+    CBDATA_CLASS(Inquirer);
+
 public:
     Inquirer(Action::Pointer anAction, const Request &aCause,
              const Ipc::StrandCoords &coords);
@@ -52,8 +54,6 @@ private:
 
     AsyncCall::Pointer writer; ///< comm_write callback
     AsyncCall::Pointer closer; ///< comm_close handler
-
-    CBDATA_CLASS2(Inquirer);
 };
 
 } // namespace Mgr
index 3a07d90dc1a5fe45433fea7e89abd74915098043..fcd140d3fe79031d94ddf9130c777e48da3bcfae 100644 (file)
@@ -27,6 +27,8 @@ namespace Mgr
 /// for the given StoreEntry and client FD
 class StoreToCommWriter: public AsyncJob
 {
+    CBDATA_CLASS(StoreToCommWriter);
+
 public:
     StoreToCommWriter(const Comm::ConnectionPointer &conn, StoreEntry *anEntry);
     virtual ~StoreToCommWriter();
@@ -64,8 +66,6 @@ protected:
 
     AsyncCall::Pointer closer; ///< comm_close handler
     char buffer[HTTP_REQBUF_SZ]; ///< action results; Store fills, Comm writes
-
-    CBDATA_CLASS2(StoreToCommWriter);
 };
 
 } // namespace Mgr
index d94f8cf11c3e4bc823024061c3d75414ae0373f5..eb995dfa3f8942545b01a89c7ae4fc62770c0692 100644 (file)
@@ -22,9 +22,7 @@
 class PconnPool;
 class PeerPoolMgr;
 
-/* for CBDATA_CLASS2() macros */
 #include "cbdata.h"
-/* for hash_link */
 #include "hash.h"
 /* for IOCB */
 #include "comm.h"
@@ -37,6 +35,8 @@ class PeerPoolMgr;
  */
 class IdleConnList
 {
+    CBDATA_CLASS(IdleConnList);
+
 public:
     IdleConnList(const char *key, PconnPool *parent);
     ~IdleConnList();
@@ -92,8 +92,6 @@ private:
     PconnPool *parent_;
 
     char fakeReadBuf_[4096]; // TODO: kill magic number.
-
-    CBDATA_CLASS2(IdleConnList);
 };
 
 #include "ip/forward.h"
index 2932be1184d12e682bdc6934a6f02cfc6d89c799..f13bd7f8f700024bf039b7ced247fd38a62cf386 100644 (file)
@@ -38,6 +38,8 @@
 
 class RedirectStateData
 {
+    CBDATA_CLASS(RedirectStateData);
+
 public:
     explicit RedirectStateData(const char *url);
     ~RedirectStateData();
@@ -46,9 +48,6 @@ public:
     SBuf orig_url;
 
     HLPCB *handler;
-
-private:
-    CBDATA_CLASS2(RedirectStateData);
 };
 
 static HLPCB redirectHandleReply;
index 0d42d51666338c199523e1a111b87eb8afb3a910..bf85cd6294bc63bd9210b9d7d4fce79ce83b8377 100644 (file)
@@ -52,6 +52,8 @@ public:
 /// Manages a control connection from an FTP client.
 class Server: public ConnStateData
 {
+    CBDATA_CLASS(Server);
+
 public:
     explicit Server(const MasterXaction::Pointer &xact);
     virtual ~Server();
@@ -166,8 +168,6 @@ private:
     AsyncCall::Pointer listener; ///< set when we are passively listening
     AsyncCall::Pointer connector; ///< set when we are actively connecting
     AsyncCall::Pointer reader; ///< set when we are reading FTP data
-
-    CBDATA_CLASS2(Server);
 };
 
 } // namespace Ftp
index 50f6abefdf6e24a6e91e02357eef963d6a841ca5..c3523c5223197fab7e8bf830e4356ad403dc267e 100644 (file)
@@ -23,6 +23,8 @@ namespace Http
 /// Manages a connection from an HTTP client.
 class Server: public ConnStateData
 {
+    CBDATA_CLASS(Server);
+
 public:
     Server(const MasterXaction::Pointer &xact, const bool beHttpsServer);
     virtual ~Server() {}
@@ -53,8 +55,6 @@ private:
 
     /// temporary hack to avoid creating a true HttpsServer class
     const bool isHttpsServer;
-
-    CBDATA_CLASS2(Server);
 };
 
 } // namespace Http
index 05a8052118a30715893200b3e35c771249d0c2c9..df3d9bf1f3800ed1ddc8188a9d1f48e1750287a0 100644 (file)
@@ -26,6 +26,8 @@ namespace Snmp
  */
 class Forwarder: public Ipc::Forwarder
 {
+    CBDATA_CLASS(Forwarder);
+
 public:
     Forwarder(const Pdu& aPdu, const Session& aSession, int aFd,
               const Ip::Address& anAddress);
@@ -43,8 +45,6 @@ private:
 private:
     int fd; ///< client connection descriptor
     AsyncCall::Pointer closer; ///< comm_close handler for the connection
-
-    CBDATA_CLASS2(Forwarder);
 };
 
 void SendResponse(unsigned int requestId, const Pdu& pdu);
index f06feb8595ee5878e42645b0dff7636e10f1bdb1..b7313430bb80a5f7843699dd8abdc8c99dacb02d 100644 (file)
@@ -25,6 +25,8 @@ namespace Snmp
 /// aggregates strand responses and send back the result to client
 class Inquirer: public Ipc::Inquirer
 {
+    CBDATA_CLASS(Inquirer);
+
 public:
     Inquirer(const Request& aRequest, const Ipc::StrandCoords& coords);
 
@@ -48,8 +50,6 @@ private:
 
     AsyncCall::Pointer writer; ///< comm_write callback
     AsyncCall::Pointer closer; ///< comm_close handler
-
-    CBDATA_CLASS2(Inquirer);
 };
 
 } // namespace Snmp
index 1f453cdaf6a0b13632c099980aae1da8848ed30a..182dfbfb70574d5d2d5fe81fedfe63f01033be06 100644 (file)
@@ -69,6 +69,8 @@ public:
 */
 class PeerConnector: virtual public AsyncJob
 {
+    CBDATA_CLASS(PeerConnector);
+
 public:
     /// Callback dialier API to allow PeerConnector to set the answer.
     class CbDialer
@@ -171,8 +173,6 @@ private:
     time_t negotiationTimeout; ///< the ssl connection timeout to use
     time_t startTime; ///< when the peer connector negotiation started
     bool splice; ///< Whether we are going to splice or not
-
-    CBDATA_CLASS2(PeerConnector);
 };
 
 std::ostream &operator <<(std::ostream &os, const Ssl::PeerConnectorAnswer &a);
index 23fbceadb26143b9d29ddb4d0b75e6ea50234e3f..6276e6b2459a9d0418af5e19fe45332285518461 100644 (file)
@@ -22,11 +22,12 @@ namespace Ssl
 {
 
 /**
-  \ingroup ServerProtocolSSLAPI
  * Maintains bump-server-first related information.
  */
 class ServerBump
 {
+    CBDATA_CLASS(ServerBump);
+
 public:
     explicit ServerBump(HttpRequest *fakeRequest, StoreEntry *e = NULL, Ssl::BumpMode mode = Ssl::bumpServerFirst);
     ~ServerBump();
@@ -46,8 +47,6 @@ public:
 
 private:
     store_client *sc; ///< dummy client to prevent entry trimming
-
-    CBDATA_CLASS2(ServerBump);
 };
 
 } // namespace Ssl
index 4d8df65ffee04320a83c82151df5868f988f7a3e..23e36955ea71a1c99f12354a8aaba51bdb7cc7f9 100644 (file)
@@ -204,12 +204,15 @@ void Ssl::CertValidationHelper::Shutdown()
     HelperCache = NULL;
 }
 
-struct submitData {
+class submitData
+{
+    CBDATA_CLASS(submitData);
+
+public:
     std::string query;
     Ssl::CertValidationHelper::CVHCB *callback;
     void *data;
     SSL *ssl;
-    CBDATA_CLASS2(submitData);
 };
 CBDATA_CLASS_INIT(submitData);
 
index 545b3bbaac7b2dc789e1262f983bc4995601c7be..feb5c6ef36770c87ab86099f33b644540f1e61d8 100644 (file)
@@ -65,14 +65,12 @@ typedef int STOBJFLT(const StoreEntry *);
 
 class StatObjectsState
 {
+    CBDATA_CLASS(StatObjectsState);
 
 public:
     StoreEntry *sentry;
     STOBJFLT *filter;
     StoreSearchPointer theSearch;
-
-private:
-    CBDATA_CLASS2(StatObjectsState);
 };
 
 /* LOCALS */
index a9651e11ec3536983ad9f20f426b1abbe486a18b..9f282d4bed3ec0a236f8675ef7450144a2b5cc4b 100644 (file)
@@ -61,6 +61,7 @@
  */
 class TunnelStateData
 {
+    CBDATA_CLASS(TunnelStateData);
 
 public:
     TunnelStateData();
@@ -185,7 +186,7 @@ private:
     void connectedToPeer(Ssl::PeerConnectorAnswer &answer);
 #endif
 
-    CBDATA_CLASS2(TunnelStateData);
+public:
     bool keepGoingAfterRead(size_t len, Comm::Flag errcode, int xerrno, Connection &from, Connection &to);
     void copy(size_t len, Connection &from, Connection &to, IOCB *);
     void handleConnectResponse(const size_t chunkSize);
index b9380353360f77ecce4445a578e99add24cc82c2..dc741c82e1a5805e2e1e390ff5f1e8824f5c1705 100644 (file)
@@ -30,6 +30,7 @@
 
 class UrnState : public StoreClient
 {
+    CBDATA_CLASS(UrnState);
 
 public:
     void created (StoreEntry *newEntry);
@@ -56,8 +57,6 @@ public:
 
 private:
     char *urlres;
-
-    CBDATA_CLASS2(UrnState);
 };
 
 typedef struct {
index a5e69f50904c85dc008e28abed3e4281b2ee01fd..7cd4802b16d34a32516f36f3e7b5b775238b2c75 100644 (file)
@@ -27,6 +27,8 @@
 
 class WhoisState
 {
+    CBDATA_CLASS(WhoisState);
+
 public:
     void readReply(const Comm::ConnectionPointer &, char *aBuffer, size_t aBufferLength, Comm::Flag flag, int xerrno);
     void setReplyToOK(StoreEntry *sentry);
@@ -35,9 +37,6 @@ public:
     FwdState::Pointer fwd;
     char buf[BUFSIZ+1];                /* readReply adds terminating NULL */
     bool dataWritten;
-
-private:
-    CBDATA_CLASS2(WhoisState);
 };
 
 CBDATA_CLASS_INIT(WhoisState);