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