]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/Response.cc
4 * DEBUG: section 16 Cache Manager API
9 #include "base/TextException.h"
10 #include "CacheManager.h"
11 #include "ipc/Messages.h"
12 #include "ipc/TypedMsgHdr.h"
13 #include "mgr/ActionCreator.h"
14 #include "mgr/ActionProfile.h"
15 #include "mgr/Response.h"
18 Mgr::Response::Response(unsigned int aRequestId
, Action::Pointer anAction
):
19 Ipc::Response(aRequestId
), action(anAction
)
21 Must(!action
|| action
->name()); // if there is an action, it must be named
24 Mgr::Response::Response(const Response
& response
):
25 Ipc::Response(response
.requestId
), action(response
.action
)
29 Mgr::Response::Response(const Ipc::TypedMsgHdr
& msg
):
32 msg
.checkType(Ipc::mtCacheMgrResponse
);
33 msg
.getPod(requestId
);
36 if (msg
.hasMoreData()) {
38 msg
.getString(actionName
);
39 action
= CacheManager::GetInstance()->createNamedAction(actionName
.termedBuf());
46 Mgr::Response::pack(Ipc::TypedMsgHdr
& msg
) const
49 msg
.setType(Ipc::mtCacheMgrResponse
);
50 msg
.putPod(requestId
);
52 msg
.putString(action
->name());
57 Ipc::Response::Pointer
58 Mgr::Response::clone() const
60 return new Response(*this);
64 Mgr::Response::hasAction() const
66 return action
!= NULL
;
70 Mgr::Response::getAction() const