process_id.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright Andrey Semashev 2007 - 2015.
  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. /*!
  8. * \file process_id.hpp
  9. * \author Andrey Semashev
  10. * \date 12.09.2009
  11. *
  12. * \brief This header is the Boost.Log library implementation, see the library documentation
  13. * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html.
  14. */
  15. #ifndef BOOST_LOG_DETAIL_PROCESS_ID_HPP_INCLUDED_
  16. #define BOOST_LOG_DETAIL_PROCESS_ID_HPP_INCLUDED_
  17. #include <iosfwd>
  18. #include <boost/log/detail/config.hpp>
  19. #include <boost/log/detail/id.hpp>
  20. #include <boost/log/detail/header.hpp>
  21. #ifdef BOOST_HAS_PRAGMA_ONCE
  22. #pragma once
  23. #endif
  24. namespace boost {
  25. BOOST_LOG_OPEN_NAMESPACE
  26. namespace aux {
  27. //! The process id descriptor
  28. struct process
  29. {
  30. typedef unsigned long native_type;
  31. typedef boost::log::aux::id< process > id;
  32. };
  33. namespace this_process {
  34. //! The function returns current process identifier
  35. BOOST_LOG_API process::id get_id();
  36. } // namespace this_process
  37. template< typename CharT, typename TraitsT >
  38. BOOST_LOG_API std::basic_ostream< CharT, TraitsT >&
  39. operator<< (std::basic_ostream< CharT, TraitsT >& strm, process::id const& pid);
  40. } // namespace aux
  41. BOOST_LOG_CLOSE_NAMESPACE // namespace log
  42. } // namespace boost
  43. #include <boost/log/detail/footer.hpp>
  44. #endif // BOOST_LOG_DETAIL_PROCESS_ID_HPP_INCLUDED_