StrandCoord.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2021 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 #ifndef SQUID_IPC_STRAND_COORD_H
10 #define SQUID_IPC_STRAND_COORD_H
11 
12 #include "ipc/forward.h"
13 #include "ipc/Messages.h"
14 #include "ipc/QuestionerId.h"
15 #include "SquidString.h"
16 
17 namespace Ipc
18 {
19 
22 {
23 public:
24  StrandCoord();
25  StrandCoord(int akidId, pid_t aPid);
26 
27  void pack(TypedMsgHdr &hdrMsg) const;
28  void unpack(const TypedMsgHdr &hdrMsg);
29 
30 public:
31  int kidId;
32  pid_t pid;
33 
35 };
36 
39 {
40 public:
41  explicit StrandMessage(const StrandCoord &, QuestionerId);
42  explicit StrandMessage(const TypedMsgHdr &);
43  void pack(MessageType, TypedMsgHdr &) const;
44 
46  static void NotifyCoordinator(MessageType, const char *tag);
47 
49  QuestionerId intendedRecepient() const { return qid; }
50 
51 public:
53 
57 };
58 
59 } // namespace Ipc;
60 
61 #endif /* SQUID_IPC_STRAND_COORD_H */
62 
StrandCoord strand
messageType-specific coordinates (e.g., sender)
Definition: StrandCoord.h:52
int kidId
internal Squid process number
Definition: StrandCoord.h:31
StrandCoord()
unknown location
Definition: StrandCoord.cc:18
static void NotifyCoordinator(MessageType, const char *tag)
creates and sends StrandMessage to Coordinator
Definition: StrandCoord.cc:62
QuestionerId intendedRecepient() const
for Mine() tests
Definition: StrandCoord.h:49
void pack(MessageType, TypedMsgHdr &) const
Definition: StrandCoord.cc:54
void pack(TypedMsgHdr &hdrMsg) const
prepare for sendmsg()
Definition: StrandCoord.cc:34
QuestionerId qid
Definition: StrandCoord.h:56
MessageType
message class identifier
Definition: Messages.h:20
Strand location details.
Definition: StrandCoord.h:22
String tag
optional unique well-known key (e.g., cache_dir path)
Definition: StrandCoord.h:34
an IPC message carrying StrandCoord
Definition: StrandCoord.h:39
struct msghdr with a known type, fixed-size I/O and control buffers
Definition: TypedMsgHdr.h:33
StrandMessage(const StrandCoord &, QuestionerId)
Definition: StrandCoord.cc:41
pid_t pid
OS process or thread identifier.
Definition: StrandCoord.h:32
void unpack(const TypedMsgHdr &hdrMsg)
from recvmsg()
Definition: StrandCoord.cc:27
Definition: IpcIoFile.h:24

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors