PacketInfo.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_PacketInfo_
18 #define HH_SENF_Packets_PacketInfo_ 1
19 
20 // Custom includes
21 #include <senf/Utils/safe_bool.hh>
22 #include <boost/intrusive_ptr.hpp>
23 #include "Packet.hh"
24 
25 //#include "PacketInfo.mpp"
27 
28 namespace senf {
29 
30  class PacketInfo : public senf::safe_bool<PacketInfo>
31  {
32  public:
33  PacketInfo();
34  explicit PacketInfo(Packet const & packet);
35 
36  bool boolean_test() const;
37 
38  template <class Annotation>
39  Annotation & annotation();
40  void clearAnnotations();
41  void dumpAnnotations(std::ostream & os);
42 
43  bool is_shared() const;
44  bool usingExternalMemory() const;
45  void releaseExternalMemory() const;
46 
47  void memDebug(std::ostream & os) const;
48 
49  private:
50  boost::intrusive_ptr<detail::PacketImpl> impl_;
51 
52  friend class detail::PacketImpl;
53  };
54 
55 }
56 
58 #include "PacketInfo.cci"
59 //#include "PacketInfo.ct"
60 //#include "PacketInfo.cti"
61 #endif
62 
63 
64 // Local Variables:
65 // mode: c++
66 // fill-column: 100
67 // comment-column: 40
68 // c-file-style: "senf"
69 // indent-tabs-mode: nil
70 // ispell-local-dictionary: "american"
71 // compile-command: "scons -u test"
72 // End:
void memDebug(std::ostream &os) const
void dumpAnnotations(std::ostream &os)
Annotation & annotation()
Main Packet class.
Definition: Packet.hh:131
bool boolean_test() const
Internal: Packet data storage.
Definition: PacketImpl.hh:112
bool is_shared() const
Packet public header.
void clearAnnotations()
bool usingExternalMemory() const
void releaseExternalMemory() const