1 // Copyright Ralf W. Grosse-Kunstleve 2006.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef DOCSTRING_OPTIONS_RWGK20060111_HPP
6 # define DOCSTRING_OPTIONS_RWGK20060111_HPP
8 #include <boost/python/object/function.hpp>
10 namespace boost { namespace python {
12 // Note: the static data members are defined in object/function.cpp
14 class BOOST_PYTHON_DECL docstring_options : boost::noncopyable
17 docstring_options(bool show_all=true)
19 previous_show_user_defined_ = show_user_defined_;
20 previous_show_py_signatures_ = show_py_signatures_;
21 previous_show_cpp_signatures_ = show_cpp_signatures_;
22 show_user_defined_ = show_all;
23 show_cpp_signatures_ = show_all;
24 show_py_signatures_ = show_all;
27 docstring_options(bool show_user_defined, bool show_signatures)
29 previous_show_user_defined_ = show_user_defined_;
30 previous_show_cpp_signatures_ = show_cpp_signatures_;
31 previous_show_py_signatures_ = show_py_signatures_;
32 show_user_defined_ = show_user_defined;
33 show_cpp_signatures_ = show_signatures;
34 show_py_signatures_ = show_signatures;
37 docstring_options(bool show_user_defined, bool show_py_signatures, bool show_cpp_signatures)
39 previous_show_user_defined_ = show_user_defined_;
40 previous_show_cpp_signatures_ = show_cpp_signatures_;
41 previous_show_py_signatures_ = show_py_signatures_;
42 show_user_defined_ = show_user_defined;
43 show_cpp_signatures_ = show_cpp_signatures;
44 show_py_signatures_ = show_py_signatures;
49 show_user_defined_ = previous_show_user_defined_;
50 show_cpp_signatures_ = previous_show_cpp_signatures_;
51 show_py_signatures_ = previous_show_py_signatures_;
55 disable_user_defined() { show_user_defined_ = false; }
58 enable_user_defined() { show_user_defined_ = true; }
61 disable_py_signatures()
63 show_py_signatures_ = false;
67 enable_py_signatures()
69 show_py_signatures_ = true;
73 disable_cpp_signatures()
75 show_cpp_signatures_ = false;
79 enable_cpp_signatures()
81 show_cpp_signatures_ = true;
87 show_cpp_signatures_ = false;
88 show_py_signatures_ = false;
94 show_cpp_signatures_ = true;
95 show_py_signatures_ = true;
101 show_user_defined_ = false;
102 show_cpp_signatures_ = false;
103 show_py_signatures_ = false;
109 show_user_defined_ = true;
110 show_cpp_signatures_ = true;
111 show_py_signatures_ = true;
114 friend struct objects::function;
117 static volatile bool show_user_defined_;
118 static volatile bool show_cpp_signatures_;
119 static volatile bool show_py_signatures_;
120 bool previous_show_user_defined_;
121 bool previous_show_cpp_signatures_;
122 bool previous_show_py_signatures_;
125 }} // namespace boost::python
127 #endif // DOCSTRING_OPTIONS_RWGK20060111_HPP