diff --git a/capnp/includes/capnp_cpp.pxd b/capnp/includes/capnp_cpp.pxd index 141afc0..ec5cee0 100644 --- a/capnp/includes/capnp_cpp.pxd +++ b/capnp/includes/capnp_cpp.pxd @@ -157,8 +157,13 @@ cdef extern from "capnp/schema.h" namespace " ::capnp": Maybe[Method] findMethodByName(StringPtr name) Method getMethodByName(StringPtr name) bint extends(InterfaceSchema other) + SuperclassList getSuperclasses() # kj::Maybe findSuperclass(uint64_t typeId) const; + cdef cppclass SuperclassList" ::capnp::InterfaceSchema::SuperclassList": + uint size() + InterfaceSchema operator[](uint index) + cdef cppclass StructSchema(Schema): cppclass Field: StructNode.Member.Reader getProto() diff --git a/capnp/lib/capnp.pyx b/capnp/lib/capnp.pyx index 65d9955..b2ed362 100644 --- a/capnp/lib/capnp.pyx +++ b/capnp/lib/capnp.pyx @@ -2447,15 +2447,16 @@ cdef class _InterfaceSchema: nfields = fieldlist.size() ret = set(fieldlist[i].getProto().getName().cStr() for i in xrange(nfields)) - for interface in self.extends: + for interface in self.superclasses: ret |= interface.method_names_inherited return ret - property extends: - """A list of interfaces that this interface extends""" + property superclasses: + """A list of superclasses for this interface""" def __get__(self): - return [self.get_dependency(i).as_interface() for i in self.node.interface.extends] + cdef capnp.SuperclassList classes = self.thisptr.getSuperclasses() + return [_InterfaceSchema()._init(classes[i]) for i in range(classes.size())] property node: """The raw schema node""" @@ -2952,9 +2953,6 @@ cdef class _MessageReader: def __init__(self): raise NotImplementedError("This is an abstract base class") - cpdef _get_root_node(self): - return _NodeReader().init(self.thisptr.getRootNode()) - cpdef get_root(self, schema) except +reraise_kj_exception: """A method for instantiating Cap'n Proto structs