mqtt_cpp
const_buffer_util.hpp
Go to the documentation of this file.
1 // Copyright Takatoshi Kondo 2018
2 //
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
7 #if !defined(MQTT_CONST_BUFFER_UTIL_HPP)
8 #define MQTT_CONST_BUFFER_UTIL_HPP
9 
10 #include <boost/asio/buffer.hpp>
11 #include <mqtt/namespace.hpp>
12 
13 namespace MQTT_NS {
14 
15 namespace as = boost::asio;
16 
17 inline char const* get_pointer(as::const_buffer const& cb) {
18  return static_cast<char const*>(cb.data());
19 }
20 
21 inline std::size_t get_size(as::const_buffer const& cb) {
22  return cb.size();
23 }
24 
25 } // namespace MQTT_NS
26 
27 #endif // MQTT_CONST_BUFFER_UTIL_HPP
Definition: any.hpp:27
char const * get_pointer(as::const_buffer const &cb)
Definition: const_buffer_util.hpp:17
std::size_t get_size(as::const_buffer const &cb)
Definition: const_buffer_util.hpp:21
Definition: buffer.hpp:242