]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/Response.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / mgr / Response.h
1 /*
2 * Copyright (C) 1996-2017 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 /* DEBUG: section 16 Cache Manager API */
10
11 #ifndef SQUID_MGR_RESPONSE_H
12 #define SQUID_MGR_RESPONSE_H
13
14 #include "ipc/forward.h"
15 #include "ipc/Response.h"
16 #include "mgr/Action.h"
17
18 namespace Mgr
19 {
20
21 /// A response to Mgr::Request.
22 /// May carry strand action data to be aggregated with data from other strands.
23 class Response: public Ipc::Response
24 {
25 public:
26 Response(unsigned int aRequestId, Action::Pointer anAction = NULL);
27
28 explicit Response(const Ipc::TypedMsgHdr& msg); ///< from recvmsg()
29
30 /* Ipc::Response API */
31 virtual void pack(Ipc::TypedMsgHdr& msg) const;
32 virtual Ipc::Response::Pointer clone() const;
33
34 bool hasAction() const; ///< whether response contain action object
35 const Action& getAction() const; ///< returns action object
36
37 private:
38 Response(const Response& response);
39
40 public:
41 Action::Pointer action; ///< action relating to response
42 };
43
44 } // namespace Mgr
45
46 #endif /* SQUID_MGR_RESPONSE_H */
47