]>
Commit | Line | Data |
---|---|---|
7c673cae | 1 | /* |
1e59de90 | 2 | * Copyright Andrey Semashev 2007 - 2021. |
7c673cae FG |
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 | ||
15 | #ifndef BOOST_LOG_EXPRESSIONS_PREDICATES_IS_DEBUGGER_PRESENT_HPP_INCLUDED_ | |
16 | #define BOOST_LOG_EXPRESSIONS_PREDICATES_IS_DEBUGGER_PRESENT_HPP_INCLUDED_ | |
17 | ||
18 | #include <boost/log/detail/config.hpp> | |
19 | ||
20 | #ifdef BOOST_HAS_PRAGMA_ONCE | |
21 | #pragma once | |
22 | #endif | |
23 | ||
24 | #if defined(BOOST_WINDOWS) | |
25 | ||
26 | #include <boost/phoenix/core/terminal.hpp> // this is needed to be able to include this header alone, Boost.Phoenix blows up without it | |
27 | #include <boost/phoenix/function/adapt_callable.hpp> | |
28 | #include <boost/log/detail/header.hpp> | |
29 | ||
7c673cae FG |
30 | namespace boost { |
31 | ||
32 | BOOST_LOG_OPEN_NAMESPACE | |
33 | ||
34 | namespace expressions { | |
35 | ||
36 | namespace aux { | |
37 | ||
38 | struct is_debugger_present | |
39 | { | |
40 | typedef bool result_type; | |
41 | ||
1e59de90 | 42 | BOOST_LOG_API result_type operator() () const; |
7c673cae FG |
43 | }; |
44 | ||
45 | } // namespace aux | |
46 | ||
47 | #ifndef BOOST_LOG_DOXYGEN_PASS | |
48 | ||
49 | BOOST_PHOENIX_ADAPT_CALLABLE_NULLARY(is_debugger_present, aux::is_debugger_present) | |
50 | ||
51 | #else | |
52 | ||
53 | /*! | |
54 | * The function generates a filter that will check whether the logger is attached to the process | |
55 | */ | |
56 | unspecified is_debugger_present(); | |
57 | ||
58 | #endif | |
59 | ||
60 | } // namespace expressions | |
61 | ||
62 | BOOST_LOG_CLOSE_NAMESPACE // namespace log | |
63 | ||
64 | } // namespace boost | |
65 | ||
66 | #include <boost/log/detail/footer.hpp> | |
67 | ||
68 | #endif // BOOST_WINDOWS | |
69 | ||
70 | #endif // BOOST_LOG_EXPRESSIONS_PREDICATES_IS_DEBUGGER_PRESENT_HPP_INCLUDED_ |