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
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
15 \brief EnumParser inline template implementation */
19 #define prefix_ inline
20 //-/////////////////////////////////////////////////////////////////////////////////////////////////
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 template <typename EnumType, typename UnderlyingTypeParser>
26 prefix_ senf::EnumParser<EnumType, UnderlyingTypeParser>::EnumParser(data_iterator i, state_type s)
27 : PacketParserBase(i, s, fixed_bytes)
30 template <typename EnumType, typename UnderlyingTypeParser>
31 prefix_ UnderlyingTypeParser senf::EnumParser<EnumType, UnderlyingTypeParser>::underlyingValue()
34 return parse<UnderlyingTypeParser>( i() );
37 template <typename EnumType, typename UnderlyingTypeParser>
38 prefix_ void senf::EnumParser<EnumType, UnderlyingTypeParser>::value(EnumType v)
40 underlyingValue() << static_cast<typename UnderlyingTypeParser::value_type>(v);
43 template <typename EnumType, typename UnderlyingTypeParser>
44 prefix_ EnumType senf::EnumParser<EnumType, UnderlyingTypeParser>::value()
47 return static_cast<EnumType>(underlyingValue().value());
50 //-/////////////////////////////////////////////////////////////////////////////////////////////////