First public contribution.
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_signatures_ = show_signatures_;
21 show_user_defined_ = show_all;
22 show_signatures_ = show_all;
25 docstring_options(bool show_user_defined, bool show_signatures)
27 previous_show_user_defined_ = show_user_defined_;
28 previous_show_signatures_ = show_signatures_;
29 show_user_defined_ = show_user_defined;
30 show_signatures_ = show_signatures;
35 show_user_defined_ = previous_show_user_defined_;
36 show_signatures_ = previous_show_signatures_;
40 disable_user_defined() { show_user_defined_ = false; }
43 enable_user_defined() { show_user_defined_ = true; }
46 disable_signatures() { show_signatures_ = false; }
49 enable_signatures() { show_signatures_ = true; }
54 show_user_defined_ = false;
55 show_signatures_ = false;
61 show_user_defined_ = true;
62 show_signatures_ = true;
65 friend struct objects::function;
68 static volatile bool show_user_defined_;
69 static volatile bool show_signatures_;
70 bool previous_show_user_defined_;
71 bool previous_show_signatures_;
74 }} // namespace boost::python
76 #endif // DOCSTRING_OPTIONS_RWGK20060111_HPP