Changeset 11780 for trunk/ippdb/src/ippdb.h
- Timestamp:
- Feb 13, 2007, 12:33:39 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippdb/src/ippdb.h (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/src/ippdb.h
r11733 r11780 6836 6836 6837 6837 typedef struct { 6838 psS32 p4 a_id;6838 psS32 p4_id; 6839 6839 char *mode; 6840 6840 char *state; … … 6849 6849 6850 6850 p4RunRow *p4RunRowAlloc( 6851 psS32 p4 a_id,6851 psS32 p4_id, 6852 6852 const char *mode, 6853 6853 const char *state, … … 6883 6883 bool p4RunInsert( 6884 6884 psDB *dbh, ///< Database handle 6885 psS32 p4 a_id,6885 psS32 p4_id, 6886 6886 const char *mode, 6887 6887 const char *state, … … 7043 7043 7044 7044 typedef struct { 7045 psS32 p4 a_id;7045 psS32 p4_id; 7046 7046 char *exp_tag; 7047 7047 psS32 p3_version; … … 7055 7055 7056 7056 p4InputExpRow *p4InputExpRowAlloc( 7057 psS32 p4 a_id,7057 psS32 p4_id, 7058 7058 const char *exp_tag, 7059 7059 psS32 p3_version, … … 7088 7088 bool p4InputExpInsert( 7089 7089 psDB *dbh, ///< Database handle 7090 psS32 p4 a_id,7090 psS32 p4_id, 7091 7091 const char *exp_tag, 7092 7092 psS32 p3_version, … … 7241 7241 bool mdcf ///< format as mdconfig or simple 7242 7242 ); 7243 /** p4SkyCellMapRow data structure 7244 * 7245 * Structure for representing a single row of p4SkyCellMap table data. 7246 */ 7247 7248 typedef struct { 7249 psS32 p4_id; 7250 char *skycell_id; 7251 char *tess_id; 7252 char *exp_tag; 7253 psS32 p3_version; 7254 char *class_id; 7255 } p4SkyCellMapRow; 7256 7257 /** Creates a new p4SkyCellMapRow object 7258 * 7259 * @return A new p4SkyCellMapRow object or NULL on failure. 7260 */ 7261 7262 p4SkyCellMapRow *p4SkyCellMapRowAlloc( 7263 psS32 p4_id, 7264 const char *skycell_id, 7265 const char *tess_id, 7266 const char *exp_tag, 7267 psS32 p3_version, 7268 const char *class_id 7269 ); 7270 7271 /** Creates a new p4SkyCellMap table 7272 * 7273 * @return true on success 7274 */ 7275 7276 bool p4SkyCellMapCreateTable( 7277 psDB *dbh ///< Database handle 7278 ); 7279 7280 /** Deletes a p4SkyCellMap table 7281 * 7282 * @return true on success 7283 */ 7284 7285 bool p4SkyCellMapDropTable( 7286 psDB *dbh ///< Database handle 7287 ); 7288 7289 /** Insert a single row into a table 7290 * 7291 * This function constructs and inserts a single row based on it's parameters. 7292 * 7293 * @return true on success 7294 */ 7295 7296 bool p4SkyCellMapInsert( 7297 psDB *dbh, ///< Database handle 7298 psS32 p4_id, 7299 const char *skycell_id, 7300 const char *tess_id, 7301 const char *exp_tag, 7302 psS32 p3_version, 7303 const char *class_id 7304 ); 7305 7306 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 7307 * 7308 * @return A The number of rows removed or a negative value on error 7309 */ 7310 7311 long long p4SkyCellMapDelete( 7312 psDB *dbh, ///< Database handle 7313 const psMetadata *where, ///< Row match criteria 7314 unsigned long long limit ///< Maximum number of elements to delete 7315 ); 7316 7317 /** Insert a single p4SkyCellMapRow object into a table 7318 * 7319 * This function constructs and inserts a single row based on it's parameters. 7320 * 7321 * @return true on success 7322 */ 7323 7324 bool p4SkyCellMapInsertObject( 7325 psDB *dbh, ///< Database handle 7326 p4SkyCellMapRow *object ///< p4SkyCellMapRow object 7327 ); 7328 7329 /** Insert an array of p4SkyCellMapRow object into a table 7330 * 7331 * This function constructs and inserts multiple rows based on it's parameters. 7332 * 7333 * @return true on success 7334 */ 7335 7336 bool p4SkyCellMapInsertObjects( 7337 psDB *dbh, ///< Database handle 7338 psArray *objects ///< array of p4SkyCellMapRow objects 7339 ); 7340 7341 /** Insert data from a binary FITS table p4SkyCellMapRow into the database 7342 * 7343 * This function expects a psFits object with a FITS table as the first 7344 * extension. The table must have at least one row of data in it, that is of 7345 * the appropriate format (number of columns and their type). All other 7346 * extensions are ignored. 7347 * 7348 * @return true on success 7349 */ 7350 7351 bool p4SkyCellMapInsertFits( 7352 psDB *dbh, ///< Database handle 7353 const psFits *fits ///< psFits object 7354 ); 7355 7356 /** Selects up to limit from the database and returns them in a binary FITS table 7357 * 7358 * This function assumes an empty psFits object and will create a FITS table 7359 * as the first extension. 7360 * 7361 * See psDBSelectRows() for documentation on the format of where. 7362 * 7363 * @return true on success 7364 */ 7365 7366 bool p4SkyCellMapSelectRowsFits( 7367 psDB *dbh, ///< Database handle 7368 psFits *fits, ///< psFits object 7369 const psMetadata *where, ///< Row match criteria 7370 unsigned long long limit ///< Maximum number of elements to return 7371 ); 7372 7373 /** Convert a p4SkyCellMapRow into an equivalent psMetadata 7374 * 7375 * @return A psMetadata pointer or NULL on error 7376 */ 7377 7378 psMetadata *p4SkyCellMapMetadataFromObject( 7379 const p4SkyCellMapRow *object ///< fooRow to convert into a psMetadata 7380 ); 7381 7382 /** Convert a psMetadata into an equivalent fooRow 7383 * 7384 * @return A p4SkyCellMapRow pointer or NULL on error 7385 */ 7386 7387 p4SkyCellMapRow *p4SkyCellMapObjectFromMetadata( 7388 psMetadata *md ///< psMetadata to convert into a fooRow 7389 ); 7390 /** Selects up to limit rows from the database and returns as p4SkyCellMapRow objects in a psArray 7391 * 7392 * See psDBSelectRows() for documentation on the format of where. 7393 * 7394 * @return A psArray pointer or NULL on error 7395 */ 7396 7397 psArray *p4SkyCellMapSelectRowObjects( 7398 psDB *dbh, ///< Database handle 7399 const psMetadata *where, ///< Row match criteria 7400 unsigned long long limit ///< Maximum number of elements to return 7401 ); 7402 /** Deletes a row from the database coresponding to an p4SkyCellMap 7403 * 7404 * Note that a 'where' search psMetadata is constructed from each object and 7405 * used to find rows to delete. 7406 * 7407 * @return A The number of rows removed or a negative value on error 7408 */ 7409 7410 bool p4SkyCellMapDeleteObject( 7411 psDB *dbh, ///< Database handle 7412 const p4SkyCellMapRow *object ///< Object to delete 7413 ); 7414 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 7415 * 7416 * Note that a 'where' search psMetadata is constructed from each object and 7417 * used to find rows to delete. 7418 * 7419 * @return A The number of rows removed or a negative value on error 7420 */ 7421 7422 long long p4SkyCellMapDeleteRowObjects( 7423 psDB *dbh, ///< Database handle 7424 const psArray *objects, ///< Array of objects to delete 7425 unsigned long long limit ///< Maximum number of elements to delete 7426 ); 7427 /** Formats and prints an array of p4SkyCellMapRow objects 7428 * 7429 * When mdcf is set the formated output is in psMetadataConfig 7430 * format, otherwise it is in a simple tabular format. 7431 * 7432 * @return true on success 7433 */ 7434 7435 bool p4SkyCellMapPrintObjects( 7436 FILE *stream, ///< a stream 7437 psArray *objects, ///< An array of p4SkyCellMapRow objects 7438 bool mdcf ///< format as mdconfig or simple 7439 ); 7440 /** Formats and prints an p4SkyCellMapRow object 7441 * 7442 * When mdcf is set the formated output is in psMetadataConfig 7443 * format, otherwise it is in a simple tabular format. 7444 * 7445 * @return true on success 7446 */ 7447 7448 bool p4SkyCellMapPrintObject( 7449 FILE *stream, ///< a stream 7450 p4SkyCellMapRow *object, ///< an p4SkyCellMapRow object 7451 bool mdcf ///< format as mdconfig or simple 7452 ); 7243 7453 /** p4ScfileRow data structure 7244 7454 * … … 7247 7457 7248 7458 typedef struct { 7249 psS32 p4 a_id;7459 psS32 p4_id; 7250 7460 char *skycell_id; 7251 7461 char *tess_id; … … 7263 7473 7264 7474 p4ScfileRow *p4ScfileRowAlloc( 7265 psS32 p4 a_id,7475 psS32 p4_id, 7266 7476 const char *skycell_id, 7267 7477 const char *tess_id, … … 7300 7510 bool p4ScfileInsert( 7301 7511 psDB *dbh, ///< Database handle 7302 psS32 p4 a_id,7512 psS32 p4_id, 7303 7513 const char *skycell_id, 7304 7514 const char *tess_id, … … 7457 7667 bool mdcf ///< format as mdconfig or simple 7458 7668 ); 7459 /** p4InputScfileRow data structure7460 *7461 * Structure for representing a single row of p4InputScfile table data.7462 */7463 7464 typedef struct {7465 psS32 p4b_id;7466 char *skycell_id;7467 char *tess_id;7468 char *exp_tag;7469 psS32 p3_version;7470 char *kind;7471 } p4InputScfileRow;7472 7473 /** Creates a new p4InputScfileRow object7474 *7475 * @return A new p4InputScfileRow object or NULL on failure.7476 */7477 7478 p4InputScfileRow *p4InputScfileRowAlloc(7479 psS32 p4b_id,7480 const char *skycell_id,7481 const char *tess_id,7482 const char *exp_tag,7483 psS32 p3_version,7484 const char *kind7485 );7486 7487 /** Creates a new p4InputScfile table7488 *7489 * @return true on success7490 */7491 7492 bool p4InputScfileCreateTable(7493 psDB *dbh ///< Database handle7494 );7495 7496 /** Deletes a p4InputScfile table7497 *7498 * @return true on success7499 */7500 7501 bool p4InputScfileDropTable(7502 psDB *dbh ///< Database handle7503 );7504 7505 /** Insert a single row into a table7506 *7507 * This function constructs and inserts a single row based on it's parameters.7508 *7509 * @return true on success7510 */7511 7512 bool p4InputScfileInsert(7513 psDB *dbh, ///< Database handle7514 psS32 p4b_id,7515 const char *skycell_id,7516 const char *tess_id,7517 const char *exp_tag,7518 psS32 p3_version,7519 const char *kind7520 );7521 7522 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7523 *7524 * @return A The number of rows removed or a negative value on error7525 */7526 7527 long long p4InputScfileDelete(7528 psDB *dbh, ///< Database handle7529 const psMetadata *where, ///< Row match criteria7530 unsigned long long limit ///< Maximum number of elements to delete7531 );7532 7533 /** Insert a single p4InputScfileRow object into a table7534 *7535 * This function constructs and inserts a single row based on it's parameters.7536 *7537 * @return true on success7538 */7539 7540 bool p4InputScfileInsertObject(7541 psDB *dbh, ///< Database handle7542 p4InputScfileRow *object ///< p4InputScfileRow object7543 );7544 7545 /** Insert an array of p4InputScfileRow object into a table7546 *7547 * This function constructs and inserts multiple rows based on it's parameters.7548 *7549 * @return true on success7550 */7551 7552 bool p4InputScfileInsertObjects(7553 psDB *dbh, ///< Database handle7554 psArray *objects ///< array of p4InputScfileRow objects7555 );7556 7557 /** Insert data from a binary FITS table p4InputScfileRow into the database7558 *7559 * This function expects a psFits object with a FITS table as the first7560 * extension. The table must have at least one row of data in it, that is of7561 * the appropriate format (number of columns and their type). All other7562 * extensions are ignored.7563 *7564 * @return true on success7565 */7566 7567 bool p4InputScfileInsertFits(7568 psDB *dbh, ///< Database handle7569 const psFits *fits ///< psFits object7570 );7571 7572 /** Selects up to limit from the database and returns them in a binary FITS table7573 *7574 * This function assumes an empty psFits object and will create a FITS table7575 * as the first extension.7576 *7577 * See psDBSelectRows() for documentation on the format of where.7578 *7579 * @return true on success7580 */7581 7582 bool p4InputScfileSelectRowsFits(7583 psDB *dbh, ///< Database handle7584 psFits *fits, ///< psFits object7585 const psMetadata *where, ///< Row match criteria7586 unsigned long long limit ///< Maximum number of elements to return7587 );7588 7589 /** Convert a p4InputScfileRow into an equivalent psMetadata7590 *7591 * @return A psMetadata pointer or NULL on error7592 */7593 7594 psMetadata *p4InputScfileMetadataFromObject(7595 const p4InputScfileRow *object ///< fooRow to convert into a psMetadata7596 );7597 7598 /** Convert a psMetadata into an equivalent fooRow7599 *7600 * @return A p4InputScfileRow pointer or NULL on error7601 */7602 7603 p4InputScfileRow *p4InputScfileObjectFromMetadata(7604 psMetadata *md ///< psMetadata to convert into a fooRow7605 );7606 /** Selects up to limit rows from the database and returns as p4InputScfileRow objects in a psArray7607 *7608 * See psDBSelectRows() for documentation on the format of where.7609 *7610 * @return A psArray pointer or NULL on error7611 */7612 7613 psArray *p4InputScfileSelectRowObjects(7614 psDB *dbh, ///< Database handle7615 const psMetadata *where, ///< Row match criteria7616 unsigned long long limit ///< Maximum number of elements to return7617 );7618 /** Deletes a row from the database coresponding to an p4InputScfile7619 *7620 * Note that a 'where' search psMetadata is constructed from each object and7621 * used to find rows to delete.7622 *7623 * @return A The number of rows removed or a negative value on error7624 */7625 7626 bool p4InputScfileDeleteObject(7627 psDB *dbh, ///< Database handle7628 const p4InputScfileRow *object ///< Object to delete7629 );7630 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7631 *7632 * Note that a 'where' search psMetadata is constructed from each object and7633 * used to find rows to delete.7634 *7635 * @return A The number of rows removed or a negative value on error7636 */7637 7638 long long p4InputScfileDeleteRowObjects(7639 psDB *dbh, ///< Database handle7640 const psArray *objects, ///< Array of objects to delete7641 unsigned long long limit ///< Maximum number of elements to delete7642 );7643 /** Formats and prints an array of p4InputScfileRow objects7644 *7645 * When mdcf is set the formated output is in psMetadataConfig7646 * format, otherwise it is in a simple tabular format.7647 *7648 * @return true on success7649 */7650 7651 bool p4InputScfilePrintObjects(7652 FILE *stream, ///< a stream7653 psArray *objects, ///< An array of p4InputScfileRow objects7654 bool mdcf ///< format as mdconfig or simple7655 );7656 /** Formats and prints an p4InputScfileRow object7657 *7658 * When mdcf is set the formated output is in psMetadataConfig7659 * format, otherwise it is in a simple tabular format.7660 *7661 * @return true on success7662 */7663 7664 bool p4InputScfilePrintObject(7665 FILE *stream, ///< a stream7666 p4InputScfileRow *object, ///< an p4InputScfileRow object7667 bool mdcf ///< format as mdconfig or simple7668 );7669 /** p4DiffScfileRow data structure7670 *7671 * Structure for representing a single row of p4DiffScfile table data.7672 */7673 7674 typedef struct {7675 psS32 p4b_id;7676 char *skycell_id;7677 char *tess_id;7678 char *exp_tag;7679 psS32 p3_version;7680 char *uri;7681 psF64 bg;7682 psF64 bg_mean_stdev;7683 } p4DiffScfileRow;7684 7685 /** Creates a new p4DiffScfileRow object7686 *7687 * @return A new p4DiffScfileRow object or NULL on failure.7688 */7689 7690 p4DiffScfileRow *p4DiffScfileRowAlloc(7691 psS32 p4b_id,7692 const char *skycell_id,7693 const char *tess_id,7694 const char *exp_tag,7695 psS32 p3_version,7696 const char *uri,7697 psF64 bg,7698 psF64 bg_mean_stdev7699 );7700 7701 /** Creates a new p4DiffScfile table7702 *7703 * @return true on success7704 */7705 7706 bool p4DiffScfileCreateTable(7707 psDB *dbh ///< Database handle7708 );7709 7710 /** Deletes a p4DiffScfile table7711 *7712 * @return true on success7713 */7714 7715 bool p4DiffScfileDropTable(7716 psDB *dbh ///< Database handle7717 );7718 7719 /** Insert a single row into a table7720 *7721 * This function constructs and inserts a single row based on it's parameters.7722 *7723 * @return true on success7724 */7725 7726 bool p4DiffScfileInsert(7727 psDB *dbh, ///< Database handle7728 psS32 p4b_id,7729 const char *skycell_id,7730 const char *tess_id,7731 const char *exp_tag,7732 psS32 p3_version,7733 const char *uri,7734 psF64 bg,7735 psF64 bg_mean_stdev7736 );7737 7738 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7739 *7740 * @return A The number of rows removed or a negative value on error7741 */7742 7743 long long p4DiffScfileDelete(7744 psDB *dbh, ///< Database handle7745 const psMetadata *where, ///< Row match criteria7746 unsigned long long limit ///< Maximum number of elements to delete7747 );7748 7749 /** Insert a single p4DiffScfileRow object into a table7750 *7751 * This function constructs and inserts a single row based on it's parameters.7752 *7753 * @return true on success7754 */7755 7756 bool p4DiffScfileInsertObject(7757 psDB *dbh, ///< Database handle7758 p4DiffScfileRow *object ///< p4DiffScfileRow object7759 );7760 7761 /** Insert an array of p4DiffScfileRow object into a table7762 *7763 * This function constructs and inserts multiple rows based on it's parameters.7764 *7765 * @return true on success7766 */7767 7768 bool p4DiffScfileInsertObjects(7769 psDB *dbh, ///< Database handle7770 psArray *objects ///< array of p4DiffScfileRow objects7771 );7772 7773 /** Insert data from a binary FITS table p4DiffScfileRow into the database7774 *7775 * This function expects a psFits object with a FITS table as the first7776 * extension. The table must have at least one row of data in it, that is of7777 * the appropriate format (number of columns and their type). All other7778 * extensions are ignored.7779 *7780 * @return true on success7781 */7782 7783 bool p4DiffScfileInsertFits(7784 psDB *dbh, ///< Database handle7785 const psFits *fits ///< psFits object7786 );7787 7788 /** Selects up to limit from the database and returns them in a binary FITS table7789 *7790 * This function assumes an empty psFits object and will create a FITS table7791 * as the first extension.7792 *7793 * See psDBSelectRows() for documentation on the format of where.7794 *7795 * @return true on success7796 */7797 7798 bool p4DiffScfileSelectRowsFits(7799 psDB *dbh, ///< Database handle7800 psFits *fits, ///< psFits object7801 const psMetadata *where, ///< Row match criteria7802 unsigned long long limit ///< Maximum number of elements to return7803 );7804 7805 /** Convert a p4DiffScfileRow into an equivalent psMetadata7806 *7807 * @return A psMetadata pointer or NULL on error7808 */7809 7810 psMetadata *p4DiffScfileMetadataFromObject(7811 const p4DiffScfileRow *object ///< fooRow to convert into a psMetadata7812 );7813 7814 /** Convert a psMetadata into an equivalent fooRow7815 *7816 * @return A p4DiffScfileRow pointer or NULL on error7817 */7818 7819 p4DiffScfileRow *p4DiffScfileObjectFromMetadata(7820 psMetadata *md ///< psMetadata to convert into a fooRow7821 );7822 /** Selects up to limit rows from the database and returns as p4DiffScfileRow objects in a psArray7823 *7824 * See psDBSelectRows() for documentation on the format of where.7825 *7826 * @return A psArray pointer or NULL on error7827 */7828 7829 psArray *p4DiffScfileSelectRowObjects(7830 psDB *dbh, ///< Database handle7831 const psMetadata *where, ///< Row match criteria7832 unsigned long long limit ///< Maximum number of elements to return7833 );7834 /** Deletes a row from the database coresponding to an p4DiffScfile7835 *7836 * Note that a 'where' search psMetadata is constructed from each object and7837 * used to find rows to delete.7838 *7839 * @return A The number of rows removed or a negative value on error7840 */7841 7842 bool p4DiffScfileDeleteObject(7843 psDB *dbh, ///< Database handle7844 const p4DiffScfileRow *object ///< Object to delete7845 );7846 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7847 *7848 * Note that a 'where' search psMetadata is constructed from each object and7849 * used to find rows to delete.7850 *7851 * @return A The number of rows removed or a negative value on error7852 */7853 7854 long long p4DiffScfileDeleteRowObjects(7855 psDB *dbh, ///< Database handle7856 const psArray *objects, ///< Array of objects to delete7857 unsigned long long limit ///< Maximum number of elements to delete7858 );7859 /** Formats and prints an array of p4DiffScfileRow objects7860 *7861 * When mdcf is set the formated output is in psMetadataConfig7862 * format, otherwise it is in a simple tabular format.7863 *7864 * @return true on success7865 */7866 7867 bool p4DiffScfilePrintObjects(7868 FILE *stream, ///< a stream7869 psArray *objects, ///< An array of p4DiffScfileRow objects7870 bool mdcf ///< format as mdconfig or simple7871 );7872 /** Formats and prints an p4DiffScfileRow object7873 *7874 * When mdcf is set the formated output is in psMetadataConfig7875 * format, otherwise it is in a simple tabular format.7876 *7877 * @return true on success7878 */7879 7880 bool p4DiffScfilePrintObject(7881 FILE *stream, ///< a stream7882 p4DiffScfileRow *object, ///< an p4DiffScfileRow object7883 bool mdcf ///< format as mdconfig or simple7884 );7885 /** p4MagicMaskImfileRow data structure7886 *7887 * Structure for representing a single row of p4MagicMaskImfile table data.7888 */7889 7890 typedef struct {7891 psS32 p4c_id;7892 char *exp_tag;7893 psS32 p3_version;7894 char *class_id;7895 char *uri;7896 } p4MagicMaskImfileRow;7897 7898 /** Creates a new p4MagicMaskImfileRow object7899 *7900 * @return A new p4MagicMaskImfileRow object or NULL on failure.7901 */7902 7903 p4MagicMaskImfileRow *p4MagicMaskImfileRowAlloc(7904 psS32 p4c_id,7905 const char *exp_tag,7906 psS32 p3_version,7907 const char *class_id,7908 const char *uri7909 );7910 7911 /** Creates a new p4MagicMaskImfile table7912 *7913 * @return true on success7914 */7915 7916 bool p4MagicMaskImfileCreateTable(7917 psDB *dbh ///< Database handle7918 );7919 7920 /** Deletes a p4MagicMaskImfile table7921 *7922 * @return true on success7923 */7924 7925 bool p4MagicMaskImfileDropTable(7926 psDB *dbh ///< Database handle7927 );7928 7929 /** Insert a single row into a table7930 *7931 * This function constructs and inserts a single row based on it's parameters.7932 *7933 * @return true on success7934 */7935 7936 bool p4MagicMaskImfileInsert(7937 psDB *dbh, ///< Database handle7938 psS32 p4c_id,7939 const char *exp_tag,7940 psS32 p3_version,7941 const char *class_id,7942 const char *uri7943 );7944 7945 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7946 *7947 * @return A The number of rows removed or a negative value on error7948 */7949 7950 long long p4MagicMaskImfileDelete(7951 psDB *dbh, ///< Database handle7952 const psMetadata *where, ///< Row match criteria7953 unsigned long long limit ///< Maximum number of elements to delete7954 );7955 7956 /** Insert a single p4MagicMaskImfileRow object into a table7957 *7958 * This function constructs and inserts a single row based on it's parameters.7959 *7960 * @return true on success7961 */7962 7963 bool p4MagicMaskImfileInsertObject(7964 psDB *dbh, ///< Database handle7965 p4MagicMaskImfileRow *object ///< p4MagicMaskImfileRow object7966 );7967 7968 /** Insert an array of p4MagicMaskImfileRow object into a table7969 *7970 * This function constructs and inserts multiple rows based on it's parameters.7971 *7972 * @return true on success7973 */7974 7975 bool p4MagicMaskImfileInsertObjects(7976 psDB *dbh, ///< Database handle7977 psArray *objects ///< array of p4MagicMaskImfileRow objects7978 );7979 7980 /** Insert data from a binary FITS table p4MagicMaskImfileRow into the database7981 *7982 * This function expects a psFits object with a FITS table as the first7983 * extension. The table must have at least one row of data in it, that is of7984 * the appropriate format (number of columns and their type). All other7985 * extensions are ignored.7986 *7987 * @return true on success7988 */7989 7990 bool p4MagicMaskImfileInsertFits(7991 psDB *dbh, ///< Database handle7992 const psFits *fits ///< psFits object7993 );7994 7995 /** Selects up to limit from the database and returns them in a binary FITS table7996 *7997 * This function assumes an empty psFits object and will create a FITS table7998 * as the first extension.7999 *8000 * See psDBSelectRows() for documentation on the format of where.8001 *8002 * @return true on success8003 */8004 8005 bool p4MagicMaskImfileSelectRowsFits(8006 psDB *dbh, ///< Database handle8007 psFits *fits, ///< psFits object8008 const psMetadata *where, ///< Row match criteria8009 unsigned long long limit ///< Maximum number of elements to return8010 );8011 8012 /** Convert a p4MagicMaskImfileRow into an equivalent psMetadata8013 *8014 * @return A psMetadata pointer or NULL on error8015 */8016 8017 psMetadata *p4MagicMaskImfileMetadataFromObject(8018 const p4MagicMaskImfileRow *object ///< fooRow to convert into a psMetadata8019 );8020 8021 /** Convert a psMetadata into an equivalent fooRow8022 *8023 * @return A p4MagicMaskImfileRow pointer or NULL on error8024 */8025 8026 p4MagicMaskImfileRow *p4MagicMaskImfileObjectFromMetadata(8027 psMetadata *md ///< psMetadata to convert into a fooRow8028 );8029 /** Selects up to limit rows from the database and returns as p4MagicMaskImfileRow objects in a psArray8030 *8031 * See psDBSelectRows() for documentation on the format of where.8032 *8033 * @return A psArray pointer or NULL on error8034 */8035 8036 psArray *p4MagicMaskImfileSelectRowObjects(8037 psDB *dbh, ///< Database handle8038 const psMetadata *where, ///< Row match criteria8039 unsigned long long limit ///< Maximum number of elements to return8040 );8041 /** Deletes a row from the database coresponding to an p4MagicMaskImfile8042 *8043 * Note that a 'where' search psMetadata is constructed from each object and8044 * used to find rows to delete.8045 *8046 * @return A The number of rows removed or a negative value on error8047 */8048 8049 bool p4MagicMaskImfileDeleteObject(8050 psDB *dbh, ///< Database handle8051 const p4MagicMaskImfileRow *object ///< Object to delete8052 );8053 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8054 *8055 * Note that a 'where' search psMetadata is constructed from each object and8056 * used to find rows to delete.8057 *8058 * @return A The number of rows removed or a negative value on error8059 */8060 8061 long long p4MagicMaskImfileDeleteRowObjects(8062 psDB *dbh, ///< Database handle8063 const psArray *objects, ///< Array of objects to delete8064 unsigned long long limit ///< Maximum number of elements to delete8065 );8066 /** Formats and prints an array of p4MagicMaskImfileRow objects8067 *8068 * When mdcf is set the formated output is in psMetadataConfig8069 * format, otherwise it is in a simple tabular format.8070 *8071 * @return true on success8072 */8073 8074 bool p4MagicMaskImfilePrintObjects(8075 FILE *stream, ///< a stream8076 psArray *objects, ///< An array of p4MagicMaskImfileRow objects8077 bool mdcf ///< format as mdconfig or simple8078 );8079 /** Formats and prints an p4MagicMaskImfileRow object8080 *8081 * When mdcf is set the formated output is in psMetadataConfig8082 * format, otherwise it is in a simple tabular format.8083 *8084 * @return true on success8085 */8086 8087 bool p4MagicMaskImfilePrintObject(8088 FILE *stream, ///< a stream8089 p4MagicMaskImfileRow *object, ///< an p4MagicMaskImfileRow object8090 bool mdcf ///< format as mdconfig or simple8091 );8092 /** skyCellRow data structure8093 *8094 * Structure for representing a single row of skyCell table data.8095 */8096 8097 typedef struct {8098 char *skycell_id;8099 char *tess_id;8100 psF64 ra1;8101 psF64 decl1;8102 psF64 ra2;8103 psF64 decl2;8104 psF64 ra3;8105 psF64 decl3;8106 psF64 ra4;8107 psF64 decl4;8108 } skyCellRow;8109 8110 /** Creates a new skyCellRow object8111 *8112 * @return A new skyCellRow object or NULL on failure.8113 */8114 8115 skyCellRow *skyCellRowAlloc(8116 const char *skycell_id,8117 const char *tess_id,8118 psF64 ra1,8119 psF64 decl1,8120 psF64 ra2,8121 psF64 decl2,8122 psF64 ra3,8123 psF64 decl3,8124 psF64 ra4,8125 psF64 decl48126 );8127 8128 /** Creates a new skyCell table8129 *8130 * @return true on success8131 */8132 8133 bool skyCellCreateTable(8134 psDB *dbh ///< Database handle8135 );8136 8137 /** Deletes a skyCell table8138 *8139 * @return true on success8140 */8141 8142 bool skyCellDropTable(8143 psDB *dbh ///< Database handle8144 );8145 8146 /** Insert a single row into a table8147 *8148 * This function constructs and inserts a single row based on it's parameters.8149 *8150 * @return true on success8151 */8152 8153 bool skyCellInsert(8154 psDB *dbh, ///< Database handle8155 const char *skycell_id,8156 const char *tess_id,8157 psF64 ra1,8158 psF64 decl1,8159 psF64 ra2,8160 psF64 decl2,8161 psF64 ra3,8162 psF64 decl3,8163 psF64 ra4,8164 psF64 decl48165 );8166 8167 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8168 *8169 * @return A The number of rows removed or a negative value on error8170 */8171 8172 long long skyCellDelete(8173 psDB *dbh, ///< Database handle8174 const psMetadata *where, ///< Row match criteria8175 unsigned long long limit ///< Maximum number of elements to delete8176 );8177 8178 /** Insert a single skyCellRow object into a table8179 *8180 * This function constructs and inserts a single row based on it's parameters.8181 *8182 * @return true on success8183 */8184 8185 bool skyCellInsertObject(8186 psDB *dbh, ///< Database handle8187 skyCellRow *object ///< skyCellRow object8188 );8189 8190 /** Insert an array of skyCellRow object into a table8191 *8192 * This function constructs and inserts multiple rows based on it's parameters.8193 *8194 * @return true on success8195 */8196 8197 bool skyCellInsertObjects(8198 psDB *dbh, ///< Database handle8199 psArray *objects ///< array of skyCellRow objects8200 );8201 8202 /** Insert data from a binary FITS table skyCellRow into the database8203 *8204 * This function expects a psFits object with a FITS table as the first8205 * extension. The table must have at least one row of data in it, that is of8206 * the appropriate format (number of columns and their type). All other8207 * extensions are ignored.8208 *8209 * @return true on success8210 */8211 8212 bool skyCellInsertFits(8213 psDB *dbh, ///< Database handle8214 const psFits *fits ///< psFits object8215 );8216 8217 /** Selects up to limit from the database and returns them in a binary FITS table8218 *8219 * This function assumes an empty psFits object and will create a FITS table8220 * as the first extension.8221 *8222 * See psDBSelectRows() for documentation on the format of where.8223 *8224 * @return true on success8225 */8226 8227 bool skyCellSelectRowsFits(8228 psDB *dbh, ///< Database handle8229 psFits *fits, ///< psFits object8230 const psMetadata *where, ///< Row match criteria8231 unsigned long long limit ///< Maximum number of elements to return8232 );8233 8234 /** Convert a skyCellRow into an equivalent psMetadata8235 *8236 * @return A psMetadata pointer or NULL on error8237 */8238 8239 psMetadata *skyCellMetadataFromObject(8240 const skyCellRow *object ///< fooRow to convert into a psMetadata8241 );8242 8243 /** Convert a psMetadata into an equivalent fooRow8244 *8245 * @return A skyCellRow pointer or NULL on error8246 */8247 8248 skyCellRow *skyCellObjectFromMetadata(8249 psMetadata *md ///< psMetadata to convert into a fooRow8250 );8251 /** Selects up to limit rows from the database and returns as skyCellRow objects in a psArray8252 *8253 * See psDBSelectRows() for documentation on the format of where.8254 *8255 * @return A psArray pointer or NULL on error8256 */8257 8258 psArray *skyCellSelectRowObjects(8259 psDB *dbh, ///< Database handle8260 const psMetadata *where, ///< Row match criteria8261 unsigned long long limit ///< Maximum number of elements to return8262 );8263 /** Deletes a row from the database coresponding to an skyCell8264 *8265 * Note that a 'where' search psMetadata is constructed from each object and8266 * used to find rows to delete.8267 *8268 * @return A The number of rows removed or a negative value on error8269 */8270 8271 bool skyCellDeleteObject(8272 psDB *dbh, ///< Database handle8273 const skyCellRow *object ///< Object to delete8274 );8275 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8276 *8277 * Note that a 'where' search psMetadata is constructed from each object and8278 * used to find rows to delete.8279 *8280 * @return A The number of rows removed or a negative value on error8281 */8282 8283 long long skyCellDeleteRowObjects(8284 psDB *dbh, ///< Database handle8285 const psArray *objects, ///< Array of objects to delete8286 unsigned long long limit ///< Maximum number of elements to delete8287 );8288 /** Formats and prints an array of skyCellRow objects8289 *8290 * When mdcf is set the formated output is in psMetadataConfig8291 * format, otherwise it is in a simple tabular format.8292 *8293 * @return true on success8294 */8295 8296 bool skyCellPrintObjects(8297 FILE *stream, ///< a stream8298 psArray *objects, ///< An array of skyCellRow objects8299 bool mdcf ///< format as mdconfig or simple8300 );8301 /** Formats and prints an skyCellRow object8302 *8303 * When mdcf is set the formated output is in psMetadataConfig8304 * format, otherwise it is in a simple tabular format.8305 *8306 * @return true on success8307 */8308 8309 bool skyCellPrintObject(8310 FILE *stream, ///< a stream8311 skyCellRow *object, ///< an skyCellRow object8312 bool mdcf ///< format as mdconfig or simple8313 );8314 /** skyCellMapRow data structure8315 *8316 * Structure for representing a single row of skyCellMap table data.8317 */8318 8319 typedef struct {8320 char *skycell_id;8321 char *tess_id;8322 char *exp_tag;8323 char *class_id;8324 } skyCellMapRow;8325 8326 /** Creates a new skyCellMapRow object8327 *8328 * @return A new skyCellMapRow object or NULL on failure.8329 */8330 8331 skyCellMapRow *skyCellMapRowAlloc(8332 const char *skycell_id,8333 const char *tess_id,8334 const char *exp_tag,8335 const char *class_id8336 );8337 8338 /** Creates a new skyCellMap table8339 *8340 * @return true on success8341 */8342 8343 bool skyCellMapCreateTable(8344 psDB *dbh ///< Database handle8345 );8346 8347 /** Deletes a skyCellMap table8348 *8349 * @return true on success8350 */8351 8352 bool skyCellMapDropTable(8353 psDB *dbh ///< Database handle8354 );8355 8356 /** Insert a single row into a table8357 *8358 * This function constructs and inserts a single row based on it's parameters.8359 *8360 * @return true on success8361 */8362 8363 bool skyCellMapInsert(8364 psDB *dbh, ///< Database handle8365 const char *skycell_id,8366 const char *tess_id,8367 const char *exp_tag,8368 const char *class_id8369 );8370 8371 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8372 *8373 * @return A The number of rows removed or a negative value on error8374 */8375 8376 long long skyCellMapDelete(8377 psDB *dbh, ///< Database handle8378 const psMetadata *where, ///< Row match criteria8379 unsigned long long limit ///< Maximum number of elements to delete8380 );8381 8382 /** Insert a single skyCellMapRow object into a table8383 *8384 * This function constructs and inserts a single row based on it's parameters.8385 *8386 * @return true on success8387 */8388 8389 bool skyCellMapInsertObject(8390 psDB *dbh, ///< Database handle8391 skyCellMapRow *object ///< skyCellMapRow object8392 );8393 8394 /** Insert an array of skyCellMapRow object into a table8395 *8396 * This function constructs and inserts multiple rows based on it's parameters.8397 *8398 * @return true on success8399 */8400 8401 bool skyCellMapInsertObjects(8402 psDB *dbh, ///< Database handle8403 psArray *objects ///< array of skyCellMapRow objects8404 );8405 8406 /** Insert data from a binary FITS table skyCellMapRow into the database8407 *8408 * This function expects a psFits object with a FITS table as the first8409 * extension. The table must have at least one row of data in it, that is of8410 * the appropriate format (number of columns and their type). All other8411 * extensions are ignored.8412 *8413 * @return true on success8414 */8415 8416 bool skyCellMapInsertFits(8417 psDB *dbh, ///< Database handle8418 const psFits *fits ///< psFits object8419 );8420 8421 /** Selects up to limit from the database and returns them in a binary FITS table8422 *8423 * This function assumes an empty psFits object and will create a FITS table8424 * as the first extension.8425 *8426 * See psDBSelectRows() for documentation on the format of where.8427 *8428 * @return true on success8429 */8430 8431 bool skyCellMapSelectRowsFits(8432 psDB *dbh, ///< Database handle8433 psFits *fits, ///< psFits object8434 const psMetadata *where, ///< Row match criteria8435 unsigned long long limit ///< Maximum number of elements to return8436 );8437 8438 /** Convert a skyCellMapRow into an equivalent psMetadata8439 *8440 * @return A psMetadata pointer or NULL on error8441 */8442 8443 psMetadata *skyCellMapMetadataFromObject(8444 const skyCellMapRow *object ///< fooRow to convert into a psMetadata8445 );8446 8447 /** Convert a psMetadata into an equivalent fooRow8448 *8449 * @return A skyCellMapRow pointer or NULL on error8450 */8451 8452 skyCellMapRow *skyCellMapObjectFromMetadata(8453 psMetadata *md ///< psMetadata to convert into a fooRow8454 );8455 /** Selects up to limit rows from the database and returns as skyCellMapRow objects in a psArray8456 *8457 * See psDBSelectRows() for documentation on the format of where.8458 *8459 * @return A psArray pointer or NULL on error8460 */8461 8462 psArray *skyCellMapSelectRowObjects(8463 psDB *dbh, ///< Database handle8464 const psMetadata *where, ///< Row match criteria8465 unsigned long long limit ///< Maximum number of elements to return8466 );8467 /** Deletes a row from the database coresponding to an skyCellMap8468 *8469 * Note that a 'where' search psMetadata is constructed from each object and8470 * used to find rows to delete.8471 *8472 * @return A The number of rows removed or a negative value on error8473 */8474 8475 bool skyCellMapDeleteObject(8476 psDB *dbh, ///< Database handle8477 const skyCellMapRow *object ///< Object to delete8478 );8479 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8480 *8481 * Note that a 'where' search psMetadata is constructed from each object and8482 * used to find rows to delete.8483 *8484 * @return A The number of rows removed or a negative value on error8485 */8486 8487 long long skyCellMapDeleteRowObjects(8488 psDB *dbh, ///< Database handle8489 const psArray *objects, ///< Array of objects to delete8490 unsigned long long limit ///< Maximum number of elements to delete8491 );8492 /** Formats and prints an array of skyCellMapRow objects8493 *8494 * When mdcf is set the formated output is in psMetadataConfig8495 * format, otherwise it is in a simple tabular format.8496 *8497 * @return true on success8498 */8499 8500 bool skyCellMapPrintObjects(8501 FILE *stream, ///< a stream8502 psArray *objects, ///< An array of skyCellMapRow objects8503 bool mdcf ///< format as mdconfig or simple8504 );8505 /** Formats and prints an skyCellMapRow object8506 *8507 * When mdcf is set the formated output is in psMetadataConfig8508 * format, otherwise it is in a simple tabular format.8509 *8510 * @return true on success8511 */8512 8513 bool skyCellMapPrintObject(8514 FILE *stream, ///< a stream8515 skyCellMapRow *object, ///< an skyCellMapRow object8516 bool mdcf ///< format as mdconfig or simple8517 );8518 7669 8519 7670 /// @} … … 8523 7674 #endif 8524 7675 8525 #endif // SKYCELLMAP_DB_H7676 #endif // P4SCFILE_DB_H
Note:
See TracChangeset
for help on using the changeset viewer.
