Package solvcon :: Module gendata :: Class TypeWithBinder
[hide private]
[frames] | no frames]

Type TypeWithBinder

source code


Meta class to make classes with ctypes pointers or containers with ctypes pointers. The type will feather classes with bind/unbind methods along with is_bound/is_unbound properties. The names of pointer variables have to be listed in _pointers_ class list variable.

The bind/unbind methods are designed to be applied to pointers used by the instance. is_bound/is_unbound properties can test for if pointers are fully bound or fully unbound to the instance, respectively. You have to override the bind method and initiate pointers in it rather than in other method. You can leave it alone if you don't need it. Be sure to enter correct entries into the _pointers_ class variable.

Instance Methods [hide private]

Inherited from type: __call__, __delattr__, __eq__, __ge__, __getattribute__, __gt__, __hash__, __init__, __le__, __lt__, __ne__, __repr__, __setattr__, __subclasses__, mro

Inherited from object: __format__, __reduce__, __reduce_ex__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(cls, name, bases, namespace) source code
Class Variables [hide private]
  _pointers_
a list containing names of variables for ctypes pointers, ctypes structures, or containers that hold ctypes pointers.
Properties [hide private]

Inherited from type: __abstractmethods__, __base__, __bases__, __basicsize__, __dictoffset__, __flags__, __instancecheck__, __itemsize__, __mro__, __name__, __subclasscheck__, __weakrefoffset__

Inherited from object: __class__

Method Details [hide private]

__new__(cls, name, bases, namespace)
Static Method

source code 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__
(inherited documentation)

Class Variable Details [hide private]

_pointers_

a list containing names of variables for ctypes pointers, ctypes structures, or containers that hold ctypes pointers. The list would be used in binding/unbinding process. Subclassing does not override the content of this list. The names defined in the superclasses will be prepended in front of anything in the list defined in the subclass.