#ifndef PROTOZERO_PBF_MESSAGE_HPP #define PROTOZERO_PBF_MESSAGE_HPP /***************************************************************************** protozero - Minimalistic protocol buffer decoder and encoder in C++. This file is from https://github.com/mapbox/protozero where you can find more documentation. *****************************************************************************/ #include #include #include namespace protozero { template class pbf_message : public pbf_reader { static_assert(std::is_same::type>::value, "T must be enum with underlying type protozero::pbf_tag_type"); public: using enum_type = T; template pbf_message(Args&&... args) noexcept : pbf_reader(std::forward(args)...) { } inline bool next() { return pbf_reader::next(); } inline bool next(T tag) { return pbf_reader::next(pbf_tag_type(tag)); } inline T tag() const noexcept { return T(pbf_reader::tag()); } }; } // end namespace protozero #endif // PROTOZERO_PBF_MESSAGE_HPP