os/ossrv/ossrv_pub/boost_apis/boost/python/object/class.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/python/object/class.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,64 @@
     1.4 +// Copyright David Abrahams 2001.
     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 CLASS_DWA20011214_HPP
     1.9 +# define CLASS_DWA20011214_HPP
    1.10 +
    1.11 +# include <boost/python/detail/prefix.hpp>
    1.12 +# include <boost/utility.hpp>
    1.13 +# include <boost/python/object_core.hpp>
    1.14 +# include <boost/python/type_id.hpp>
    1.15 +# include <cstddef>
    1.16 +
    1.17 +namespace boost { namespace python {
    1.18 +
    1.19 +namespace objects { 
    1.20 +
    1.21 +struct BOOST_PYTHON_DECL class_base : python::api::object
    1.22 +{
    1.23 +    // constructor
    1.24 +    class_base(
    1.25 +        char const* name              // The name of the class
    1.26 +        
    1.27 +        , std::size_t num_types         // A list of class_ids. The first is the type
    1.28 +        , type_info const*const types    // this is wrapping. The rest are the types of
    1.29 +                                        // any bases.
    1.30 +        
    1.31 +        , char const* doc = 0           // Docstring, if any.
    1.32 +        );
    1.33 +
    1.34 +
    1.35 +    // Implementation detail. Hiding this in the private section would
    1.36 +    // require use of template friend declarations.
    1.37 +    void enable_pickling_(bool getstate_manages_dict);
    1.38 +
    1.39 + protected:
    1.40 +    void add_property(
    1.41 +        char const* name, object const& fget, char const* docstr);
    1.42 +    void add_property(char const* name, 
    1.43 +        object const& fget, object const& fset, char const* docstr);
    1.44 +
    1.45 +    void add_static_property(char const* name, object const& fget);
    1.46 +    void add_static_property(char const* name, object const& fget, object const& fset);
    1.47 +    
    1.48 +    // Retrieve the underlying object
    1.49 +    void setattr(char const* name, object const&);
    1.50 +
    1.51 +    // Set a special attribute in the class which tells Boost.Python
    1.52 +    // to allocate extra bytes for embedded C++ objects in Python
    1.53 +    // instances.
    1.54 +    void set_instance_size(std::size_t bytes);
    1.55 +
    1.56 +    // Set an __init__ function which throws an appropriate exception
    1.57 +    // for abstract classes.
    1.58 +    void def_no_init();
    1.59 +
    1.60 +    // Effects:
    1.61 +    //  setattr(self, staticmethod(getattr(self, method_name)))
    1.62 +    void make_method_static(const char *method_name);
    1.63 +};
    1.64 +
    1.65 +}}} // namespace boost::python::objects
    1.66 +
    1.67 +#endif // CLASS_DWA20011214_HPP