]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/StrandSearch.cc
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / ipc / StrandSearch.cc
1 /*
2 * Copyright (C) 1996-2020 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 #include "squid.h"
12 #include "ipc/Messages.h"
13 #include "ipc/StrandSearch.h"
14 #include "ipc/TypedMsgHdr.h"
15
16 Ipc::StrandSearchRequest::StrandSearchRequest(): requestorId(-1)
17 {
18 }
19
20 Ipc::StrandSearchRequest::StrandSearchRequest(const TypedMsgHdr &hdrMsg):
21 requestorId(-1)
22 {
23 hdrMsg.checkType(mtStrandSearchRequest);
24 hdrMsg.getPod(requestorId);
25 hdrMsg.getString(tag);
26 }
27
28 void Ipc::StrandSearchRequest::pack(TypedMsgHdr &hdrMsg) const
29 {
30 hdrMsg.setType(mtStrandSearchRequest);
31 hdrMsg.putPod(requestorId);
32 hdrMsg.putString(tag);
33 }
34
35 /* StrandSearchResponse */
36
37 Ipc::StrandSearchResponse::StrandSearchResponse(const Ipc::StrandCoord &aStrand):
38 strand(aStrand)
39 {
40 }
41
42 Ipc::StrandSearchResponse::StrandSearchResponse(const TypedMsgHdr &hdrMsg)
43 {
44 hdrMsg.checkType(mtStrandSearchResponse);
45 strand.unpack(hdrMsg);
46 }
47
48 void Ipc::StrandSearchResponse::pack(TypedMsgHdr &hdrMsg) const
49 {
50 hdrMsg.setType(mtStrandSearchResponse);
51 strand.pack(hdrMsg);
52 }
53