]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/Request.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / ipc / Request.h
1 /*
2 * $Id$
3 *
4 * DEBUG: section 54 Interprocess Communication
5 *
6 */
7
8 #ifndef SQUID_IPC_REQUEST_H
9 #define SQUID_IPC_REQUEST_H
10
11 #include "ipc/forward.h"
12 #include "RefCount.h"
13
14 namespace Ipc
15 {
16
17 /// IPC request
18 class Request: public RefCountable
19 {
20 public:
21 typedef RefCount<Request> Pointer;
22
23 public:
24 Request(int aRequestorId, unsigned int aRequestId):
25 requestorId(aRequestorId), requestId(aRequestId) {}
26
27 virtual void pack(TypedMsgHdr& msg) const = 0; ///< prepare for sendmsg()
28 virtual Pointer clone() const = 0; ///< returns a copy of this
29
30 private:
31 Request(const Request&); // not implemented
32 Request& operator= (const Request&); // not implemented
33
34 public:
35 int requestorId; ///< kidId of the requestor; used for response destination
36 unsigned int requestId; ///< unique for sender; matches request w/ response
37 };
38
39 } // namespace Ipc
40
41 #endif /* SQUID_IPC_REQUEST_H */