85be21057a058a0bdb12caac2bae553376442f5a angie Mon Apr 15 10:56:28 2013 -0700 Refactoring to remove dependencies on annoGratorQuery from streamers,grators and formatters. Instead, provide basic assembly info and explicitly pass streamers(/grators) along with the rows that they produced into formatters. ref #6152 diff --git src/lib/annoStreamer.c src/lib/annoStreamer.c index cb2b591..b895361 100644 --- src/lib/annoStreamer.c +++ src/lib/annoStreamer.c @@ -62,51 +62,46 @@ } struct annoColumn *annoStreamerGetColumns(struct annoStreamer *self) /* Return supported columns with current settings. Callers can modify and free when done. */ { return annoColumnCloneList(self->columns); } void annoStreamerSetColumns(struct annoStreamer *self, struct annoColumn *newColumns) /* Free old columns and use clone of newColumns. */ { annoColumnFreeList(&(self->columns)); self->columns = annoColumnCloneList(newColumns); } -void annoStreamerSetQuery(struct annoStreamer *self, struct annoGratorQuery *query) -/* Set query (to be called only by annoGratorQuery which is created after streamers). */ -{ -self->query = query; -} - -void annoStreamerInit(struct annoStreamer *self, struct asObject *asObj) +void annoStreamerInit(struct annoStreamer *self, struct annoAssembly *assembly, + struct asObject *asObj) /* Initialize a newly allocated annoStreamer with default annoStreamer methods and * default filters and columns based on asObj. * In general, subclasses' constructors will call this first; override nextRow, close, - * and probably setRegion and setQuery; and then initialize their private data. */ + * and probably setRegion; and then initialize their private data. */ { +self->assembly = assembly; self->getAutoSqlObject = annoStreamerGetAutoSqlObject; self->setAutoSqlObject = annoStreamerSetAutoSqlObject; self->setRegion = annoStreamerSetRegion; self->getHeader = annoStreamerGetHeader; self->getFilters = annoStreamerGetFilters; self->setFilters = annoStreamerSetFilters; self->getColumns = annoStreamerGetColumns; self->setColumns = annoStreamerSetColumns; -self->setQuery = annoStreamerSetQuery; self->positionIsGenome = TRUE; self->setAutoSqlObject(self, asObj); } void annoStreamerFree(struct annoStreamer **pSelf) /* Free self. This should be called at the end of subclass close methods, after * subclass-specific connections are closed and resources are freed. */ { if (pSelf == NULL) return; struct annoStreamer *self = *pSelf; freez(&(self->chrom)); annoFilterFreeList(&(self->filters)); annoColumnFreeList(&(self->columns)); freez(pSelf);