MCPcopy Create free account
hub / github.com/aguinet/dragonffi / CArrayObjPyIterator

Class CArrayObjPyIterator

bindings/python/pydffi.cpp:405–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405struct CArrayObjPyIterator {
406 CArrayObjPyIterator(CArrayObj& Obj, py::object Ref):
407 Obj_(Obj),
408 Ref_(Ref)
409 { }
410
411 py::object next() {
412 if (Index_ == Obj_.getNumElements())
413 throw py::stop_iteration();
414 return Obj_.get(Index_++);
415 }
416
417private:
418 CArrayObj& Obj_;
419 py::object Ref_; // keep a reference
420 size_t Index_ = 0;
421};
422
423} // anonymous
424

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected