-
- const record *resultSet::getRecord(size_t i) const {
- ZOOM_record rec;
- if ((rec = ZOOM_resultset_record(rs, i)) == 0) {
- const char *errmsg; // unused: carries same info as `errcode'
- const char *addinfo;
- int errcode = ZOOM_connection_error(owner._getYazConnection(),
- &errmsg, &addinfo);
- throw bib1Exception(errcode, addinfo);
- }
-
- // Memory management is odd here. The ZOOM-C record we've
- // just fetched (`rec') is owned by the ZOOM-C result-set we
- // fetched it from (`rs'), so all we need to allocate is a
- // ZOOM-C++ wrapper for it, which is destroyed at the
- // appropriate time -- but the underlying (ZOOM-C) record is
- // _not_ destroyed at that time, because it's done when the
- // underlying result-set is deleted.
- return new record(this, rec);
- }