Changeset 10681 for trunk/ippdb/src/ippdb.h
- Timestamp:
- Dec 12, 2006, 5:52:50 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippdb/src/ippdb.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/src/ippdb.h
r10449 r10681 6597 6597 bool mdcf ///< format as mdconfig or simple 6598 6598 ); 6599 /** p4RunRow data structure 6600 * 6601 * Structure for representing a single row of p4Run table data. 6602 */ 6603 6604 typedef struct { 6605 psS32 p4_id; 6606 char *survey_mode; 6607 char *state; 6608 char *filter; 6609 char *skycell_id; 6610 char *tess_id; 6611 psF64 ra; 6612 psF64 decl; 6613 char *input_ss; 6614 char *output_ss; 6615 } p4RunRow; 6616 6617 /** Creates a new p4RunRow object 6618 * 6619 * @return A new p4RunRow object or NULL on failure. 6620 */ 6621 6622 p4RunRow *p4RunRowAlloc( 6623 psS32 p4_id, 6624 const char *survey_mode, 6625 const char *state, 6626 const char *filter, 6627 const char *skycell_id, 6628 const char *tess_id, 6629 psF64 ra, 6630 psF64 decl, 6631 const char *input_ss, 6632 const char *output_ss 6633 ); 6634 6635 /** Creates a new p4Run table 6636 * 6637 * @return true on success 6638 */ 6639 6640 bool p4RunCreateTable( 6641 psDB *dbh ///< Database handle 6642 ); 6643 6644 /** Deletes a p4Run table 6645 * 6646 * @return true on success 6647 */ 6648 6649 bool p4RunDropTable( 6650 psDB *dbh ///< Database handle 6651 ); 6652 6653 /** Insert a single row into a table 6654 * 6655 * This function constructs and inserts a single row based on it's parameters. 6656 * 6657 * @return true on success 6658 */ 6659 6660 bool p4RunInsert( 6661 psDB *dbh, ///< Database handle 6662 psS32 p4_id, 6663 const char *survey_mode, 6664 const char *state, 6665 const char *filter, 6666 const char *skycell_id, 6667 const char *tess_id, 6668 psF64 ra, 6669 psF64 decl, 6670 const char *input_ss, 6671 const char *output_ss 6672 ); 6673 6674 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 6675 * 6676 * @return A The number of rows removed or a negative value on error 6677 */ 6678 6679 long long p4RunDelete( 6680 psDB *dbh, ///< Database handle 6681 const psMetadata *where, ///< Row match criteria 6682 unsigned long long limit ///< Maximum number of elements to delete 6683 ); 6684 6685 /** Insert a single p4RunRow object into a table 6686 * 6687 * This function constructs and inserts a single row based on it's parameters. 6688 * 6689 * @return true on success 6690 */ 6691 6692 bool p4RunInsertObject( 6693 psDB *dbh, ///< Database handle 6694 p4RunRow *object ///< p4RunRow object 6695 ); 6696 6697 /** Insert an array of p4RunRow object into a table 6698 * 6699 * This function constructs and inserts multiple rows based on it's parameters. 6700 * 6701 * @return true on success 6702 */ 6703 6704 bool p4RunInsertObjects( 6705 psDB *dbh, ///< Database handle 6706 psArray *objects ///< array of p4RunRow objects 6707 ); 6708 6709 /** Insert data from a binary FITS table p4RunRow into the database 6710 * 6711 * This function expects a psFits object with a FITS table as the first 6712 * extension. The table must have at least one row of data in it, that is of 6713 * the appropriate format (number of columns and their type). All other 6714 * extensions are ignored. 6715 * 6716 * @return true on success 6717 */ 6718 6719 bool p4RunInsertFits( 6720 psDB *dbh, ///< Database handle 6721 const psFits *fits ///< psFits object 6722 ); 6723 6724 /** Selects up to limit from the database and returns them in a binary FITS table 6725 * 6726 * This function assumes an empty psFits object and will create a FITS table 6727 * as the first extension. 6728 * 6729 * See psDBSelectRows() for documentation on the format of where. 6730 * 6731 * @return true on success 6732 */ 6733 6734 bool p4RunSelectRowsFits( 6735 psDB *dbh, ///< Database handle 6736 psFits *fits, ///< psFits object 6737 const psMetadata *where, ///< Row match criteria 6738 unsigned long long limit ///< Maximum number of elements to return 6739 ); 6740 6741 /** Convert a p4RunRow into an equivalent psMetadata 6742 * 6743 * @return A psMetadata pointer or NULL on error 6744 */ 6745 6746 psMetadata *p4RunMetadataFromObject( 6747 const p4RunRow *object ///< fooRow to convert into a psMetadata 6748 ); 6749 6750 /** Convert a psMetadata into an equivalent fooRow 6751 * 6752 * @return A p4RunRow pointer or NULL on error 6753 */ 6754 6755 p4RunRow *p4RunObjectFromMetadata( 6756 psMetadata *md ///< psMetadata to convert into a fooRow 6757 ); 6758 /** Selects up to limit rows from the database and returns as p4RunRow objects in a psArray 6759 * 6760 * See psDBSelectRows() for documentation on the format of where. 6761 * 6762 * @return A psArray pointer or NULL on error 6763 */ 6764 6765 psArray *p4RunSelectRowObjects( 6766 psDB *dbh, ///< Database handle 6767 const psMetadata *where, ///< Row match criteria 6768 unsigned long long limit ///< Maximum number of elements to return 6769 ); 6770 /** Deletes a row from the database coresponding to an p4Run 6771 * 6772 * Note that a 'where' search psMetadata is constructed from each object and 6773 * used to find rows to delete. 6774 * 6775 * @return A The number of rows removed or a negative value on error 6776 */ 6777 6778 bool p4RunDeleteObject( 6779 psDB *dbh, ///< Database handle 6780 const p4RunRow *object ///< Object to delete 6781 ); 6782 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 6783 * 6784 * Note that a 'where' search psMetadata is constructed from each object and 6785 * used to find rows to delete. 6786 * 6787 * @return A The number of rows removed or a negative value on error 6788 */ 6789 6790 long long p4RunDeleteRowObjects( 6791 psDB *dbh, ///< Database handle 6792 const psArray *objects, ///< Array of objects to delete 6793 unsigned long long limit ///< Maximum number of elements to delete 6794 ); 6795 /** Formats and prints an array of p4RunRow objects 6796 * 6797 * When mdcf is set the formated output is in psMetadataConfig 6798 * format, otherwise it is in a simple tabular format. 6799 * 6800 * @return true on success 6801 */ 6802 6803 bool p4RunPrintObjects( 6804 FILE *stream, ///< a stream 6805 psArray *objects, ///< An array of p4RunRow objects 6806 bool mdcf ///< format as mdconfig or simple 6807 ); 6808 /** p4InputImfileRow data structure 6809 * 6810 * Structure for representing a single row of p4InputImfile table data. 6811 */ 6812 6813 typedef struct { 6814 psS32 p4_id; 6815 char *exp_tag; 6816 psS32 p3_version; 6817 char *class_id; 6818 } p4InputImfileRow; 6819 6820 /** Creates a new p4InputImfileRow object 6821 * 6822 * @return A new p4InputImfileRow object or NULL on failure. 6823 */ 6824 6825 p4InputImfileRow *p4InputImfileRowAlloc( 6826 psS32 p4_id, 6827 const char *exp_tag, 6828 psS32 p3_version, 6829 const char *class_id 6830 ); 6831 6832 /** Creates a new p4InputImfile table 6833 * 6834 * @return true on success 6835 */ 6836 6837 bool p4InputImfileCreateTable( 6838 psDB *dbh ///< Database handle 6839 ); 6840 6841 /** Deletes a p4InputImfile table 6842 * 6843 * @return true on success 6844 */ 6845 6846 bool p4InputImfileDropTable( 6847 psDB *dbh ///< Database handle 6848 ); 6849 6850 /** Insert a single row into a table 6851 * 6852 * This function constructs and inserts a single row based on it's parameters. 6853 * 6854 * @return true on success 6855 */ 6856 6857 bool p4InputImfileInsert( 6858 psDB *dbh, ///< Database handle 6859 psS32 p4_id, 6860 const char *exp_tag, 6861 psS32 p3_version, 6862 const char *class_id 6863 ); 6864 6865 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 6866 * 6867 * @return A The number of rows removed or a negative value on error 6868 */ 6869 6870 long long p4InputImfileDelete( 6871 psDB *dbh, ///< Database handle 6872 const psMetadata *where, ///< Row match criteria 6873 unsigned long long limit ///< Maximum number of elements to delete 6874 ); 6875 6876 /** Insert a single p4InputImfileRow object into a table 6877 * 6878 * This function constructs and inserts a single row based on it's parameters. 6879 * 6880 * @return true on success 6881 */ 6882 6883 bool p4InputImfileInsertObject( 6884 psDB *dbh, ///< Database handle 6885 p4InputImfileRow *object ///< p4InputImfileRow object 6886 ); 6887 6888 /** Insert an array of p4InputImfileRow object into a table 6889 * 6890 * This function constructs and inserts multiple rows based on it's parameters. 6891 * 6892 * @return true on success 6893 */ 6894 6895 bool p4InputImfileInsertObjects( 6896 psDB *dbh, ///< Database handle 6897 psArray *objects ///< array of p4InputImfileRow objects 6898 ); 6899 6900 /** Insert data from a binary FITS table p4InputImfileRow into the database 6901 * 6902 * This function expects a psFits object with a FITS table as the first 6903 * extension. The table must have at least one row of data in it, that is of 6904 * the appropriate format (number of columns and their type). All other 6905 * extensions are ignored. 6906 * 6907 * @return true on success 6908 */ 6909 6910 bool p4InputImfileInsertFits( 6911 psDB *dbh, ///< Database handle 6912 const psFits *fits ///< psFits object 6913 ); 6914 6915 /** Selects up to limit from the database and returns them in a binary FITS table 6916 * 6917 * This function assumes an empty psFits object and will create a FITS table 6918 * as the first extension. 6919 * 6920 * See psDBSelectRows() for documentation on the format of where. 6921 * 6922 * @return true on success 6923 */ 6924 6925 bool p4InputImfileSelectRowsFits( 6926 psDB *dbh, ///< Database handle 6927 psFits *fits, ///< psFits object 6928 const psMetadata *where, ///< Row match criteria 6929 unsigned long long limit ///< Maximum number of elements to return 6930 ); 6931 6932 /** Convert a p4InputImfileRow into an equivalent psMetadata 6933 * 6934 * @return A psMetadata pointer or NULL on error 6935 */ 6936 6937 psMetadata *p4InputImfileMetadataFromObject( 6938 const p4InputImfileRow *object ///< fooRow to convert into a psMetadata 6939 ); 6940 6941 /** Convert a psMetadata into an equivalent fooRow 6942 * 6943 * @return A p4InputImfileRow pointer or NULL on error 6944 */ 6945 6946 p4InputImfileRow *p4InputImfileObjectFromMetadata( 6947 psMetadata *md ///< psMetadata to convert into a fooRow 6948 ); 6949 /** Selects up to limit rows from the database and returns as p4InputImfileRow objects in a psArray 6950 * 6951 * See psDBSelectRows() for documentation on the format of where. 6952 * 6953 * @return A psArray pointer or NULL on error 6954 */ 6955 6956 psArray *p4InputImfileSelectRowObjects( 6957 psDB *dbh, ///< Database handle 6958 const psMetadata *where, ///< Row match criteria 6959 unsigned long long limit ///< Maximum number of elements to return 6960 ); 6961 /** Deletes a row from the database coresponding to an p4InputImfile 6962 * 6963 * Note that a 'where' search psMetadata is constructed from each object and 6964 * used to find rows to delete. 6965 * 6966 * @return A The number of rows removed or a negative value on error 6967 */ 6968 6969 bool p4InputImfileDeleteObject( 6970 psDB *dbh, ///< Database handle 6971 const p4InputImfileRow *object ///< Object to delete 6972 ); 6973 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 6974 * 6975 * Note that a 'where' search psMetadata is constructed from each object and 6976 * used to find rows to delete. 6977 * 6978 * @return A The number of rows removed or a negative value on error 6979 */ 6980 6981 long long p4InputImfileDeleteRowObjects( 6982 psDB *dbh, ///< Database handle 6983 const psArray *objects, ///< Array of objects to delete 6984 unsigned long long limit ///< Maximum number of elements to delete 6985 ); 6986 /** Formats and prints an array of p4InputImfileRow objects 6987 * 6988 * When mdcf is set the formated output is in psMetadataConfig 6989 * format, otherwise it is in a simple tabular format. 6990 * 6991 * @return true on success 6992 */ 6993 6994 bool p4InputImfilePrintObjects( 6995 FILE *stream, ///< a stream 6996 psArray *objects, ///< An array of p4InputImfileRow objects 6997 bool mdcf ///< format as mdconfig or simple 6998 ); 6999 /** p4PWarpedImfileRow data structure 7000 * 7001 * Structure for representing a single row of p4PWarpedImfile table data. 7002 */ 7003 7004 typedef struct { 7005 psS32 p4_id; 7006 char *exp_tag; 7007 psS32 p3_version; 7008 char *class_id; 7009 char *uri; 7010 char *b1_uri; 7011 char *b2_uri; 7012 } p4PWarpedImfileRow; 7013 7014 /** Creates a new p4PWarpedImfileRow object 7015 * 7016 * @return A new p4PWarpedImfileRow object or NULL on failure. 7017 */ 7018 7019 p4PWarpedImfileRow *p4PWarpedImfileRowAlloc( 7020 psS32 p4_id, 7021 const char *exp_tag, 7022 psS32 p3_version, 7023 const char *class_id, 7024 const char *uri, 7025 const char *b1_uri, 7026 const char *b2_uri 7027 ); 7028 7029 /** Creates a new p4PWarpedImfile table 7030 * 7031 * @return true on success 7032 */ 7033 7034 bool p4PWarpedImfileCreateTable( 7035 psDB *dbh ///< Database handle 7036 ); 7037 7038 /** Deletes a p4PWarpedImfile table 7039 * 7040 * @return true on success 7041 */ 7042 7043 bool p4PWarpedImfileDropTable( 7044 psDB *dbh ///< Database handle 7045 ); 7046 7047 /** Insert a single row into a table 7048 * 7049 * This function constructs and inserts a single row based on it's parameters. 7050 * 7051 * @return true on success 7052 */ 7053 7054 bool p4PWarpedImfileInsert( 7055 psDB *dbh, ///< Database handle 7056 psS32 p4_id, 7057 const char *exp_tag, 7058 psS32 p3_version, 7059 const char *class_id, 7060 const char *uri, 7061 const char *b1_uri, 7062 const char *b2_uri 7063 ); 7064 7065 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 7066 * 7067 * @return A The number of rows removed or a negative value on error 7068 */ 7069 7070 long long p4PWarpedImfileDelete( 7071 psDB *dbh, ///< Database handle 7072 const psMetadata *where, ///< Row match criteria 7073 unsigned long long limit ///< Maximum number of elements to delete 7074 ); 7075 7076 /** Insert a single p4PWarpedImfileRow object into a table 7077 * 7078 * This function constructs and inserts a single row based on it's parameters. 7079 * 7080 * @return true on success 7081 */ 7082 7083 bool p4PWarpedImfileInsertObject( 7084 psDB *dbh, ///< Database handle 7085 p4PWarpedImfileRow *object ///< p4PWarpedImfileRow object 7086 ); 7087 7088 /** Insert an array of p4PWarpedImfileRow object into a table 7089 * 7090 * This function constructs and inserts multiple rows based on it's parameters. 7091 * 7092 * @return true on success 7093 */ 7094 7095 bool p4PWarpedImfileInsertObjects( 7096 psDB *dbh, ///< Database handle 7097 psArray *objects ///< array of p4PWarpedImfileRow objects 7098 ); 7099 7100 /** Insert data from a binary FITS table p4PWarpedImfileRow into the database 7101 * 7102 * This function expects a psFits object with a FITS table as the first 7103 * extension. The table must have at least one row of data in it, that is of 7104 * the appropriate format (number of columns and their type). All other 7105 * extensions are ignored. 7106 * 7107 * @return true on success 7108 */ 7109 7110 bool p4PWarpedImfileInsertFits( 7111 psDB *dbh, ///< Database handle 7112 const psFits *fits ///< psFits object 7113 ); 7114 7115 /** Selects up to limit from the database and returns them in a binary FITS table 7116 * 7117 * This function assumes an empty psFits object and will create a FITS table 7118 * as the first extension. 7119 * 7120 * See psDBSelectRows() for documentation on the format of where. 7121 * 7122 * @return true on success 7123 */ 7124 7125 bool p4PWarpedImfileSelectRowsFits( 7126 psDB *dbh, ///< Database handle 7127 psFits *fits, ///< psFits object 7128 const psMetadata *where, ///< Row match criteria 7129 unsigned long long limit ///< Maximum number of elements to return 7130 ); 7131 7132 /** Convert a p4PWarpedImfileRow into an equivalent psMetadata 7133 * 7134 * @return A psMetadata pointer or NULL on error 7135 */ 7136 7137 psMetadata *p4PWarpedImfileMetadataFromObject( 7138 const p4PWarpedImfileRow *object ///< fooRow to convert into a psMetadata 7139 ); 7140 7141 /** Convert a psMetadata into an equivalent fooRow 7142 * 7143 * @return A p4PWarpedImfileRow pointer or NULL on error 7144 */ 7145 7146 p4PWarpedImfileRow *p4PWarpedImfileObjectFromMetadata( 7147 psMetadata *md ///< psMetadata to convert into a fooRow 7148 ); 7149 /** Selects up to limit rows from the database and returns as p4PWarpedImfileRow objects in a psArray 7150 * 7151 * See psDBSelectRows() for documentation on the format of where. 7152 * 7153 * @return A psArray pointer or NULL on error 7154 */ 7155 7156 psArray *p4PWarpedImfileSelectRowObjects( 7157 psDB *dbh, ///< Database handle 7158 const psMetadata *where, ///< Row match criteria 7159 unsigned long long limit ///< Maximum number of elements to return 7160 ); 7161 /** Deletes a row from the database coresponding to an p4PWarpedImfile 7162 * 7163 * Note that a 'where' search psMetadata is constructed from each object and 7164 * used to find rows to delete. 7165 * 7166 * @return A The number of rows removed or a negative value on error 7167 */ 7168 7169 bool p4PWarpedImfileDeleteObject( 7170 psDB *dbh, ///< Database handle 7171 const p4PWarpedImfileRow *object ///< Object to delete 7172 ); 7173 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 7174 * 7175 * Note that a 'where' search psMetadata is constructed from each object and 7176 * used to find rows to delete. 7177 * 7178 * @return A The number of rows removed or a negative value on error 7179 */ 7180 7181 long long p4PWarpedImfileDeleteRowObjects( 7182 psDB *dbh, ///< Database handle 7183 const psArray *objects, ///< Array of objects to delete 7184 unsigned long long limit ///< Maximum number of elements to delete 7185 ); 7186 /** Formats and prints an array of p4PWarpedImfileRow objects 7187 * 7188 * When mdcf is set the formated output is in psMetadataConfig 7189 * format, otherwise it is in a simple tabular format. 7190 * 7191 * @return true on success 7192 */ 7193 7194 bool p4PWarpedImfilePrintObjects( 7195 FILE *stream, ///< a stream 7196 psArray *objects, ///< An array of p4PWarpedImfileRow objects 7197 bool mdcf ///< format as mdconfig or simple 7198 ); 7199 /** p4PStackedImfileRow data structure 7200 * 7201 * Structure for representing a single row of p4PStackedImfile table data. 7202 */ 7203 7204 typedef struct { 7205 psS32 p4_id; 7206 char *class_id; 7207 char *uri; 7208 char *b1_uri; 7209 char *b2_uri; 7210 } p4PStackedImfileRow; 7211 7212 /** Creates a new p4PStackedImfileRow object 7213 * 7214 * @return A new p4PStackedImfileRow object or NULL on failure. 7215 */ 7216 7217 p4PStackedImfileRow *p4PStackedImfileRowAlloc( 7218 psS32 p4_id, 7219 const char *class_id, 7220 const char *uri, 7221 const char *b1_uri, 7222 const char *b2_uri 7223 ); 7224 7225 /** Creates a new p4PStackedImfile table 7226 * 7227 * @return true on success 7228 */ 7229 7230 bool p4PStackedImfileCreateTable( 7231 psDB *dbh ///< Database handle 7232 ); 7233 7234 /** Deletes a p4PStackedImfile table 7235 * 7236 * @return true on success 7237 */ 7238 7239 bool p4PStackedImfileDropTable( 7240 psDB *dbh ///< Database handle 7241 ); 7242 7243 /** Insert a single row into a table 7244 * 7245 * This function constructs and inserts a single row based on it's parameters. 7246 * 7247 * @return true on success 7248 */ 7249 7250 bool p4PStackedImfileInsert( 7251 psDB *dbh, ///< Database handle 7252 psS32 p4_id, 7253 const char *class_id, 7254 const char *uri, 7255 const char *b1_uri, 7256 const char *b2_uri 7257 ); 7258 7259 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 7260 * 7261 * @return A The number of rows removed or a negative value on error 7262 */ 7263 7264 long long p4PStackedImfileDelete( 7265 psDB *dbh, ///< Database handle 7266 const psMetadata *where, ///< Row match criteria 7267 unsigned long long limit ///< Maximum number of elements to delete 7268 ); 7269 7270 /** Insert a single p4PStackedImfileRow object into a table 7271 * 7272 * This function constructs and inserts a single row based on it's parameters. 7273 * 7274 * @return true on success 7275 */ 7276 7277 bool p4PStackedImfileInsertObject( 7278 psDB *dbh, ///< Database handle 7279 p4PStackedImfileRow *object ///< p4PStackedImfileRow object 7280 ); 7281 7282 /** Insert an array of p4PStackedImfileRow object into a table 7283 * 7284 * This function constructs and inserts multiple rows based on it's parameters. 7285 * 7286 * @return true on success 7287 */ 7288 7289 bool p4PStackedImfileInsertObjects( 7290 psDB *dbh, ///< Database handle 7291 psArray *objects ///< array of p4PStackedImfileRow objects 7292 ); 7293 7294 /** Insert data from a binary FITS table p4PStackedImfileRow into the database 7295 * 7296 * This function expects a psFits object with a FITS table as the first 7297 * extension. The table must have at least one row of data in it, that is of 7298 * the appropriate format (number of columns and their type). All other 7299 * extensions are ignored. 7300 * 7301 * @return true on success 7302 */ 7303 7304 bool p4PStackedImfileInsertFits( 7305 psDB *dbh, ///< Database handle 7306 const psFits *fits ///< psFits object 7307 ); 7308 7309 /** Selects up to limit from the database and returns them in a binary FITS table 7310 * 7311 * This function assumes an empty psFits object and will create a FITS table 7312 * as the first extension. 7313 * 7314 * See psDBSelectRows() for documentation on the format of where. 7315 * 7316 * @return true on success 7317 */ 7318 7319 bool p4PStackedImfileSelectRowsFits( 7320 psDB *dbh, ///< Database handle 7321 psFits *fits, ///< psFits object 7322 const psMetadata *where, ///< Row match criteria 7323 unsigned long long limit ///< Maximum number of elements to return 7324 ); 7325 7326 /** Convert a p4PStackedImfileRow into an equivalent psMetadata 7327 * 7328 * @return A psMetadata pointer or NULL on error 7329 */ 7330 7331 psMetadata *p4PStackedImfileMetadataFromObject( 7332 const p4PStackedImfileRow *object ///< fooRow to convert into a psMetadata 7333 ); 7334 7335 /** Convert a psMetadata into an equivalent fooRow 7336 * 7337 * @return A p4PStackedImfileRow pointer or NULL on error 7338 */ 7339 7340 p4PStackedImfileRow *p4PStackedImfileObjectFromMetadata( 7341 psMetadata *md ///< psMetadata to convert into a fooRow 7342 ); 7343 /** Selects up to limit rows from the database and returns as p4PStackedImfileRow objects in a psArray 7344 * 7345 * See psDBSelectRows() for documentation on the format of where. 7346 * 7347 * @return A psArray pointer or NULL on error 7348 */ 7349 7350 psArray *p4PStackedImfileSelectRowObjects( 7351 psDB *dbh, ///< Database handle 7352 const psMetadata *where, ///< Row match criteria 7353 unsigned long long limit ///< Maximum number of elements to return 7354 ); 7355 /** Deletes a row from the database coresponding to an p4PStackedImfile 7356 * 7357 * Note that a 'where' search psMetadata is constructed from each object and 7358 * used to find rows to delete. 7359 * 7360 * @return A The number of rows removed or a negative value on error 7361 */ 7362 7363 bool p4PStackedImfileDeleteObject( 7364 psDB *dbh, ///< Database handle 7365 const p4PStackedImfileRow *object ///< Object to delete 7366 ); 7367 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 7368 * 7369 * Note that a 'where' search psMetadata is constructed from each object and 7370 * used to find rows to delete. 7371 * 7372 * @return A The number of rows removed or a negative value on error 7373 */ 7374 7375 long long p4PStackedImfileDeleteRowObjects( 7376 psDB *dbh, ///< Database handle 7377 const psArray *objects, ///< Array of objects to delete 7378 unsigned long long limit ///< Maximum number of elements to delete 7379 ); 7380 /** Formats and prints an array of p4PStackedImfileRow objects 7381 * 7382 * When mdcf is set the formated output is in psMetadataConfig 7383 * format, otherwise it is in a simple tabular format. 7384 * 7385 * @return true on success 7386 */ 7387 7388 bool p4PStackedImfilePrintObjects( 7389 FILE *stream, ///< a stream 7390 psArray *objects, ///< An array of p4PStackedImfileRow objects 7391 bool mdcf ///< format as mdconfig or simple 7392 ); 7393 /** p4PDiffImfileRow data structure 7394 * 7395 * Structure for representing a single row of p4PDiffImfile table data. 7396 */ 7397 7398 typedef struct { 7399 psS32 p4_id; 7400 char *exp_tag; 7401 psS32 p3_version; 7402 char *class_id; 7403 char *uri; 7404 char *b1_uri; 7405 char *b2_uri; 7406 } p4PDiffImfileRow; 7407 7408 /** Creates a new p4PDiffImfileRow object 7409 * 7410 * @return A new p4PDiffImfileRow object or NULL on failure. 7411 */ 7412 7413 p4PDiffImfileRow *p4PDiffImfileRowAlloc( 7414 psS32 p4_id, 7415 const char *exp_tag, 7416 psS32 p3_version, 7417 const char *class_id, 7418 const char *uri, 7419 const char *b1_uri, 7420 const char *b2_uri 7421 ); 7422 7423 /** Creates a new p4PDiffImfile table 7424 * 7425 * @return true on success 7426 */ 7427 7428 bool p4PDiffImfileCreateTable( 7429 psDB *dbh ///< Database handle 7430 ); 7431 7432 /** Deletes a p4PDiffImfile table 7433 * 7434 * @return true on success 7435 */ 7436 7437 bool p4PDiffImfileDropTable( 7438 psDB *dbh ///< Database handle 7439 ); 7440 7441 /** Insert a single row into a table 7442 * 7443 * This function constructs and inserts a single row based on it's parameters. 7444 * 7445 * @return true on success 7446 */ 7447 7448 bool p4PDiffImfileInsert( 7449 psDB *dbh, ///< Database handle 7450 psS32 p4_id, 7451 const char *exp_tag, 7452 psS32 p3_version, 7453 const char *class_id, 7454 const char *uri, 7455 const char *b1_uri, 7456 const char *b2_uri 7457 ); 7458 7459 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 7460 * 7461 * @return A The number of rows removed or a negative value on error 7462 */ 7463 7464 long long p4PDiffImfileDelete( 7465 psDB *dbh, ///< Database handle 7466 const psMetadata *where, ///< Row match criteria 7467 unsigned long long limit ///< Maximum number of elements to delete 7468 ); 7469 7470 /** Insert a single p4PDiffImfileRow object into a table 7471 * 7472 * This function constructs and inserts a single row based on it's parameters. 7473 * 7474 * @return true on success 7475 */ 7476 7477 bool p4PDiffImfileInsertObject( 7478 psDB *dbh, ///< Database handle 7479 p4PDiffImfileRow *object ///< p4PDiffImfileRow object 7480 ); 7481 7482 /** Insert an array of p4PDiffImfileRow object into a table 7483 * 7484 * This function constructs and inserts multiple rows based on it's parameters. 7485 * 7486 * @return true on success 7487 */ 7488 7489 bool p4PDiffImfileInsertObjects( 7490 psDB *dbh, ///< Database handle 7491 psArray *objects ///< array of p4PDiffImfileRow objects 7492 ); 7493 7494 /** Insert data from a binary FITS table p4PDiffImfileRow into the database 7495 * 7496 * This function expects a psFits object with a FITS table as the first 7497 * extension. The table must have at least one row of data in it, that is of 7498 * the appropriate format (number of columns and their type). All other 7499 * extensions are ignored. 7500 * 7501 * @return true on success 7502 */ 7503 7504 bool p4PDiffImfileInsertFits( 7505 psDB *dbh, ///< Database handle 7506 const psFits *fits ///< psFits object 7507 ); 7508 7509 /** Selects up to limit from the database and returns them in a binary FITS table 7510 * 7511 * This function assumes an empty psFits object and will create a FITS table 7512 * as the first extension. 7513 * 7514 * See psDBSelectRows() for documentation on the format of where. 7515 * 7516 * @return true on success 7517 */ 7518 7519 bool p4PDiffImfileSelectRowsFits( 7520 psDB *dbh, ///< Database handle 7521 psFits *fits, ///< psFits object 7522 const psMetadata *where, ///< Row match criteria 7523 unsigned long long limit ///< Maximum number of elements to return 7524 ); 7525 7526 /** Convert a p4PDiffImfileRow into an equivalent psMetadata 7527 * 7528 * @return A psMetadata pointer or NULL on error 7529 */ 7530 7531 psMetadata *p4PDiffImfileMetadataFromObject( 7532 const p4PDiffImfileRow *object ///< fooRow to convert into a psMetadata 7533 ); 7534 7535 /** Convert a psMetadata into an equivalent fooRow 7536 * 7537 * @return A p4PDiffImfileRow pointer or NULL on error 7538 */ 7539 7540 p4PDiffImfileRow *p4PDiffImfileObjectFromMetadata( 7541 psMetadata *md ///< psMetadata to convert into a fooRow 7542 ); 7543 /** Selects up to limit rows from the database and returns as p4PDiffImfileRow objects in a psArray 7544 * 7545 * See psDBSelectRows() for documentation on the format of where. 7546 * 7547 * @return A psArray pointer or NULL on error 7548 */ 7549 7550 psArray *p4PDiffImfileSelectRowObjects( 7551 psDB *dbh, ///< Database handle 7552 const psMetadata *where, ///< Row match criteria 7553 unsigned long long limit ///< Maximum number of elements to return 7554 ); 7555 /** Deletes a row from the database coresponding to an p4PDiffImfile 7556 * 7557 * Note that a 'where' search psMetadata is constructed from each object and 7558 * used to find rows to delete. 7559 * 7560 * @return A The number of rows removed or a negative value on error 7561 */ 7562 7563 bool p4PDiffImfileDeleteObject( 7564 psDB *dbh, ///< Database handle 7565 const p4PDiffImfileRow *object ///< Object to delete 7566 ); 7567 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 7568 * 7569 * Note that a 'where' search psMetadata is constructed from each object and 7570 * used to find rows to delete. 7571 * 7572 * @return A The number of rows removed or a negative value on error 7573 */ 7574 7575 long long p4PDiffImfileDeleteRowObjects( 7576 psDB *dbh, ///< Database handle 7577 const psArray *objects, ///< Array of objects to delete 7578 unsigned long long limit ///< Maximum number of elements to delete 7579 ); 7580 /** Formats and prints an array of p4PDiffImfileRow objects 7581 * 7582 * When mdcf is set the formated output is in psMetadataConfig 7583 * format, otherwise it is in a simple tabular format. 7584 * 7585 * @return true on success 7586 */ 7587 7588 bool p4PDiffImfilePrintObjects( 7589 FILE *stream, ///< a stream 7590 psArray *objects, ///< An array of p4PDiffImfileRow objects 7591 bool mdcf ///< format as mdconfig or simple 7592 ); 7593 /** p4PMagicMaskImfileRow data structure 7594 * 7595 * Structure for representing a single row of p4PMagicMaskImfile table data. 7596 */ 7597 7598 typedef struct { 7599 psS32 p4_id; 7600 char *exp_tag; 7601 psS32 p3_version; 7602 char *class_id; 7603 char *uri; 7604 } p4PMagicMaskImfileRow; 7605 7606 /** Creates a new p4PMagicMaskImfileRow object 7607 * 7608 * @return A new p4PMagicMaskImfileRow object or NULL on failure. 7609 */ 7610 7611 p4PMagicMaskImfileRow *p4PMagicMaskImfileRowAlloc( 7612 psS32 p4_id, 7613 const char *exp_tag, 7614 psS32 p3_version, 7615 const char *class_id, 7616 const char *uri 7617 ); 7618 7619 /** Creates a new p4PMagicMaskImfile table 7620 * 7621 * @return true on success 7622 */ 7623 7624 bool p4PMagicMaskImfileCreateTable( 7625 psDB *dbh ///< Database handle 7626 ); 7627 7628 /** Deletes a p4PMagicMaskImfile table 7629 * 7630 * @return true on success 7631 */ 7632 7633 bool p4PMagicMaskImfileDropTable( 7634 psDB *dbh ///< Database handle 7635 ); 7636 7637 /** Insert a single row into a table 7638 * 7639 * This function constructs and inserts a single row based on it's parameters. 7640 * 7641 * @return true on success 7642 */ 7643 7644 bool p4PMagicMaskImfileInsert( 7645 psDB *dbh, ///< Database handle 7646 psS32 p4_id, 7647 const char *exp_tag, 7648 psS32 p3_version, 7649 const char *class_id, 7650 const char *uri 7651 ); 7652 7653 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 7654 * 7655 * @return A The number of rows removed or a negative value on error 7656 */ 7657 7658 long long p4PMagicMaskImfileDelete( 7659 psDB *dbh, ///< Database handle 7660 const psMetadata *where, ///< Row match criteria 7661 unsigned long long limit ///< Maximum number of elements to delete 7662 ); 7663 7664 /** Insert a single p4PMagicMaskImfileRow object into a table 7665 * 7666 * This function constructs and inserts a single row based on it's parameters. 7667 * 7668 * @return true on success 7669 */ 7670 7671 bool p4PMagicMaskImfileInsertObject( 7672 psDB *dbh, ///< Database handle 7673 p4PMagicMaskImfileRow *object ///< p4PMagicMaskImfileRow object 7674 ); 7675 7676 /** Insert an array of p4PMagicMaskImfileRow object into a table 7677 * 7678 * This function constructs and inserts multiple rows based on it's parameters. 7679 * 7680 * @return true on success 7681 */ 7682 7683 bool p4PMagicMaskImfileInsertObjects( 7684 psDB *dbh, ///< Database handle 7685 psArray *objects ///< array of p4PMagicMaskImfileRow objects 7686 ); 7687 7688 /** Insert data from a binary FITS table p4PMagicMaskImfileRow into the database 7689 * 7690 * This function expects a psFits object with a FITS table as the first 7691 * extension. The table must have at least one row of data in it, that is of 7692 * the appropriate format (number of columns and their type). All other 7693 * extensions are ignored. 7694 * 7695 * @return true on success 7696 */ 7697 7698 bool p4PMagicMaskImfileInsertFits( 7699 psDB *dbh, ///< Database handle 7700 const psFits *fits ///< psFits object 7701 ); 7702 7703 /** Selects up to limit from the database and returns them in a binary FITS table 7704 * 7705 * This function assumes an empty psFits object and will create a FITS table 7706 * as the first extension. 7707 * 7708 * See psDBSelectRows() for documentation on the format of where. 7709 * 7710 * @return true on success 7711 */ 7712 7713 bool p4PMagicMaskImfileSelectRowsFits( 7714 psDB *dbh, ///< Database handle 7715 psFits *fits, ///< psFits object 7716 const psMetadata *where, ///< Row match criteria 7717 unsigned long long limit ///< Maximum number of elements to return 7718 ); 7719 7720 /** Convert a p4PMagicMaskImfileRow into an equivalent psMetadata 7721 * 7722 * @return A psMetadata pointer or NULL on error 7723 */ 7724 7725 psMetadata *p4PMagicMaskImfileMetadataFromObject( 7726 const p4PMagicMaskImfileRow *object ///< fooRow to convert into a psMetadata 7727 ); 7728 7729 /** Convert a psMetadata into an equivalent fooRow 7730 * 7731 * @return A p4PMagicMaskImfileRow pointer or NULL on error 7732 */ 7733 7734 p4PMagicMaskImfileRow *p4PMagicMaskImfileObjectFromMetadata( 7735 psMetadata *md ///< psMetadata to convert into a fooRow 7736 ); 7737 /** Selects up to limit rows from the database and returns as p4PMagicMaskImfileRow objects in a psArray 7738 * 7739 * See psDBSelectRows() for documentation on the format of where. 7740 * 7741 * @return A psArray pointer or NULL on error 7742 */ 7743 7744 psArray *p4PMagicMaskImfileSelectRowObjects( 7745 psDB *dbh, ///< Database handle 7746 const psMetadata *where, ///< Row match criteria 7747 unsigned long long limit ///< Maximum number of elements to return 7748 ); 7749 /** Deletes a row from the database coresponding to an p4PMagicMaskImfile 7750 * 7751 * Note that a 'where' search psMetadata is constructed from each object and 7752 * used to find rows to delete. 7753 * 7754 * @return A The number of rows removed or a negative value on error 7755 */ 7756 7757 bool p4PMagicMaskImfileDeleteObject( 7758 psDB *dbh, ///< Database handle 7759 const p4PMagicMaskImfileRow *object ///< Object to delete 7760 ); 7761 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 7762 * 7763 * Note that a 'where' search psMetadata is constructed from each object and 7764 * used to find rows to delete. 7765 * 7766 * @return A The number of rows removed or a negative value on error 7767 */ 7768 7769 long long p4PMagicMaskImfileDeleteRowObjects( 7770 psDB *dbh, ///< Database handle 7771 const psArray *objects, ///< Array of objects to delete 7772 unsigned long long limit ///< Maximum number of elements to delete 7773 ); 7774 /** Formats and prints an array of p4PMagicMaskImfileRow objects 7775 * 7776 * When mdcf is set the formated output is in psMetadataConfig 7777 * format, otherwise it is in a simple tabular format. 7778 * 7779 * @return true on success 7780 */ 7781 7782 bool p4PMagicMaskImfilePrintObjects( 7783 FILE *stream, ///< a stream 7784 psArray *objects, ///< An array of p4PMagicMaskImfileRow objects 7785 bool mdcf ///< format as mdconfig or simple 7786 ); 6599 7787 6600 7788 /// @} … … 6604 7792 #endif 6605 7793 6606 #endif // DETRUNSUMMARY_DB_H7794 #endif // P4PMAGICMASKIMFILE_DB_H
Note:
See TracChangeset
for help on using the changeset viewer.
