834194a10ad846f3fd0bb2bc1eea5b0b5c029cd7 angie Wed Nov 18 23:38:39 2015 -0800 Interface change: removing setAutoSqlObject method from streamer and exposing annoGratorSetAutoSqlObject because asObj should never be externally imposed, but a streamer/grator may have a need to bootstrap itself without an asObj and then install one. refs #15544 diff --git src/lib/annoGrator.c src/lib/annoGrator.c index 413e484..1202044 100644 --- src/lib/annoGrator.c +++ src/lib/annoGrator.c @@ -258,61 +258,60 @@ annoStreamerAddFilters(vSelf, newFilters); struct annoGrator *self = (struct annoGrator *)vSelf; annoStreamerSetFilters(self->mySource, vSelf->filters); self->haveRJIncludeFilter = filtersHaveRJInclude(vSelf->filters); } void annoGratorSetRegion(struct annoStreamer *vSelf, char *chrom, uint rStart, uint rEnd) /* Set genomic region for query, and reset internal state. */ { annoStreamerSetRegion(vSelf, chrom, rStart, rEnd); struct annoGrator *self = (struct annoGrator *)vSelf; self->mySource->setRegion((struct annoStreamer *)(self->mySource), chrom, rStart, rEnd); agReset(self); } -static void agSetAutoSqlObject(struct annoStreamer *sSelf, struct asObject *asObj) -/* Use new asObj and update internal state derived from asObj. */ -{ -struct annoGrator *gSelf = (struct annoGrator *)sSelf; -annoStreamerSetAutoSqlObject(sSelf, asObj); -gSelf->haveRJIncludeFilter = filtersHaveRJInclude(sSelf->filters); -} - void agSetOverlapRule(struct annoGrator *self, enum annoGratorOverlap rule) /* Tell annoGrator how to handle overlap of its rows with primary row. */ { self->overlapRule = rule; } void annoGratorInit(struct annoGrator *self, struct annoStreamer *mySource) /* Initialize an integrator of columns from mySource with (positions of) * rows passed to integrate(). * mySource becomes property of the annoGrator. */ { struct annoStreamer *streamer = &(self->streamer); annoStreamerInit(streamer, mySource->assembly, mySource->getAutoSqlObject(mySource), mySource->name); streamer->rowType = mySource->rowType; -streamer->setAutoSqlObject = agSetAutoSqlObject; streamer->setFilters = agSetFilters; streamer->addFilters = agAddFilters; streamer->setRegion = annoGratorSetRegion; streamer->nextRow = noNextRow; streamer->close = annoGratorClose; self->qLm = lmInit(0); self->integrate = annoGratorIntegrate; self->setOverlapRule = agSetOverlapRule; self->overlapRule = agoNoConstraint; self->mySource = mySource; self->haveRJIncludeFilter = filtersHaveRJInclude(streamer->filters); } +void annoGratorSetAutoSqlObject(struct annoStreamer *sSelf, struct asObject *asObj) +/* Use new asObj and update internal state derived from asObj. */ +{ +struct annoGrator *gSelf = (struct annoGrator *)sSelf; +annoStreamerSetAutoSqlObject(sSelf, asObj); +gSelf->haveRJIncludeFilter = filtersHaveRJInclude(sSelf->filters); +} + struct annoGrator *annoGratorNew(struct annoStreamer *mySource) /* Make a new integrator of columns from mySource with (positions of) rows passed to integrate(). * mySource becomes property of the new annoGrator. */ { struct annoGrator *self; AllocVar(self); annoGratorInit(self, mySource); return self; }