]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/Response.h
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 54 Interprocess Communication */
11 #ifndef SQUID_IPC_RESPONSE_H
12 #define SQUID_IPC_RESPONSE_H
14 #include "base/RefCount.h"
15 #include "base/TypeTraits.h"
16 #include "ipc/forward.h"
17 #include "ipc/QuestionerId.h"
22 /// A response to Ipc::Request.
23 class Response
: public RefCountable
, public Interface
26 typedef RefCount
<Response
> Pointer
;
29 virtual void pack(TypedMsgHdr
& msg
) const = 0; ///< prepare for sendmsg()
30 virtual Pointer
clone() const = 0; ///< returns a copy of this
33 QuestionerId
intendedRecepient() const { return requestId
.questioner(); }
36 RequestId requestId
; ///< the ID of the request we are responding to
39 /// sender's constructor
40 explicit Response(const RequestId aRequestId
): requestId(aRequestId
) {}
42 /// recipient's constructor
48 #endif /* SQUID_IPC_RESPONSE_H */