pyd.class_wrap



struct wrapped_class_object;
The class object, a subtype of PyObject

template wrapped_class_type(T)


PyTypeObject wrapped_class_type;
The type object, an instance of PyType_Type

template wrapped_methods(T)
Various wrapped methods

PyObject* wrapped_new(PyTypeObject* type, PyObject* args, PyObject* kwds);
The generic "_new__" method

void wrapped_dealloc(PyObject* _self);
The generic dealloc method.

template wrapped_init(T)


int init(PyObject* self, PyObject* args, PyObject* kwds);
The default init method calls the class's zero-argument constructor.

template wrapped_get(T,alias Fn)


PyObject* func(PyObject* self, void* closure);
A generic wrapper around a "getter" property.

template wrapped_set(T,alias Fn)


int func(PyObject* self, PyObject* value, void* closure);
A generic wrapper around a "setter" property.

template is_wrapped(T)
A useful check for whether a given class has been wrapped. Mainly used by the conversion functions (see make_object.d), but possibly useful elsewhere.

struct wrapped_class;
This struct wraps a D class. Its member functions are the primary way of wrapping the specific parts of the class.

template def(alias fn,char[] name,fn_t = typeof(&fn),uint MIN_ARGS = MIN_ARGS!(fn))
Wraps a member function of the class.

Params:
name The name of the function as it will appear in Python.
fn The member function to wrap.
MIN_ARGS The minimum number of arguments this function can accept.
fn_t The type of the function. It is only useful to specify this if more than one function has the same name as this one.

template prop(alias fn,char[] name,bool RO = false)
Wraps a property of the class.

Params:
name The name of the property as it will appear in Python.
fn The property to wrap.
RO Whether this is a read-only property.

template init(C1 = Void,C2 = Void,C3 = Void,C4 = Void,C5 = Void,C6 = Void,C7 = Void,C8 = Void,C9 = Void,C10 = Void)
Wraps the constructors of the class.

This template takes a series of specializations of the ctor template (see ctor_wrap.d), each of which describes a different constructor that the class supports. The default constructor need not be specified, and will always be available if the class supports it.

BUGS:
This currently does not support having multiple constructors with the same number of arguments.


Page generated by Ddoc.