NMEA: changed type of talker id from 'std::string' to its own type.
[marnav.git] / src / marnav / nmea / detail.hpp
blob3520e97a9d9a38e1f9f0e6f588555b2a9a5a536a
1 #ifndef __MARNAV__NMEA__DETAIL__HPP__
2 #define __MARNAV__NMEA__DETAIL__HPP__
4 #include <string>
5 #include <tuple>
6 #include <type_traits>
7 #include <vector>
8 #include <marnav/nmea/talker_id.hpp>
10 namespace marnav
12 namespace nmea
14 /// @cond DEV
15 class sentence; // forward declaration
17 namespace detail
19 std::tuple<talker, std::string> parse_address(
20 const std::string & address, bool ignore_unknown = false);
22 void ensure_checksum(const std::string & s, const std::string & expected);
24 void check_raw_sentence(const std::string & s);
26 std::tuple<talker, std::string, std::vector<std::string>> extract_sentence_information(
27 const std::string & s, bool ignore_checksum = false);
29 /// Exists only to do SFINAE on the template parameter type `T`.
30 /// Since it does nothing, the compiler will optimize it out.
31 template <typename T,
32 typename std::enable_if<std::is_base_of<sentence, T>::value, int>::type = 0>
33 void create_sentence_base_class_check()
35 // intentionally left blank
38 /// @endcond
42 #endif