Response.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3  *
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.
7  */
8 
9 /* DEBUG: section 54 Interprocess Communication */
10 
11 #ifndef SQUID_SRC_IPC_RESPONSE_H
12 #define SQUID_SRC_IPC_RESPONSE_H
13 
14 #include "base/RefCount.h"
15 #include "base/TypeTraits.h"
16 #include "ipc/QuestionerId.h"
17 #include "ipc/RequestId.h"
18 
19 namespace Ipc
20 {
21 
23 class Response: public RefCountable, public Interface
24 {
25 public:
27 
28 public:
29  virtual void pack(TypedMsgHdr& msg) const = 0;
30  virtual Pointer clone() const = 0;
31 
34 
35 public:
37 
38 protected:
40  explicit Response(const RequestId aRequestId): requestId(aRequestId) {}
41 
43  Response() = default;
44 };
45 
46 } // namespace Ipc
47 
48 #endif /* SQUID_SRC_IPC_RESPONSE_H */
49 
A response to Ipc::Request.
Definition: Response.h:23
Response(const RequestId aRequestId)
sender's constructor
Definition: Response.h:40
convenience base for any class with pure virtual method(s)
Definition: TypeTraits.h:18
RequestId requestId
the ID of the request we are responding to
Definition: Response.h:36
QuestionerId intendedRecepient() const
for Mine() tests
Definition: Response.h:33
QuestionerId questioner() const
Definition: RequestId.h:44
struct msghdr with a known type, fixed-size I/O and control buffers
Definition: TypedMsgHdr.h:34
RefCount< Response > Pointer
Definition: Response.h:26
Response()=default
recipient's constructor
virtual void pack(TypedMsgHdr &msg) const =0
prepare for sendmsg()
virtual Pointer clone() const =0
returns a copy of this
Definition: IpcIoFile.h:23

 

Introduction

Documentation

Support

Miscellaneous