EnumParser.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_EnumParser_
18 #define HH_SENF_Packets_EnumParser_ 1
19 
20 // Custom includes
21 #include "PacketParser.hh"
22 
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 
25 namespace senf {
26 
27  template <typename EnumType, typename UnderlyingTypeParser>
28  class EnumParser
29  : public PacketParserBase
30  {
31  public:
33 
34  typedef EnumType value_type;
35  static size_type const fixed_bytes = UnderlyingTypeParser::fixed_bytes;
36 
37  void value(EnumType v);
38  EnumType value() const;
39 
40  private:
41  UnderlyingTypeParser underlyingValue() const;
42  };
43 
44 }
45 
46 //-/////////////////////////////////////////////////////////////////////////////////////////////////
47 //#include "EnumParser.cci"
48 //#include "EnumParser.ct"
49 #include "EnumParser.cti"
50 #endif
PacketParser public header.
EnumType value_type
Definition: EnumParser.hh:34
Packet data STL-sequence view.
Definition: PacketData.hh:61
data_iterator i() const
Return beginning of data to parse.
detail::packet::size_type size_type
Unsigned integral type.
static size_type const fixed_bytes
Definition: EnumParser.hh:35
EnumParser(data_iterator i, state_type s)
Parser Base class.
EnumType value() const
detail::packet::iterator data_iterator
Raw data iterator type.