PacketData.cc
Go to the documentation of this file.
1 //
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
6 //
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
11 //
12 
13 
17 //#include "PacketData.ih"
18 
19 // Custom includes
20 #include "Packets.hh"
21 
22 //#include "PacketData.mpp"
23 #define prefix_
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 
26 // Modifying the raw packet data
27 
29 {
30  if (n<size())
31  impl().erase(this,boost::next(begin(),n),end());
32  else if (n>size())
33  impl().insert(this,end(),n-size(),v);
34 }
35 
36 //-/////////////////////////////////////////////////////////////////////////////////////////////////
37 #undef prefix_
38 //#include "PacketData.mpp"
39 
40 
41 // Local Variables:
42 // mode: c++
43 // fill-column: 100
44 // c-file-style: "senf"
45 // indent-tabs-mode: nil
46 // ispell-local-dictionary: "american"
47 // compile-command: "scons -u test"
48 // comment-column: 40
49 // End:
detail::PacketImpl & impl() const
void erase(PacketData *self, iterator pos)
iterator begin() const
Return iterator to beginning.
void resize(size_type n, byte v=0)
Definition: PacketData.cc:28
Packets public header.
iterator end() const
Return iterator to end.
void insert(PacketData *self, iterator pos, byte v)
senf::detail::packet::size_type size_type
Definition: PacketData.hh:70
size_type size() const
Returns the number of bytes in the packet data.
senf::detail::packet::byte byte
Definition: PacketData.hh:72
#define prefix_
Definition: PacketData.cc:23