]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/StrandCoord.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / ipc / StrandCoord.h
1 /*
2 * $Id$
3 *
4 */
5
6 #ifndef SQUID_IPC_STRAND_COORD_H
7 #define SQUID_IPC_STRAND_COORD_H
8
9 #include "ipc/forward.h"
10 #include "SquidString.h"
11
12 namespace Ipc
13 {
14
15 /// Strand location details
16 class StrandCoord
17 {
18 public:
19 StrandCoord(); ///< unknown location
20 StrandCoord(int akidId, pid_t aPid);
21
22 void pack(TypedMsgHdr &hdrMsg) const; ///< prepare for sendmsg()
23 void unpack(const TypedMsgHdr &hdrMsg); ///< from recvmsg()
24
25 public:
26 int kidId; ///< internal Squid process number
27 pid_t pid; ///< OS process or thread identifier
28
29 String tag; ///< optional unique well-known key (e.g., cache_dir path)
30 };
31
32 /// strand registration with Coordinator (also used as an ACK)
33 class HereIamMessage
34 {
35 public:
36 explicit HereIamMessage(const StrandCoord &strand); ///< from registrant
37 explicit HereIamMessage(const TypedMsgHdr &hdrMsg); ///< from recvmsg()
38 void pack(TypedMsgHdr &hdrMsg) const; ///< prepare for sendmsg()
39
40 public:
41 StrandCoord strand; ///< registrant coordinates and related details
42 };
43
44 } // namespace Ipc;
45
46 #endif /* SQUID_IPC_STRAND_COORD_H */