// Copyright Dean Michael Berris 2007. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef __NETWORK_MESSAGE_WRAPPERS_SOURCE_HPP__ #define __NETWORK_MESSAGE_WRAPPERS_SOURCE_HPP__ #include namespace boost { namespace network { namespace impl { template struct source_wrapper : public detail::wrapper_base > { typedef Tag tag; typedef basic_message message_type; typedef typename string::type string_type; typedef detail::wrapper_base > wrapper_base; explicit source_wrapper(basic_message & message_) : wrapper_base(message_) { }; operator string_type () const { return string_type(wrapper_base::_message.source()); }; }; } // namespace impl template inline typename string::type source(basic_message & message_) { return impl::source_wrapper(message_); } } // namespace network } // namespace boost #endif // __NETWORK_MESSAGE_WRAPPERS_SOURCE_HPP__