PacketTypes.hh
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 #ifndef HH_SENF_Packets_PacketTypes_
18 #define HH_SENF_Packets_PacketTypes_ 1
19 
20 // Custom includes
21 #ifdef SENF_PACKET_STD_CONTAINER
22 #include <vector>
23 #else
24 #include "PacketVector.hh"
25 #endif
26 #include <boost/intrusive_ptr.hpp>
27 #include <boost/cstdint.hpp>
28 #include <boost/intrusive/list.hpp>
29 #include <boost/intrusive/list_hook.hpp>
30 
31 //#include "PacketTypes.mpp"
32 //-/////////////////////////////////////////////////////////////////////////////////////////////////
33 
34 namespace senf {
35 
36  class PacketData;
37  class PacketInterpreterBase;
38 
39 namespace detail {
40 
41  class PacketImpl;
42 
43 namespace packet {
44 
49  template <class T>
50  struct smart_pointer {
51  typedef boost::intrusive_ptr<T> ptr_t;
52  };
53 
54  struct interpreter_list_tag;
55  typedef boost::intrusive::list_base_hook< boost::intrusive::tag<interpreter_list_tag> > interpreter_list_base;
56  typedef boost::intrusive::list< PacketInterpreterBase,
57  boost::intrusive::constant_time_size<false>,
58  boost::intrusive::base_hook<interpreter_list_base> > interpreter_list;
59 
60  typedef boost::uint8_t byte;
61 #ifdef SENF_PACKET_STD_CONTAINER
62  typedef std::vector<byte> raw_container;
63 #else
65 #endif
68 
71  typedef long refcount_t; // This is long since boost uses long for refcounts .. hmm ..
72 
73 namespace test {
74 
75  struct TestDriver;
76 
77 }}}}
78 
79 //-/////////////////////////////////////////////////////////////////////////////////////////////////
80 #endif
81 #if !defined(HH_SENF_Packets_Packets__decls_) && !defined(HH_SENF_Packets_PacketTypes_i_)
82 #define HH_SENF_Packets_PacketTypes_i_
83 //#include "PacketTypes.cci"
84 //#include "PacketTypes.ct"
85 //#include "PacketTypes.cti"
86 #endif
87 
88 
89 // Local Variables:
90 // mode: c++
91 // fill-column: 100
92 // c-file-style: "senf"
93 // indent-tabs-mode: nil
94 // ispell-local-dictionary: "american"
95 // compile-command: "scons -u test"
96 // comment-column: 40
97 // End:
std::ptrdiff_t difference_type
Definition: PacketVector.hh:49
std::size_t size_type
Definition: PacketVector.hh:48
Internal: Base packet interpreter class.
value_type * iterator
Definition: PacketVector.hh:50
boost::intrusive::list< PacketInterpreterBase, boost::intrusive::constant_time_size< false >, boost::intrusive::base_hook< interpreter_list_base > > interpreter_list
Definition: PacketTypes.hh:58
raw_container::const_iterator const_iterator
Definition: PacketTypes.hh:70
boost::intrusive::list_base_hook< boost::intrusive::tag< interpreter_list_tag > > interpreter_list_base
Definition: PacketTypes.hh:54
raw_container::size_type size_type
Definition: PacketTypes.hh:66
raw_container::iterator iterator
Definition: PacketTypes.hh:69
Internal: Template typedef for used smart pointer.
Definition: PacketTypes.hh:50
raw_container::difference_type difference_type
Definition: PacketTypes.hh:67
boost::intrusive_ptr< T > ptr_t
Definition: PacketTypes.hh:51
PacketVector public header.
boost::uint8_t byte
Definition: PacketTypes.hh:60
PacketVector raw_container
Definition: PacketTypes.hh:64
value_type const * const_iterator
Definition: PacketVector.hh:51