log_bid ebat_copy(log_bid b, oid ibase, int temp) { /* make a copy of b */ BAT *o = temp_descriptor(b); BAT *c; log_bid r; if (!ebats[o->ttype]) ebats[o->ttype] = bat_new(TYPE_void, o->ttype, 0); if (!temp && BATcount(o)) { c = BATcopy(o, TYPE_void, o->ttype, TRUE); BATseqbase(c, ibase ); c->H->dense = 1; BATcommit(o); BATcommit(c); bat_set_access(c, BAT_READ); r = temp_create(c); bat_destroy(c); } else { c = ebats[o->ttype]; r = temp_create(c); } bat_destroy(o); return r; }
log_bid e_ubat(int type) { if (!eubats[type]) eubats[type] = bat_new(TYPE_oid, type, 0); return temp_create(eubats[type]); }
log_bid e_bat(int type) { if (!ebats[type]) ebats[type] = bat_new(TYPE_void, type, 0, TRANSIENT); return temp_create(ebats[type]); }
log_bid ebat2real(log_bid b, oid ibase) { /* make a copy of b */ BAT *o = temp_descriptor(b); BAT *c = BATcopy(o, TYPE_void, ATOMtype(o->ttype), TRUE); log_bid r; BATseqbase(c, ibase ); c->H->dense = 1; r = temp_create(c); bat_destroy(c); bat_destroy(o); return r; }
log_bid eubat_copy(log_bid b, int temp) { /* make a copy of b */ BAT *o = temp_descriptor(b); BAT *c; log_bid r; if (!eubats[o->ttype]) eubats[o->ttype] = bat_new(TYPE_oid, o->ttype, 0, TRANSIENT); if (!temp && BATcount(o)) { c = BATcopy(o, TYPE_oid, o->ttype, TRUE, PERSISTENT); BATcommit(c); r = temp_create(c); bat_set_access(c, BAT_READ); bat_destroy(c); } else { c = eubats[o->ttype]; r = temp_create(c); } bat_destroy(o); return r; }
log_bid temp_copy(log_bid b, int temp) { /* make a copy of b, if temp is set only create a empty bat */ BAT *o = temp_descriptor(b); BAT *c; log_bid r; if (!temp) { c = BATcopy(o, o->htype, o->ttype, TRUE); bat_set_access(c, BAT_READ); BATcommit(c); } else { c = bat_new(o->htype, o->ttype, COLSIZE); } r = temp_create(c); bat_destroy(c); bat_destroy(o); return r; }