1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/python/docstring_options.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,76 @@
1.4 +// Copyright Ralf W. Grosse-Kunstleve 2006.
1.5 +// Distributed under the Boost Software License, Version 1.0. (See
1.6 +// accompanying file LICENSE_1_0.txt or copy at
1.7 +// http://www.boost.org/LICENSE_1_0.txt)
1.8 +#ifndef DOCSTRING_OPTIONS_RWGK20060111_HPP
1.9 +# define DOCSTRING_OPTIONS_RWGK20060111_HPP
1.10 +
1.11 +#include <boost/python/object/function.hpp>
1.12 +
1.13 +namespace boost { namespace python {
1.14 +
1.15 +// Note: the static data members are defined in object/function.cpp
1.16 +
1.17 +class BOOST_PYTHON_DECL docstring_options : boost::noncopyable
1.18 +{
1.19 + public:
1.20 + docstring_options(bool show_all=true)
1.21 + {
1.22 + previous_show_user_defined_ = show_user_defined_;
1.23 + previous_show_signatures_ = show_signatures_;
1.24 + show_user_defined_ = show_all;
1.25 + show_signatures_ = show_all;
1.26 + }
1.27 +
1.28 + docstring_options(bool show_user_defined, bool show_signatures)
1.29 + {
1.30 + previous_show_user_defined_ = show_user_defined_;
1.31 + previous_show_signatures_ = show_signatures_;
1.32 + show_user_defined_ = show_user_defined;
1.33 + show_signatures_ = show_signatures;
1.34 + }
1.35 +
1.36 + ~docstring_options()
1.37 + {
1.38 + show_user_defined_ = previous_show_user_defined_;
1.39 + show_signatures_ = previous_show_signatures_;
1.40 + }
1.41 +
1.42 + void
1.43 + disable_user_defined() { show_user_defined_ = false; }
1.44 +
1.45 + void
1.46 + enable_user_defined() { show_user_defined_ = true; }
1.47 +
1.48 + void
1.49 + disable_signatures() { show_signatures_ = false; }
1.50 +
1.51 + void
1.52 + enable_signatures() { show_signatures_ = true; }
1.53 +
1.54 + void
1.55 + disable_all()
1.56 + {
1.57 + show_user_defined_ = false;
1.58 + show_signatures_ = false;
1.59 + }
1.60 +
1.61 + void
1.62 + enable_all()
1.63 + {
1.64 + show_user_defined_ = true;
1.65 + show_signatures_ = true;
1.66 + }
1.67 +
1.68 + friend struct objects::function;
1.69 +
1.70 + private:
1.71 + static volatile bool show_user_defined_;
1.72 + static volatile bool show_signatures_;
1.73 + bool previous_show_user_defined_;
1.74 + bool previous_show_signatures_;
1.75 +};
1.76 +
1.77 +}} // namespace boost::python
1.78 +
1.79 +#endif // DOCSTRING_OPTIONS_RWGK20060111_HPP