Class CData

java.lang.Object
org.python.core.PyObject
org.python.modules.jffi.CData
All Implemented Interfaces:
Serializable, Traverseproc
Direct Known Subclasses:
AbstractMemoryCData, ArrayCData, ScalarCData, Structure

public abstract class CData extends PyObject implements Traverseproc
See Also:
  • Field Details

    • TYPE

      public static final PyType TYPE
  • Method Details

    • byref

      public PyObject byref(PyObject offset)
      Wraps up this object in a pointer that can be passed to native code. The byref() return value cannot be used as anything other than a parameter.
      Returns:
      A ByReference instance pointing to this object's native memory.
    • pointer

      public PyObject pointer(PyObject pytype)
    • address

      public PyObject address()
    • getReferenceMemory

      public final DirectMemory getReferenceMemory()
      Returns the memory used when creating a reference to this instance. e.g. via byref(obj)
      Returns:
      The reference memory for this object
    • getContentMemory

      public Memory getContentMemory()
    • traverse

      public int traverse(Visitproc visit, Object arg)
      Description copied from interface: Traverseproc
      Traverses all directly contained PyObjects. Like in CPython, arg must be passed unmodified to visit as its second parameter. If Visitproc.visit(PyObject, Object) returns nonzero, this return value must be returned immediately by traverse. Visitproc.visit(PyObject, Object) must not be called with a null PyObject-argument.
      Specified by:
      traverse in interface Traverseproc
    • refersDirectlyTo

      public boolean refersDirectlyTo(PyObject ob)
      Description copied from interface: Traverseproc
      Optional operation. Should only be implemented if it is more efficient than calling Traverseproc.traverse(Visitproc, Object) with a visitproc that just watches out for ob. Must return false if ob is null.
      Specified by:
      refersDirectlyTo in interface Traverseproc