]>
Commit | Line | Data |
---|---|---|
8822ebee AR |
1 | /* |
2 | * $Id$ | |
3 | * | |
4 | * DEBUG: section 16 Cache Manager API | |
5 | * | |
6 | */ | |
7 | ||
8 | #ifndef SQUID_MGR_RESPONSE_H | |
9 | #define SQUID_MGR_RESPONSE_H | |
10 | ||
11 | #include "mgr/Action.h" | |
12 | ||
13 | ||
14 | namespace Mgr | |
15 | { | |
16 | ||
17 | /// A response to Mgr::Request. | |
18 | /// May carry strand action data to be aggregated with data from other strands. | |
19 | class Response | |
20 | { | |
21 | public: | |
22 | Response(unsigned int aRequestId = 0, Action::Pointer anAction = NULL); | |
23 | ||
24 | explicit Response(const Ipc::TypedMsgHdr& msg); ///< from recvmsg() | |
25 | void pack(Ipc::TypedMsgHdr& msg) const; ///< prepare for sendmsg() | |
26 | bool hasAction() const; ///< whether response contain action object | |
27 | const Action& getAction() const; ///< returns action object | |
28 | ||
29 | public: | |
30 | unsigned int requestId; ///< ID of request we are responding to | |
31 | Action::Pointer action; ///< action relating to response | |
32 | }; | |
33 | ||
34 | extern std::ostream& operator <<(std::ostream &os, const Response &response); | |
35 | ||
36 | } // namespace Mgr | |
37 | ||
38 | #endif /* SQUID_MGR_RESPONSE_H */ |