is_debugger_present.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright Andrey Semashev 2007 - 2021.
  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 is_debugger_present.hpp
  9. * \author Andrey Semashev
  10. * \date 05.12.2012
  11. *
  12. * The header contains implementation of the \c is_debugger_present predicate in template expressions.
  13. */
  14. #ifndef BOOST_LOG_EXPRESSIONS_PREDICATES_IS_DEBUGGER_PRESENT_HPP_INCLUDED_
  15. #define BOOST_LOG_EXPRESSIONS_PREDICATES_IS_DEBUGGER_PRESENT_HPP_INCLUDED_
  16. #include <boost/log/detail/config.hpp>
  17. #ifdef BOOST_HAS_PRAGMA_ONCE
  18. #pragma once
  19. #endif
  20. #if defined(BOOST_WINDOWS)
  21. #include <boost/phoenix/core/terminal.hpp> // this is needed to be able to include this header alone, Boost.Phoenix blows up without it
  22. #include <boost/phoenix/function/adapt_callable.hpp>
  23. #include <boost/log/detail/header.hpp>
  24. namespace boost {
  25. BOOST_LOG_OPEN_NAMESPACE
  26. namespace expressions {
  27. namespace aux {
  28. struct is_debugger_present
  29. {
  30. typedef bool result_type;
  31. BOOST_LOG_API result_type operator() () const;
  32. };
  33. } // namespace aux
  34. #ifndef BOOST_LOG_DOXYGEN_PASS
  35. BOOST_PHOENIX_ADAPT_CALLABLE_NULLARY(is_debugger_present, aux::is_debugger_present)
  36. #else
  37. /*!
  38. * The function generates a filter that will check whether the logger is attached to the process
  39. */
  40. unspecified is_debugger_present();
  41. #endif
  42. } // namespace expressions
  43. BOOST_LOG_CLOSE_NAMESPACE // namespace log
  44. } // namespace boost
  45. #include <boost/log/detail/footer.hpp>
  46. #endif // BOOST_WINDOWS
  47. #endif // BOOST_LOG_EXPRESSIONS_PREDICATES_IS_DEBUGGER_PRESENT_HPP_INCLUDED_