IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 9, 2007, 5:14:16 PM (19 years ago)
Author:
jhoblitt
Message:

add flatcorr tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/src/ippdb.h

    r15569 r15576  
    1110511105    bool            mdcf                ///< format as mdconfig or simple
    1110611106);
     11107/** flatcorrRunRow data structure
     11108 *
     11109 * Structure for representing a single row of flatcorrRun table data.
     11110 */
     11111
     11112typedef struct {
     11113    psS64           corr_id;
     11114    char            *dvodb;
     11115    char            *state;
     11116    char            *workdir;
     11117    char            *label;
     11118} flatcorrRunRow;
     11119
     11120/** Creates a new flatcorrRunRow object
     11121 *
     11122 *  @return A new flatcorrRunRow object or NULL on failure.
     11123 */
     11124
     11125flatcorrRunRow *flatcorrRunRowAlloc(
     11126    psS64           corr_id,
     11127    const char      *dvodb,
     11128    const char      *state,
     11129    const char      *workdir,
     11130    const char      *label
     11131);
     11132
     11133/** Creates a new flatcorrRun table
     11134 *
     11135 * @return true on success
     11136 */
     11137
     11138bool flatcorrRunCreateTable(
     11139    psDB            *dbh                ///< Database handle
     11140);
     11141
     11142/** Deletes a flatcorrRun table
     11143 *
     11144 * @return true on success
     11145 */
     11146
     11147bool flatcorrRunDropTable(
     11148    psDB            *dbh                ///< Database handle
     11149);
     11150
     11151/** Insert a single row into a table
     11152 *
     11153 * This function constructs and inserts a single row based on it's parameters.
     11154 *
     11155 * @return true on success
     11156 */
     11157
     11158bool flatcorrRunInsert(
     11159    psDB            *dbh,               ///< Database handle
     11160    psS64           corr_id,
     11161    const char      *dvodb,
     11162    const char      *state,
     11163    const char      *workdir,
     11164    const char      *label
     11165);
     11166
     11167/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     11168 *
     11169 * @return A The number of rows removed or a negative value on error
     11170 */
     11171
     11172long long flatcorrRunDelete(
     11173    psDB            *dbh,               ///< Database handle
     11174    const psMetadata *where,            ///< Row match criteria
     11175    unsigned long long limit            ///< Maximum number of elements to delete
     11176);
     11177
     11178/** Insert a single flatcorrRunRow object into a table
     11179 *
     11180 * This function constructs and inserts a single row based on it's parameters.
     11181 *
     11182 * @return true on success
     11183 */
     11184
     11185bool flatcorrRunInsertObject(
     11186    psDB            *dbh,               ///< Database handle
     11187    flatcorrRunRow  *object             ///< flatcorrRunRow object
     11188);
     11189
     11190/** Insert an array of flatcorrRunRow object into a table
     11191 *
     11192 * This function constructs and inserts multiple rows based on it's parameters.
     11193 *
     11194 * @return true on success
     11195 */
     11196
     11197bool flatcorrRunInsertObjects(
     11198    psDB            *dbh,               ///< Database handle
     11199    psArray         *objects            ///< array of flatcorrRunRow objects
     11200);
     11201
     11202/** Insert data from a binary FITS table flatcorrRunRow into the database
     11203 *
     11204 * This function expects a psFits object with a FITS table as the first
     11205 * extension.  The table must have at least one row of data in it, that is of
     11206 * the appropriate format (number of columns and their type).  All other
     11207 * extensions are ignored.
     11208 *
     11209 * @return true on success
     11210 */
     11211
     11212bool flatcorrRunInsertFits(
     11213    psDB            *dbh,               ///< Database handle
     11214    const psFits    *fits               ///< psFits object
     11215);
     11216
     11217/** Selects up to limit from the database and returns them in a binary FITS table
     11218 *
     11219 * This function assumes an empty psFits object and will create a FITS table
     11220 * as the first extension.
     11221 *
     11222 *  See psDBSelectRows() for documentation on the format of where.
     11223 *
     11224 * @return true on success
     11225 */
     11226
     11227bool flatcorrRunSelectRowsFits(
     11228    psDB            *dbh,               ///< Database handle
     11229    psFits          *fits,              ///< psFits object
     11230    const psMetadata *where,            ///< Row match criteria
     11231    unsigned long long limit            ///< Maximum number of elements to return
     11232);
     11233
     11234/** Convert a flatcorrRunRow into an equivalent psMetadata
     11235 *
     11236 * @return A psMetadata pointer or NULL on error
     11237 */
     11238
     11239psMetadata *flatcorrRunMetadataFromObject(
     11240    const flatcorrRunRow *object             ///< fooRow to convert into a psMetadata
     11241);
     11242
     11243/** Convert a psMetadata into an equivalent fooRow
     11244 *
     11245 * @return A flatcorrRunRow pointer or NULL on error
     11246 */
     11247
     11248flatcorrRunRow *flatcorrRunObjectFromMetadata(
     11249    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     11250);
     11251/** Selects up to limit rows from the database and returns as flatcorrRunRow objects in a psArray
     11252 *
     11253 *  See psDBSelectRows() for documentation on the format of where.
     11254 *
     11255 * @return A psArray pointer or NULL on error
     11256 */
     11257
     11258psArray *flatcorrRunSelectRowObjects(
     11259    psDB            *dbh,               ///< Database handle
     11260    const psMetadata *where,            ///< Row match criteria
     11261    unsigned long long limit            ///< Maximum number of elements to return
     11262);
     11263/** Deletes a row from the database coresponding to an flatcorrRun
     11264 *
     11265 *  Note that a 'where' search psMetadata is constructed from each object and
     11266 *  used to find rows to delete.
     11267 *
     11268 * @return A The number of rows removed or a negative value on error
     11269 */
     11270
     11271bool flatcorrRunDeleteObject(
     11272    psDB            *dbh,               ///< Database handle
     11273    const flatcorrRunRow *object    ///< Object to delete
     11274);
     11275/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     11276 *
     11277 *  Note that a 'where' search psMetadata is constructed from each object and
     11278 *  used to find rows to delete.
     11279 *
     11280 * @return A The number of rows removed or a negative value on error
     11281 */
     11282
     11283long long flatcorrRunDeleteRowObjects(
     11284    psDB            *dbh,               ///< Database handle
     11285    const psArray   *objects,           ///< Array of objects to delete
     11286    unsigned long long limit            ///< Maximum number of elements to delete
     11287);
     11288/** Formats and prints an array of flatcorrRunRow objects
     11289 *
     11290 * When mdcf is set the formated output is in psMetadataConfig
     11291 * format, otherwise it is in a simple tabular format.
     11292 *
     11293 * @return true on success
     11294 */
     11295
     11296bool flatcorrRunPrintObjects(
     11297    FILE            *stream,            ///< a stream
     11298    psArray         *objects,           ///< An array of flatcorrRunRow objects
     11299    bool            mdcf                ///< format as mdconfig or simple
     11300);
     11301/** Formats and prints an flatcorrRunRow object
     11302 *
     11303 * When mdcf is set the formated output is in psMetadataConfig
     11304 * format, otherwise it is in a simple tabular format.
     11305 *
     11306 * @return true on success
     11307 */
     11308
     11309bool flatcorrRunPrintObject(
     11310    FILE            *stream,            ///< a stream
     11311    flatcorrRunRow *object,    ///< an flatcorrRunRow object
     11312    bool            mdcf                ///< format as mdconfig or simple
     11313);
     11314/** flatcorrExpRow data structure
     11315 *
     11316 * Structure for representing a single row of flatcorrExp table data.
     11317 */
     11318
     11319typedef struct {
     11320    psS64           corr_id;
     11321    psS64           chip_id;
     11322    char            *state;
     11323} flatcorrExpRow;
     11324
     11325/** Creates a new flatcorrExpRow object
     11326 *
     11327 *  @return A new flatcorrExpRow object or NULL on failure.
     11328 */
     11329
     11330flatcorrExpRow *flatcorrExpRowAlloc(
     11331    psS64           corr_id,
     11332    psS64           chip_id,
     11333    const char      *state
     11334);
     11335
     11336/** Creates a new flatcorrExp table
     11337 *
     11338 * @return true on success
     11339 */
     11340
     11341bool flatcorrExpCreateTable(
     11342    psDB            *dbh                ///< Database handle
     11343);
     11344
     11345/** Deletes a flatcorrExp table
     11346 *
     11347 * @return true on success
     11348 */
     11349
     11350bool flatcorrExpDropTable(
     11351    psDB            *dbh                ///< Database handle
     11352);
     11353
     11354/** Insert a single row into a table
     11355 *
     11356 * This function constructs and inserts a single row based on it's parameters.
     11357 *
     11358 * @return true on success
     11359 */
     11360
     11361bool flatcorrExpInsert(
     11362    psDB            *dbh,               ///< Database handle
     11363    psS64           corr_id,
     11364    psS64           chip_id,
     11365    const char      *state
     11366);
     11367
     11368/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     11369 *
     11370 * @return A The number of rows removed or a negative value on error
     11371 */
     11372
     11373long long flatcorrExpDelete(
     11374    psDB            *dbh,               ///< Database handle
     11375    const psMetadata *where,            ///< Row match criteria
     11376    unsigned long long limit            ///< Maximum number of elements to delete
     11377);
     11378
     11379/** Insert a single flatcorrExpRow object into a table
     11380 *
     11381 * This function constructs and inserts a single row based on it's parameters.
     11382 *
     11383 * @return true on success
     11384 */
     11385
     11386bool flatcorrExpInsertObject(
     11387    psDB            *dbh,               ///< Database handle
     11388    flatcorrExpRow  *object             ///< flatcorrExpRow object
     11389);
     11390
     11391/** Insert an array of flatcorrExpRow object into a table
     11392 *
     11393 * This function constructs and inserts multiple rows based on it's parameters.
     11394 *
     11395 * @return true on success
     11396 */
     11397
     11398bool flatcorrExpInsertObjects(
     11399    psDB            *dbh,               ///< Database handle
     11400    psArray         *objects            ///< array of flatcorrExpRow objects
     11401);
     11402
     11403/** Insert data from a binary FITS table flatcorrExpRow into the database
     11404 *
     11405 * This function expects a psFits object with a FITS table as the first
     11406 * extension.  The table must have at least one row of data in it, that is of
     11407 * the appropriate format (number of columns and their type).  All other
     11408 * extensions are ignored.
     11409 *
     11410 * @return true on success
     11411 */
     11412
     11413bool flatcorrExpInsertFits(
     11414    psDB            *dbh,               ///< Database handle
     11415    const psFits    *fits               ///< psFits object
     11416);
     11417
     11418/** Selects up to limit from the database and returns them in a binary FITS table
     11419 *
     11420 * This function assumes an empty psFits object and will create a FITS table
     11421 * as the first extension.
     11422 *
     11423 *  See psDBSelectRows() for documentation on the format of where.
     11424 *
     11425 * @return true on success
     11426 */
     11427
     11428bool flatcorrExpSelectRowsFits(
     11429    psDB            *dbh,               ///< Database handle
     11430    psFits          *fits,              ///< psFits object
     11431    const psMetadata *where,            ///< Row match criteria
     11432    unsigned long long limit            ///< Maximum number of elements to return
     11433);
     11434
     11435/** Convert a flatcorrExpRow into an equivalent psMetadata
     11436 *
     11437 * @return A psMetadata pointer or NULL on error
     11438 */
     11439
     11440psMetadata *flatcorrExpMetadataFromObject(
     11441    const flatcorrExpRow *object             ///< fooRow to convert into a psMetadata
     11442);
     11443
     11444/** Convert a psMetadata into an equivalent fooRow
     11445 *
     11446 * @return A flatcorrExpRow pointer or NULL on error
     11447 */
     11448
     11449flatcorrExpRow *flatcorrExpObjectFromMetadata(
     11450    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     11451);
     11452/** Selects up to limit rows from the database and returns as flatcorrExpRow objects in a psArray
     11453 *
     11454 *  See psDBSelectRows() for documentation on the format of where.
     11455 *
     11456 * @return A psArray pointer or NULL on error
     11457 */
     11458
     11459psArray *flatcorrExpSelectRowObjects(
     11460    psDB            *dbh,               ///< Database handle
     11461    const psMetadata *where,            ///< Row match criteria
     11462    unsigned long long limit            ///< Maximum number of elements to return
     11463);
     11464/** Deletes a row from the database coresponding to an flatcorrExp
     11465 *
     11466 *  Note that a 'where' search psMetadata is constructed from each object and
     11467 *  used to find rows to delete.
     11468 *
     11469 * @return A The number of rows removed or a negative value on error
     11470 */
     11471
     11472bool flatcorrExpDeleteObject(
     11473    psDB            *dbh,               ///< Database handle
     11474    const flatcorrExpRow *object    ///< Object to delete
     11475);
     11476/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     11477 *
     11478 *  Note that a 'where' search psMetadata is constructed from each object and
     11479 *  used to find rows to delete.
     11480 *
     11481 * @return A The number of rows removed or a negative value on error
     11482 */
     11483
     11484long long flatcorrExpDeleteRowObjects(
     11485    psDB            *dbh,               ///< Database handle
     11486    const psArray   *objects,           ///< Array of objects to delete
     11487    unsigned long long limit            ///< Maximum number of elements to delete
     11488);
     11489/** Formats and prints an array of flatcorrExpRow objects
     11490 *
     11491 * When mdcf is set the formated output is in psMetadataConfig
     11492 * format, otherwise it is in a simple tabular format.
     11493 *
     11494 * @return true on success
     11495 */
     11496
     11497bool flatcorrExpPrintObjects(
     11498    FILE            *stream,            ///< a stream
     11499    psArray         *objects,           ///< An array of flatcorrExpRow objects
     11500    bool            mdcf                ///< format as mdconfig or simple
     11501);
     11502/** Formats and prints an flatcorrExpRow object
     11503 *
     11504 * When mdcf is set the formated output is in psMetadataConfig
     11505 * format, otherwise it is in a simple tabular format.
     11506 *
     11507 * @return true on success
     11508 */
     11509
     11510bool flatcorrExpPrintObject(
     11511    FILE            *stream,            ///< a stream
     11512    flatcorrExpRow *object,    ///< an flatcorrExpRow object
     11513    bool            mdcf                ///< format as mdconfig or simple
     11514);
    1110711515
    1110811516/// @}
     
    1111211520#endif
    1111311521
    11114 #endif // CALRUN_DB_H
     11522#endif // FLATCORREXP_DB_H
Note: See TracChangeset for help on using the changeset viewer.