2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief PacketVector inline template implementation */
17 //#include "PacketVector.ih"
20 #include <senf/Utils/senfassert.hh>
22 #define prefix_ inline
23 ///////////////////////////////cti.p///////////////////////////////////////
25 #ifndef SENF_PACKET_STD_CONTAINER
27 template <class ForwardIterator>
28 prefix_ senf::PacketVector::PacketVector(ForwardIterator f, ForwardIterator l)
31 int requestSize (std::distance(f,l));
32 size_ = allocationSize(requestSize);
33 data_ = static_cast<value_type *>(Pool::ordered_malloc(size_ >> ChunkSizeIndex));
34 b_ = data_ + HeadRoom;
35 e_ = b_ + requestSize;
39 template <class ForwardIterator>
40 prefix_ void senf::PacketVector::insert(iterator pos, ForwardIterator f, ForwardIterator l)
42 SENF_ASSERT( pos >= b_ && pos <= e_, "invalid iterator passed to PacketVector::erase" );
43 std::copy(f, l, move(pos, std::distance(f,l)));
48 ///////////////////////////////cti.e///////////////////////////////////////
56 // c-file-style: "senf"
57 // indent-tabs-mode: nil
58 // ispell-local-dictionary: "american"
59 // compile-command: "scons -u test"