]> git.ipfire.org Git - thirdparty/squid.git/blame - src/ipc/Response.h
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / ipc / Response.h
CommitLineData
51ea0904 1/*
f70aedc4 2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
51ea0904 3 *
bbc27441
AJ
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.
51ea0904
CT
7 */
8
bbc27441
AJ
9/* DEBUG: section 54 Interprocess Communication */
10
51ea0904
CT
11#ifndef SQUID_IPC_RESPONSE_H
12#define SQUID_IPC_RESPONSE_H
13
8bf217bd 14#include "base/RefCount.h"
4c218615 15#include "base/TypeTraits.h"
51ea0904 16#include "ipc/forward.h"
4c218615 17#include "ipc/QuestionerId.h"
51ea0904 18
51ea0904
CT
19namespace Ipc
20{
21
22/// A response to Ipc::Request.
4c218615 23class Response: public RefCountable, public Interface
51ea0904
CT
24{
25public:
26 typedef RefCount<Response> Pointer;
27
28public:
51ea0904
CT
29 virtual void pack(TypedMsgHdr& msg) const = 0; ///< prepare for sendmsg()
30 virtual Pointer clone() const = 0; ///< returns a copy of this
31
4c218615
EB
32 /// for Mine() tests
33 QuestionerId intendedRecepient() const { return requestId.questioner(); }
51ea0904
CT
34
35public:
4c218615 36 RequestId requestId; ///< the ID of the request we are responding to
51ea0904 37
4c218615
EB
38protected:
39 /// sender's constructor
40 explicit Response(const RequestId aRequestId): requestId(aRequestId) {}
41
42 /// recipient's constructor
43 Response() = default;
44};
f738d783 45
51ea0904
CT
46} // namespace Ipc
47
48#endif /* SQUID_IPC_RESPONSE_H */
f53969cc 49