def __iter__(self): for idx in range(len(self)): ec_ptr = self._borrow_event_class_ptr_by_index(self._ptr, idx) assert ec_ptr is not None id = native_bt.event_class_get_id(ec_ptr) assert id >= 0 yield id
def __next__(self): if self._at == len(self._stream_class): raise StopIteration ec_ptr = native_bt.stream_class_get_event_class_by_index(self._stream_class._ptr, self._at) assert(ec_ptr) ev_id = native_bt.event_class_get_id(ec_ptr) native_bt.put(ec_ptr) utils._handle_ret(ev_id, "cannot get event class object's ID") self._at += 1 return ev_id
def id(self): id = native_bt.event_class_get_id(self._ptr) return id if id >= 0 else None