466bcfa4fd1e55b3567ea169b71f8ba7e7e3be89 angie Mon Feb 11 10:04:05 2013 -0800 Added setAutoSqlObject method to annoStreamer, to update both asObj andinternal state derived from it. (for #6152) diff --git src/inc/annoStreamer.h src/inc/annoStreamer.h index 6024482..ac4f448 100644 --- src/inc/annoStreamer.h +++ src/inc/annoStreamer.h @@ -13,31 +13,32 @@ // annoGratorQuery framework, and simple methods shared by all // subclasses. // stub in order to avoid problems with circular .h references: struct annoGratorQuery; struct annoStreamer /* Generic interface to configure a data source's filters and output data, and then * retrieve data, which must be sorted by genomic position. Subclasses of this * will do all the actual work. */ { struct annoStreamer *next; // Public methods struct asObject *(*getAutoSqlObject)(struct annoStreamer *self); - /* Get autoSql representation (do not modify or free!) */ + void (*setAutoSqlObject)(struct annoStreamer *self, struct asObject *asObj); + /* Get and set autoSql representation (do not modify or free!) */ void (*setRegion)(struct annoStreamer *self, char *chrom, uint rStart, uint rEnd); /* Set genomic region for query (should be called only by annoGratorQuerySetRegion) */ char *(*getHeader)(struct annoStreamer *self); /* Get the file header as a string (possibly NULL, possibly multi-line). */ struct annoFilter *(*getFilters)(struct annoStreamer *self); void (*setFilters)(struct annoStreamer *self, struct annoFilter *newFilters); /* Get and set filters */ struct annoColumn *(*getColumns)(struct annoStreamer *self); void (*setColumns)(struct annoStreamer *self, struct annoColumn *newColumns); /* Get and set output fields */ @@ -58,30 +59,33 @@ struct annoColumn *columns; // Private members -- callers are on the honor system to access these using only methods above. boolean positionIsGenome; char *chrom; uint regionStart; uint regionEnd; struct asObject *asObj; }; // ---------------------- annoStreamer default methods ----------------------- struct asObject *annoStreamerGetAutoSqlObject(struct annoStreamer *self); /* Return parsed autoSql definition of this streamer's data type. */ +void annoStreamerSetAutoSqlObject(struct annoStreamer *self, struct asObject *asObj); +/* Use new asObj and update internal state derived from asObj. */ + void annoStreamerSetRegion(struct annoStreamer *self, char *chrom, uint rStart, uint rEnd); /* Set genomic region for query; if chrom is NULL, position is genome. * Many subclasses should make their own setRegion method that calls this and * configures their data connection to change to the new position. */ struct annoFilter *annoStreamerGetFilters(struct annoStreamer *self); /* Return supported filters with current settings. Callers can modify and free when done. */ void annoStreamerSetFilters(struct annoStreamer *self, struct annoFilter *newFilters); /* Free old filters and use clone of newFilters. */ struct annoColumn *annoStreamerGetColumns(struct annoStreamer *self); /* Return supported columns with current settings. Callers can modify and free when done. */ void annoStreamerSetColumns(struct annoStreamer *self, struct annoColumn *columns);