IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 14, 2007, 4:02:28 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 1.1.6

File:
1 edited

Legend:

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

    r11780 r11809  
    76677667    bool            mdcf                ///< format as mdconfig or simple
    76687668);
     7669/** p5RunRow data structure
     7670 *
     7671 * Structure for representing a single row of p5Run table data.
     7672 */
     7673
     7674typedef struct {
     7675    psS32           p5_id;
     7676    char            *state;
     7677    char            *workdir;
     7678    psTime*         registered;
     7679} p5RunRow;
     7680
     7681/** Creates a new p5RunRow object
     7682 *
     7683 *  @return A new p5RunRow object or NULL on failure.
     7684 */
     7685
     7686p5RunRow *p5RunRowAlloc(
     7687    psS32           p5_id,
     7688    const char      *state,
     7689    const char      *workdir,
     7690    psTime*         registered
     7691);
     7692
     7693/** Creates a new p5Run table
     7694 *
     7695 * @return true on success
     7696 */
     7697
     7698bool p5RunCreateTable(
     7699    psDB            *dbh                ///< Database handle
     7700);
     7701
     7702/** Deletes a p5Run table
     7703 *
     7704 * @return true on success
     7705 */
     7706
     7707bool p5RunDropTable(
     7708    psDB            *dbh                ///< Database handle
     7709);
     7710
     7711/** Insert a single row into a table
     7712 *
     7713 * This function constructs and inserts a single row based on it's parameters.
     7714 *
     7715 * @return true on success
     7716 */
     7717
     7718bool p5RunInsert(
     7719    psDB            *dbh,               ///< Database handle
     7720    psS32           p5_id,
     7721    const char      *state,
     7722    const char      *workdir,
     7723    psTime*         registered
     7724);
     7725
     7726/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     7727 *
     7728 * @return A The number of rows removed or a negative value on error
     7729 */
     7730
     7731long long p5RunDelete(
     7732    psDB            *dbh,               ///< Database handle
     7733    const psMetadata *where,            ///< Row match criteria
     7734    unsigned long long limit            ///< Maximum number of elements to delete
     7735);
     7736
     7737/** Insert a single p5RunRow object into a table
     7738 *
     7739 * This function constructs and inserts a single row based on it's parameters.
     7740 *
     7741 * @return true on success
     7742 */
     7743
     7744bool p5RunInsertObject(
     7745    psDB            *dbh,               ///< Database handle
     7746    p5RunRow        *object             ///< p5RunRow object
     7747);
     7748
     7749/** Insert an array of p5RunRow object into a table
     7750 *
     7751 * This function constructs and inserts multiple rows based on it's parameters.
     7752 *
     7753 * @return true on success
     7754 */
     7755
     7756bool p5RunInsertObjects(
     7757    psDB            *dbh,               ///< Database handle
     7758    psArray         *objects            ///< array of p5RunRow objects
     7759);
     7760
     7761/** Insert data from a binary FITS table p5RunRow into the database
     7762 *
     7763 * This function expects a psFits object with a FITS table as the first
     7764 * extension.  The table must have at least one row of data in it, that is of
     7765 * the appropriate format (number of columns and their type).  All other
     7766 * extensions are ignored.
     7767 *
     7768 * @return true on success
     7769 */
     7770
     7771bool p5RunInsertFits(
     7772    psDB            *dbh,               ///< Database handle
     7773    const psFits    *fits               ///< psFits object
     7774);
     7775
     7776/** Selects up to limit from the database and returns them in a binary FITS table
     7777 *
     7778 * This function assumes an empty psFits object and will create a FITS table
     7779 * as the first extension.
     7780 *
     7781 *  See psDBSelectRows() for documentation on the format of where.
     7782 *
     7783 * @return true on success
     7784 */
     7785
     7786bool p5RunSelectRowsFits(
     7787    psDB            *dbh,               ///< Database handle
     7788    psFits          *fits,              ///< psFits object
     7789    const psMetadata *where,            ///< Row match criteria
     7790    unsigned long long limit            ///< Maximum number of elements to return
     7791);
     7792
     7793/** Convert a p5RunRow into an equivalent psMetadata
     7794 *
     7795 * @return A psMetadata pointer or NULL on error
     7796 */
     7797
     7798psMetadata *p5RunMetadataFromObject(
     7799    const p5RunRow  *object             ///< fooRow to convert into a psMetadata
     7800);
     7801
     7802/** Convert a psMetadata into an equivalent fooRow
     7803 *
     7804 * @return A p5RunRow pointer or NULL on error
     7805 */
     7806
     7807p5RunRow *p5RunObjectFromMetadata(
     7808    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     7809);
     7810/** Selects up to limit rows from the database and returns as p5RunRow objects in a psArray
     7811 *
     7812 *  See psDBSelectRows() for documentation on the format of where.
     7813 *
     7814 * @return A psArray pointer or NULL on error
     7815 */
     7816
     7817psArray *p5RunSelectRowObjects(
     7818    psDB            *dbh,               ///< Database handle
     7819    const psMetadata *where,            ///< Row match criteria
     7820    unsigned long long limit            ///< Maximum number of elements to return
     7821);
     7822/** Deletes a row from the database coresponding to an p5Run
     7823 *
     7824 *  Note that a 'where' search psMetadata is constructed from each object and
     7825 *  used to find rows to delete.
     7826 *
     7827 * @return A The number of rows removed or a negative value on error
     7828 */
     7829
     7830bool p5RunDeleteObject(
     7831    psDB            *dbh,               ///< Database handle
     7832    const p5RunRow *object    ///< Object to delete
     7833);
     7834/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     7835 *
     7836 *  Note that a 'where' search psMetadata is constructed from each object and
     7837 *  used to find rows to delete.
     7838 *
     7839 * @return A The number of rows removed or a negative value on error
     7840 */
     7841
     7842long long p5RunDeleteRowObjects(
     7843    psDB            *dbh,               ///< Database handle
     7844    const psArray   *objects,           ///< Array of objects to delete
     7845    unsigned long long limit            ///< Maximum number of elements to delete
     7846);
     7847/** Formats and prints an array of p5RunRow objects
     7848 *
     7849 * When mdcf is set the formated output is in psMetadataConfig
     7850 * format, otherwise it is in a simple tabular format.
     7851 *
     7852 * @return true on success
     7853 */
     7854
     7855bool p5RunPrintObjects(
     7856    FILE            *stream,            ///< a stream
     7857    psArray         *objects,           ///< An array of p5RunRow objects
     7858    bool            mdcf                ///< format as mdconfig or simple
     7859);
     7860/** Formats and prints an p5RunRow object
     7861 *
     7862 * When mdcf is set the formated output is in psMetadataConfig
     7863 * format, otherwise it is in a simple tabular format.
     7864 *
     7865 * @return true on success
     7866 */
     7867
     7868bool p5RunPrintObject(
     7869    FILE            *stream,            ///< a stream
     7870    p5RunRow *object,    ///< an p5RunRow object
     7871    bool            mdcf                ///< format as mdconfig or simple
     7872);
     7873/** p5InputScfileRow data structure
     7874 *
     7875 * Structure for representing a single row of p5InputScfile table data.
     7876 */
     7877
     7878typedef struct {
     7879    psS32           p5_id;
     7880    psS32           p4_id;
     7881    char            *skycell_id;
     7882    char            *tess_id;
     7883    char            *exp_tag;
     7884    psS32           p3_version;
     7885    char            *kind;
     7886    bool            template;
     7887} p5InputScfileRow;
     7888
     7889/** Creates a new p5InputScfileRow object
     7890 *
     7891 *  @return A new p5InputScfileRow object or NULL on failure.
     7892 */
     7893
     7894p5InputScfileRow *p5InputScfileRowAlloc(
     7895    psS32           p5_id,
     7896    psS32           p4_id,
     7897    const char      *skycell_id,
     7898    const char      *tess_id,
     7899    const char      *exp_tag,
     7900    psS32           p3_version,
     7901    const char      *kind,
     7902    bool            template
     7903);
     7904
     7905/** Creates a new p5InputScfile table
     7906 *
     7907 * @return true on success
     7908 */
     7909
     7910bool p5InputScfileCreateTable(
     7911    psDB            *dbh                ///< Database handle
     7912);
     7913
     7914/** Deletes a p5InputScfile table
     7915 *
     7916 * @return true on success
     7917 */
     7918
     7919bool p5InputScfileDropTable(
     7920    psDB            *dbh                ///< Database handle
     7921);
     7922
     7923/** Insert a single row into a table
     7924 *
     7925 * This function constructs and inserts a single row based on it's parameters.
     7926 *
     7927 * @return true on success
     7928 */
     7929
     7930bool p5InputScfileInsert(
     7931    psDB            *dbh,               ///< Database handle
     7932    psS32           p5_id,
     7933    psS32           p4_id,
     7934    const char      *skycell_id,
     7935    const char      *tess_id,
     7936    const char      *exp_tag,
     7937    psS32           p3_version,
     7938    const char      *kind,
     7939    bool            template
     7940);
     7941
     7942/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     7943 *
     7944 * @return A The number of rows removed or a negative value on error
     7945 */
     7946
     7947long long p5InputScfileDelete(
     7948    psDB            *dbh,               ///< Database handle
     7949    const psMetadata *where,            ///< Row match criteria
     7950    unsigned long long limit            ///< Maximum number of elements to delete
     7951);
     7952
     7953/** Insert a single p5InputScfileRow object into a table
     7954 *
     7955 * This function constructs and inserts a single row based on it's parameters.
     7956 *
     7957 * @return true on success
     7958 */
     7959
     7960bool p5InputScfileInsertObject(
     7961    psDB            *dbh,               ///< Database handle
     7962    p5InputScfileRow *object             ///< p5InputScfileRow object
     7963);
     7964
     7965/** Insert an array of p5InputScfileRow object into a table
     7966 *
     7967 * This function constructs and inserts multiple rows based on it's parameters.
     7968 *
     7969 * @return true on success
     7970 */
     7971
     7972bool p5InputScfileInsertObjects(
     7973    psDB            *dbh,               ///< Database handle
     7974    psArray         *objects            ///< array of p5InputScfileRow objects
     7975);
     7976
     7977/** Insert data from a binary FITS table p5InputScfileRow into the database
     7978 *
     7979 * This function expects a psFits object with a FITS table as the first
     7980 * extension.  The table must have at least one row of data in it, that is of
     7981 * the appropriate format (number of columns and their type).  All other
     7982 * extensions are ignored.
     7983 *
     7984 * @return true on success
     7985 */
     7986
     7987bool p5InputScfileInsertFits(
     7988    psDB            *dbh,               ///< Database handle
     7989    const psFits    *fits               ///< psFits object
     7990);
     7991
     7992/** Selects up to limit from the database and returns them in a binary FITS table
     7993 *
     7994 * This function assumes an empty psFits object and will create a FITS table
     7995 * as the first extension.
     7996 *
     7997 *  See psDBSelectRows() for documentation on the format of where.
     7998 *
     7999 * @return true on success
     8000 */
     8001
     8002bool p5InputScfileSelectRowsFits(
     8003    psDB            *dbh,               ///< Database handle
     8004    psFits          *fits,              ///< psFits object
     8005    const psMetadata *where,            ///< Row match criteria
     8006    unsigned long long limit            ///< Maximum number of elements to return
     8007);
     8008
     8009/** Convert a p5InputScfileRow into an equivalent psMetadata
     8010 *
     8011 * @return A psMetadata pointer or NULL on error
     8012 */
     8013
     8014psMetadata *p5InputScfileMetadataFromObject(
     8015    const p5InputScfileRow *object             ///< fooRow to convert into a psMetadata
     8016);
     8017
     8018/** Convert a psMetadata into an equivalent fooRow
     8019 *
     8020 * @return A p5InputScfileRow pointer or NULL on error
     8021 */
     8022
     8023p5InputScfileRow *p5InputScfileObjectFromMetadata(
     8024    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     8025);
     8026/** Selects up to limit rows from the database and returns as p5InputScfileRow objects in a psArray
     8027 *
     8028 *  See psDBSelectRows() for documentation on the format of where.
     8029 *
     8030 * @return A psArray pointer or NULL on error
     8031 */
     8032
     8033psArray *p5InputScfileSelectRowObjects(
     8034    psDB            *dbh,               ///< Database handle
     8035    const psMetadata *where,            ///< Row match criteria
     8036    unsigned long long limit            ///< Maximum number of elements to return
     8037);
     8038/** Deletes a row from the database coresponding to an p5InputScfile
     8039 *
     8040 *  Note that a 'where' search psMetadata is constructed from each object and
     8041 *  used to find rows to delete.
     8042 *
     8043 * @return A The number of rows removed or a negative value on error
     8044 */
     8045
     8046bool p5InputScfileDeleteObject(
     8047    psDB            *dbh,               ///< Database handle
     8048    const p5InputScfileRow *object    ///< Object to delete
     8049);
     8050/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     8051 *
     8052 *  Note that a 'where' search psMetadata is constructed from each object and
     8053 *  used to find rows to delete.
     8054 *
     8055 * @return A The number of rows removed or a negative value on error
     8056 */
     8057
     8058long long p5InputScfileDeleteRowObjects(
     8059    psDB            *dbh,               ///< Database handle
     8060    const psArray   *objects,           ///< Array of objects to delete
     8061    unsigned long long limit            ///< Maximum number of elements to delete
     8062);
     8063/** Formats and prints an array of p5InputScfileRow objects
     8064 *
     8065 * When mdcf is set the formated output is in psMetadataConfig
     8066 * format, otherwise it is in a simple tabular format.
     8067 *
     8068 * @return true on success
     8069 */
     8070
     8071bool p5InputScfilePrintObjects(
     8072    FILE            *stream,            ///< a stream
     8073    psArray         *objects,           ///< An array of p5InputScfileRow objects
     8074    bool            mdcf                ///< format as mdconfig or simple
     8075);
     8076/** Formats and prints an p5InputScfileRow object
     8077 *
     8078 * When mdcf is set the formated output is in psMetadataConfig
     8079 * format, otherwise it is in a simple tabular format.
     8080 *
     8081 * @return true on success
     8082 */
     8083
     8084bool p5InputScfilePrintObject(
     8085    FILE            *stream,            ///< a stream
     8086    p5InputScfileRow *object,    ///< an p5InputScfileRow object
     8087    bool            mdcf                ///< format as mdconfig or simple
     8088);
     8089/** p5DiffScfileRow data structure
     8090 *
     8091 * Structure for representing a single row of p5DiffScfile table data.
     8092 */
     8093
     8094typedef struct {
     8095    psS32           p5_id;
     8096    char            *skycell_id;
     8097    char            *tess_id;
     8098    char            *uri;
     8099    psF64           bg;
     8100    psF64           bg_mean_stdev;
     8101} p5DiffScfileRow;
     8102
     8103/** Creates a new p5DiffScfileRow object
     8104 *
     8105 *  @return A new p5DiffScfileRow object or NULL on failure.
     8106 */
     8107
     8108p5DiffScfileRow *p5DiffScfileRowAlloc(
     8109    psS32           p5_id,
     8110    const char      *skycell_id,
     8111    const char      *tess_id,
     8112    const char      *uri,
     8113    psF64           bg,
     8114    psF64           bg_mean_stdev
     8115);
     8116
     8117/** Creates a new p5DiffScfile table
     8118 *
     8119 * @return true on success
     8120 */
     8121
     8122bool p5DiffScfileCreateTable(
     8123    psDB            *dbh                ///< Database handle
     8124);
     8125
     8126/** Deletes a p5DiffScfile table
     8127 *
     8128 * @return true on success
     8129 */
     8130
     8131bool p5DiffScfileDropTable(
     8132    psDB            *dbh                ///< Database handle
     8133);
     8134
     8135/** Insert a single row into a table
     8136 *
     8137 * This function constructs and inserts a single row based on it's parameters.
     8138 *
     8139 * @return true on success
     8140 */
     8141
     8142bool p5DiffScfileInsert(
     8143    psDB            *dbh,               ///< Database handle
     8144    psS32           p5_id,
     8145    const char      *skycell_id,
     8146    const char      *tess_id,
     8147    const char      *uri,
     8148    psF64           bg,
     8149    psF64           bg_mean_stdev
     8150);
     8151
     8152/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     8153 *
     8154 * @return A The number of rows removed or a negative value on error
     8155 */
     8156
     8157long long p5DiffScfileDelete(
     8158    psDB            *dbh,               ///< Database handle
     8159    const psMetadata *where,            ///< Row match criteria
     8160    unsigned long long limit            ///< Maximum number of elements to delete
     8161);
     8162
     8163/** Insert a single p5DiffScfileRow object into a table
     8164 *
     8165 * This function constructs and inserts a single row based on it's parameters.
     8166 *
     8167 * @return true on success
     8168 */
     8169
     8170bool p5DiffScfileInsertObject(
     8171    psDB            *dbh,               ///< Database handle
     8172    p5DiffScfileRow *object             ///< p5DiffScfileRow object
     8173);
     8174
     8175/** Insert an array of p5DiffScfileRow object into a table
     8176 *
     8177 * This function constructs and inserts multiple rows based on it's parameters.
     8178 *
     8179 * @return true on success
     8180 */
     8181
     8182bool p5DiffScfileInsertObjects(
     8183    psDB            *dbh,               ///< Database handle
     8184    psArray         *objects            ///< array of p5DiffScfileRow objects
     8185);
     8186
     8187/** Insert data from a binary FITS table p5DiffScfileRow into the database
     8188 *
     8189 * This function expects a psFits object with a FITS table as the first
     8190 * extension.  The table must have at least one row of data in it, that is of
     8191 * the appropriate format (number of columns and their type).  All other
     8192 * extensions are ignored.
     8193 *
     8194 * @return true on success
     8195 */
     8196
     8197bool p5DiffScfileInsertFits(
     8198    psDB            *dbh,               ///< Database handle
     8199    const psFits    *fits               ///< psFits object
     8200);
     8201
     8202/** Selects up to limit from the database and returns them in a binary FITS table
     8203 *
     8204 * This function assumes an empty psFits object and will create a FITS table
     8205 * as the first extension.
     8206 *
     8207 *  See psDBSelectRows() for documentation on the format of where.
     8208 *
     8209 * @return true on success
     8210 */
     8211
     8212bool p5DiffScfileSelectRowsFits(
     8213    psDB            *dbh,               ///< Database handle
     8214    psFits          *fits,              ///< psFits object
     8215    const psMetadata *where,            ///< Row match criteria
     8216    unsigned long long limit            ///< Maximum number of elements to return
     8217);
     8218
     8219/** Convert a p5DiffScfileRow into an equivalent psMetadata
     8220 *
     8221 * @return A psMetadata pointer or NULL on error
     8222 */
     8223
     8224psMetadata *p5DiffScfileMetadataFromObject(
     8225    const p5DiffScfileRow *object             ///< fooRow to convert into a psMetadata
     8226);
     8227
     8228/** Convert a psMetadata into an equivalent fooRow
     8229 *
     8230 * @return A p5DiffScfileRow pointer or NULL on error
     8231 */
     8232
     8233p5DiffScfileRow *p5DiffScfileObjectFromMetadata(
     8234    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     8235);
     8236/** Selects up to limit rows from the database and returns as p5DiffScfileRow objects in a psArray
     8237 *
     8238 *  See psDBSelectRows() for documentation on the format of where.
     8239 *
     8240 * @return A psArray pointer or NULL on error
     8241 */
     8242
     8243psArray *p5DiffScfileSelectRowObjects(
     8244    psDB            *dbh,               ///< Database handle
     8245    const psMetadata *where,            ///< Row match criteria
     8246    unsigned long long limit            ///< Maximum number of elements to return
     8247);
     8248/** Deletes a row from the database coresponding to an p5DiffScfile
     8249 *
     8250 *  Note that a 'where' search psMetadata is constructed from each object and
     8251 *  used to find rows to delete.
     8252 *
     8253 * @return A The number of rows removed or a negative value on error
     8254 */
     8255
     8256bool p5DiffScfileDeleteObject(
     8257    psDB            *dbh,               ///< Database handle
     8258    const p5DiffScfileRow *object    ///< Object to delete
     8259);
     8260/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     8261 *
     8262 *  Note that a 'where' search psMetadata is constructed from each object and
     8263 *  used to find rows to delete.
     8264 *
     8265 * @return A The number of rows removed or a negative value on error
     8266 */
     8267
     8268long long p5DiffScfileDeleteRowObjects(
     8269    psDB            *dbh,               ///< Database handle
     8270    const psArray   *objects,           ///< Array of objects to delete
     8271    unsigned long long limit            ///< Maximum number of elements to delete
     8272);
     8273/** Formats and prints an array of p5DiffScfileRow objects
     8274 *
     8275 * When mdcf is set the formated output is in psMetadataConfig
     8276 * format, otherwise it is in a simple tabular format.
     8277 *
     8278 * @return true on success
     8279 */
     8280
     8281bool p5DiffScfilePrintObjects(
     8282    FILE            *stream,            ///< a stream
     8283    psArray         *objects,           ///< An array of p5DiffScfileRow objects
     8284    bool            mdcf                ///< format as mdconfig or simple
     8285);
     8286/** Formats and prints an p5DiffScfileRow object
     8287 *
     8288 * When mdcf is set the formated output is in psMetadataConfig
     8289 * format, otherwise it is in a simple tabular format.
     8290 *
     8291 * @return true on success
     8292 */
     8293
     8294bool p5DiffScfilePrintObject(
     8295    FILE            *stream,            ///< a stream
     8296    p5DiffScfileRow *object,    ///< an p5DiffScfileRow object
     8297    bool            mdcf                ///< format as mdconfig or simple
     8298);
    76698299
    76708300/// @}
     
    76748304#endif
    76758305
    7676 #endif // P4SCFILE_DB_H
     8306#endif // P5DIFFSCFILE_DB_H
Note: See TracChangeset for help on using the changeset viewer.