]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/IntParam.cc
2 * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
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.
9 /* DEBUG: section 16 Cache Manager API */
12 #include "base/TextException.h"
13 #include "ipc/TypedMsgHdr.h"
14 #include "mgr/IntParam.h"
16 Mgr::IntParam::IntParam():
17 QueryParam(QueryParam::ptInt
), array()
21 Mgr::IntParam::IntParam(const std::vector
<int>& anArray
):
22 QueryParam(QueryParam::ptInt
), array(anArray
)
27 Mgr::IntParam::pack(Ipc::TypedMsgHdr
& msg
) const
30 msg
.putInt(array
.size());
31 typedef std::vector
<int>::const_iterator Iterator
;
32 for (Iterator iter
= array
.begin(); iter
!= array
.end(); ++iter
)
37 Mgr::IntParam::unpackValue(const Ipc::TypedMsgHdr
& msg
)
40 int count
= msg
.getInt();
42 for ( ; count
> 0; --count
)
43 array
.push_back(msg
.getInt());
46 const std::vector
<int>&
47 Mgr::IntParam::value() const