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/annoFormatter.c src/lib/annoFormatter.c index 34525bf..ae8b3b6 100644 --- src/lib/annoFormatter.c +++ src/lib/annoFormatter.c @@ -1,26 +1,39 @@ /* annoFormatter -- aggregates, formats and writes output from multiple sources */ #include "annoFormatter.h" struct annoOption *annoFormatterGetOptions(struct annoFormatter *self) /* Return supported options and current settings. Callers can modify and free when done. */ { return annoOptionCloneList(self->options); } void annoFormatterSetOptions(struct annoFormatter *self, struct annoOption *newOptions) /* Free old options and use clone of newOptions. */ { annoOptionFreeList(&(self->options)); self->options = annoOptionCloneList(newOptions); } void annoFormatterFree(struct annoFormatter **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; annoOptionFreeList(&((*pSelf)->options)); freez(pSelf); } + +struct annoStreamRows *annoStreamRowsNew(struct annoStreamer *streamerList) +/* Return an array of aS&R for each streamer in streamerList. */ +{ +int streamerCount = slCount(streamerList); +struct annoStreamRows *data = NULL; +AllocArray(data, streamerCount); +struct annoStreamer *streamer = streamerList; +int i = 0; +for (; i < streamerCount; i++, streamer = streamer->next) + data[i].streamer = streamer; +return data; +}