]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ipc/Inquirer.h
Source Format Enforcement (#1234)
[thirdparty/squid.git] / src / ipc / Inquirer.h
index d97ea884a56830ecc760442c7914110e92c2a235..56ef3c8c5c1762c49354116e4c7d13dbf3808c02 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -18,7 +18,6 @@
 #include "ipc/Request.h"
 #include "ipc/Response.h"
 #include "ipc/StrandCoords.h"
-#include <map>
 
 namespace Ipc
 {
@@ -27,26 +26,26 @@ namespace Ipc
 /// aggregating individual strand responses and dumping the result if needed
 class Inquirer: public AsyncJob
 {
-    CBDATA_CLASS(Inquirer);
+    CBDATA_INTERMEDIATE();
 
 public:
     Inquirer(Request::Pointer aRequest, const Ipc::StrandCoords& coords, double aTimeout);
-    virtual ~Inquirer();
+    ~Inquirer() override;
 
     /// finds and calls the right Inquirer upon strand's response
     static void HandleRemoteAck(const Response& response);
 
     /* has-to-be-public AsyncJob API */
-    virtual void callException(const std::exception& e);
+    void callException(const std::exception& e) override;
 
     CodeContextPointer codeContext;
 
 protected:
     /* AsyncJob API */
-    virtual void start();
-    virtual void swanSong();
-    virtual bool doneAll() const;
-    virtual const char *status() const;
+    void start() override;
+    void swanSong() override;
+    bool doneAll() const override;
+    const char *status() const override;
 
     /// inquire the next strand
     virtual void inquire();
@@ -60,12 +59,8 @@ protected:
     virtual bool aggregate(Response::Pointer aResponse) = 0;
 
 private:
-    typedef UnaryMemFunT<Inquirer, Response::Pointer, Response::Pointer> HandleAckDialer;
-
     void handleRemoteAck(Response::Pointer response);
 
-    static AsyncCall::Pointer DequeueRequest(RequestId::Index);
-
     static void RequestTimedOut(void* param);
     void requestTimedOut();
     void removeTimeoutEvent();
@@ -78,10 +73,6 @@ protected:
 
     const double timeout; ///< number of seconds to wait for strand response
 
-    /// maps request->id to Inquirer::handleRemoteAck callback
-    typedef std::map<RequestId::Index, AsyncCall::Pointer> RequestsMap;
-    static RequestsMap TheRequestsMap; ///< pending strand requests
-
     static RequestId::Index LastRequestId; ///< last requestId used
 };