Request.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_IPC_REQUEST_H
12#define SQUID_IPC_REQUEST_H
13
14#include "base/RefCount.h"
15#include "base/TypeTraits.h"
16#include "ipc/RequestId.h"
17
18namespace Ipc
19{
20
21// TODO: Request and Response ought to have their own un/pack() methods instead
22// of duplicating their functionality in derived classes. To avoid dependency
23// loops between libipc and libmgr/libsnmp, fixing that requires extracting
24// src/ipc/Coordinator and its friends into a new src/coordinator/ library.
25
27class Request: public RefCountable, public Interface
28{
29public:
31
32public:
33 virtual void pack(TypedMsgHdr& msg) const = 0;
34 virtual Pointer clone() const = 0;
35
36public:
37 int requestorId = 0;
39
40protected:
42 Request(const int aRequestorId, const RequestId aRequestId):
43 requestorId(aRequestorId),
44 requestId(aRequestId)
45 {
46 }
47
49 Request() = default;
50};
51
52} // namespace Ipc
53
54#endif /* SQUID_IPC_REQUEST_H */
55
#define RefCountable
The locking interface for use on Reference-Counted classes.
Definition: Lock.h:66
IPC request.
Definition: Request.h:28
int requestorId
kidId of the requestor; used for response destination
Definition: Request.h:37
Request()=default
recipient's constructor
virtual void pack(TypedMsgHdr &msg) const =0
prepare for sendmsg()
virtual Pointer clone() const =0
returns a copy of this
Request(const int aRequestorId, const RequestId aRequestId)
sender's constructor
Definition: Request.h:42
RefCount< Request > Pointer
Definition: Request.h:30
RequestId requestId
matches the request[or] with the response
Definition: Request.h:38
struct msghdr with a known type, fixed-size I/O and control buffers
Definition: TypedMsgHdr.h:35
convenience base for any class with pure virtual method(s)
Definition: TypeTraits.h:19
Definition: IpcIoFile.h:24

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors