]>
Commit | Line | Data |
---|---|---|
10cefb7b | 1 | /* |
2 | * $Id$ | |
3 | * | |
4 | * DEBUG: section 54 Interprocess Communication | |
5 | * | |
6 | */ | |
7 | ||
8 | #ifndef SQUID_IPC_STRAND_H | |
9 | #define SQUID_IPC_STRAND_H | |
10 | ||
10cefb7b | 11 | #include "ipc/Port.h" |
12 | ||
13 | ||
14 | namespace Ipc | |
15 | { | |
16 | ||
1bac0258 | 17 | class StrandCoord; |
7230e9c7 | 18 | class Descriptor; |
10cefb7b | 19 | |
ba568924 AR |
20 | /// Receives coordination messages on behalf of its process or thread |
21 | class Strand: public Port | |
10cefb7b | 22 | { |
10cefb7b | 23 | public: |
24 | Strand(); | |
25 | ||
ba568924 AR |
26 | virtual void start(); // Port (AsyncJob) API |
27 | ||
28 | protected: | |
29 | virtual void timedout(); // Port (UsdOp) API | |
1bac0258 | 30 | virtual void receive(const TypedMsgHdr &message); // Port API |
10cefb7b | 31 | |
32 | private: | |
ba568924 | 33 | void registerSelf(); /// let Coordinator know this strand exists |
1bac0258 | 34 | void handleRegistrationResponse(const StrandCoord &strand); |
7230e9c7 | 35 | void putDescriptor(const Descriptor &message); |
10cefb7b | 36 | |
37 | private: | |
ba568924 | 38 | bool isRegistered; ///< whether Coordinator ACKed registration (unused) |
10cefb7b | 39 | |
ba568924 AR |
40 | private: |
41 | Strand(const Strand&); // not implemented | |
42 | Strand& operator =(const Strand&); // not implemented | |
4ea256cd AR |
43 | |
44 | CBDATA_CLASS2(Strand); | |
10cefb7b | 45 | }; |
46 | ||
47 | ||
48 | } | |
49 | ||
50 | ||
51 | #endif /* SQUID_IPC_STRAND_H */ |