PacketImpl.ct
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 
14 /** \file
15  \brief PacketImpl non-inline template implementation */
16 
17 #include "PacketImpl.ih"
18 
19 // Custom includes
20 
21 #define prefix_
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
23 
24 template <class Annotation>
25 senf::detail::AnnotationRegistry::RegistrationProxy<Annotation>
26  senf::detail::AnnotationRegistry::Entry<Annotation>::proxy_;
27 
28 template <class Annotation>
29 senf::detail::AnnotationRegistry::key_type
30  senf::detail::AnnotationRegistry::Entry<Annotation>::key_;
31 
32 #ifndef SENF_PACKET_NO_COMPLEX_ANNOTATIONS
33 
34 template <class Annotation>
35 prefix_ void * senf::detail::PacketImpl::complexAnnotation()
36 {
37  AnnotationRegistry::key_type key (AnnotationRegistry::lookup<Annotation>());
38  void * rv (complexAnnotation(key));
39  if (! rv) {
40  while (complexAnnotations_.size() < ComplexAnnotations::size_type(-key))
41  complexAnnotations_.push_back(0);
42  complexAnnotations_.replace(-key-1, new AnnotationRegistry::Entry<Annotation>());
43  rv = complexAnnotations_[-key-1].get();
44  }
45  return rv;
46 }
47 
48 #endif
49 
50 //-/////////////////////////////////////////////////////////////////////////////////////////////////
51 #undef prefix_
52 
53 
54 // Local Variables:
55 // mode: c++
56 // fill-column: 100
57 // comment-column: 40
58 // c-file-style: "senf"
59 // indent-tabs-mode: nil
60 // ispell-local-dictionary: "american"
61 // compile-command: "scons -u test"
62 // End: