Chris@16
|
1 /*
|
Chris@101
|
2 * Copyright Andrey Semashev 2007 - 2015.
|
Chris@16
|
3 * Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
4 * (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
5 * http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 */
|
Chris@16
|
7 /*!
|
Chris@16
|
8 * \file thread_id.hpp
|
Chris@16
|
9 * \author Andrey Semashev
|
Chris@16
|
10 * \date 08.01.2012
|
Chris@16
|
11 *
|
Chris@16
|
12 * \brief This header is the Boost.Log library implementation, see the library documentation
|
Chris@16
|
13 * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html.
|
Chris@16
|
14 */
|
Chris@16
|
15
|
Chris@16
|
16 #ifndef BOOST_LOG_DETAIL_THREAD_ID_HPP_INCLUDED_
|
Chris@16
|
17 #define BOOST_LOG_DETAIL_THREAD_ID_HPP_INCLUDED_
|
Chris@16
|
18
|
Chris@16
|
19 #include <iosfwd>
|
Chris@16
|
20 #include <boost/cstdint.hpp>
|
Chris@16
|
21 #include <boost/log/detail/config.hpp>
|
Chris@16
|
22 #include <boost/log/detail/id.hpp>
|
Chris@16
|
23 #include <boost/log/detail/header.hpp>
|
Chris@16
|
24
|
Chris@16
|
25 #ifdef BOOST_HAS_PRAGMA_ONCE
|
Chris@16
|
26 #pragma once
|
Chris@16
|
27 #endif
|
Chris@16
|
28
|
Chris@16
|
29 namespace boost {
|
Chris@16
|
30
|
Chris@16
|
31 BOOST_LOG_OPEN_NAMESPACE
|
Chris@16
|
32
|
Chris@16
|
33 namespace aux {
|
Chris@16
|
34
|
Chris@16
|
35 //! The thread id descriptor
|
Chris@16
|
36 struct thread
|
Chris@16
|
37 {
|
Chris@16
|
38 #if defined(BOOST_WINDOWS)
|
Chris@16
|
39 typedef uint32_t native_type;
|
Chris@16
|
40 #else
|
Chris@16
|
41 typedef uintmax_t native_type;
|
Chris@16
|
42 #endif
|
Chris@16
|
43 typedef boost::log::aux::id< thread > id;
|
Chris@16
|
44 };
|
Chris@16
|
45
|
Chris@16
|
46 namespace this_thread {
|
Chris@16
|
47
|
Chris@16
|
48 //! The function returns current thread identifier
|
Chris@16
|
49 BOOST_LOG_API thread::id const& get_id();
|
Chris@16
|
50
|
Chris@16
|
51 } // namespace this_thread
|
Chris@16
|
52
|
Chris@16
|
53 template< typename CharT, typename TraitsT >
|
Chris@16
|
54 BOOST_LOG_API std::basic_ostream< CharT, TraitsT >&
|
Chris@16
|
55 operator<< (std::basic_ostream< CharT, TraitsT >& strm, thread::id const& tid);
|
Chris@16
|
56
|
Chris@16
|
57 } // namespace aux
|
Chris@16
|
58
|
Chris@16
|
59 BOOST_LOG_CLOSE_NAMESPACE // namespace log
|
Chris@16
|
60
|
Chris@16
|
61 } // namespace boost
|
Chris@16
|
62
|
Chris@16
|
63 #include <boost/log/detail/footer.hpp>
|
Chris@16
|
64
|
Chris@16
|
65 #endif // BOOST_LOG_DETAIL_THREAD_ID_HPP_INCLUDED_
|