Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/python/object/class.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright David Abrahams 2001.
0002 // Distributed under the Boost Software License, Version 1.0. (See
0003 // accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 #ifndef CLASS_DWA20011214_HPP
0006 # define CLASS_DWA20011214_HPP
0007 
0008 # include <boost/python/detail/prefix.hpp>
0009 # include <boost/python/object_core.hpp>
0010 # include <boost/python/type_id.hpp>
0011 # include <cstddef>
0012 
0013 namespace boost { namespace python {
0014 
0015 namespace objects { 
0016 
0017 struct BOOST_PYTHON_DECL class_base : python::api::object
0018 {
0019     // constructor
0020     class_base(
0021         char const* name              // The name of the class
0022         
0023         , std::size_t num_types         // A list of class_ids. The first is the type
0024         , type_info const*const types    // this is wrapping. The rest are the types of
0025                                         // any bases.
0026         
0027         , char const* doc = 0           // Docstring, if any.
0028         );
0029 
0030 
0031     // Implementation detail. Hiding this in the private section would
0032     // require use of template friend declarations.
0033     void enable_pickling_(bool getstate_manages_dict);
0034 
0035  protected:
0036     void add_property(
0037         char const* name, object const& fget, char const* docstr);
0038     void add_property(char const* name, 
0039         object const& fget, object const& fset, char const* docstr);
0040 
0041     void add_static_property(char const* name, object const& fget);
0042     void add_static_property(char const* name, object const& fget, object const& fset);
0043     
0044     // Retrieve the underlying object
0045     void setattr(char const* name, object const&);
0046 
0047     // Set a special attribute in the class which tells Boost.Python
0048     // to allocate extra bytes for embedded C++ objects in Python
0049     // instances.
0050     void set_instance_size(std::size_t bytes);
0051 
0052     // Set an __init__ function which throws an appropriate exception
0053     // for abstract classes.
0054     void def_no_init();
0055 
0056     // Effects:
0057     //  setattr(self, staticmethod(getattr(self, method_name)))
0058     void make_method_static(const char *method_name);
0059 };
0060 
0061 }}} // namespace boost::python::objects
0062 
0063 #endif // CLASS_DWA20011214_HPP