IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 9, 2008, 5:11:49 PM (18 years ago)
Author:
jhoblitt
Message:

faketool merge

File:
1 edited

Legend:

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

    r17872 r18044  
    34833483typedef struct {
    34843484    psS64           cam_id;
    3485     psS64           chip_id;
    34863485    char            *uri;
    34873486    psF32           bg;
     
    35203519camProcessedExpRow *camProcessedExpRowAlloc(
    35213520    psS64           cam_id,
    3522     psS64           chip_id,
    35233521    const char      *uri,
    35243522    psF32           bg,
     
    35783576    psDB            *dbh,               ///< Database handle
    35793577    psS64           cam_id,
    3580     psS64           chip_id,
    35813578    const char      *uri,
    35823579    psF32           bg,
     
    39503947    bool            mdcf                ///< format as mdconfig or simple
    39513948);
     3949/** fakeRunRow data structure
     3950 *
     3951 * Structure for representing a single row of fakeRun table data.
     3952 */
     3953
     3954typedef struct {
     3955    psS64           fake_id;
     3956    psS64           cam_id;
     3957    char            *state;
     3958    char            *workdir;
     3959    char            *label;
     3960    char            *reduction;
     3961    char            *expgroup;
     3962    char            *dvodb;
     3963    char            *tess_id;
     3964    char            *end_stage;
     3965    psTime*         epoch;
     3966} fakeRunRow;
     3967
     3968/** Creates a new fakeRunRow object
     3969 *
     3970 *  @return A new fakeRunRow object or NULL on failure.
     3971 */
     3972
     3973fakeRunRow *fakeRunRowAlloc(
     3974    psS64           fake_id,
     3975    psS64           cam_id,
     3976    const char      *state,
     3977    const char      *workdir,
     3978    const char      *label,
     3979    const char      *reduction,
     3980    const char      *expgroup,
     3981    const char      *dvodb,
     3982    const char      *tess_id,
     3983    const char      *end_stage,
     3984    psTime*         epoch
     3985);
     3986
     3987/** Creates a new fakeRun table
     3988 *
     3989 * @return true on success
     3990 */
     3991
     3992bool fakeRunCreateTable(
     3993    psDB            *dbh                ///< Database handle
     3994);
     3995
     3996/** Deletes a fakeRun table
     3997 *
     3998 * @return true on success
     3999 */
     4000
     4001bool fakeRunDropTable(
     4002    psDB            *dbh                ///< Database handle
     4003);
     4004
     4005/** Insert a single row into a table
     4006 *
     4007 * This function constructs and inserts a single row based on it's parameters.
     4008 *
     4009 * @return true on success
     4010 */
     4011
     4012bool fakeRunInsert(
     4013    psDB            *dbh,               ///< Database handle
     4014    psS64           fake_id,
     4015    psS64           cam_id,
     4016    const char      *state,
     4017    const char      *workdir,
     4018    const char      *label,
     4019    const char      *reduction,
     4020    const char      *expgroup,
     4021    const char      *dvodb,
     4022    const char      *tess_id,
     4023    const char      *end_stage,
     4024    psTime*         epoch
     4025);
     4026
     4027/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     4028 *
     4029 * @return A The number of rows removed or a negative value on error
     4030 */
     4031
     4032long long fakeRunDelete(
     4033    psDB            *dbh,               ///< Database handle
     4034    const psMetadata *where,            ///< Row match criteria
     4035    unsigned long long limit            ///< Maximum number of elements to delete
     4036);
     4037
     4038/** Insert a single fakeRunRow object into a table
     4039 *
     4040 * This function constructs and inserts a single row based on it's parameters.
     4041 *
     4042 * @return true on success
     4043 */
     4044
     4045bool fakeRunInsertObject(
     4046    psDB            *dbh,               ///< Database handle
     4047    fakeRunRow      *object             ///< fakeRunRow object
     4048);
     4049
     4050/** Insert an array of fakeRunRow object into a table
     4051 *
     4052 * This function constructs and inserts multiple rows based on it's parameters.
     4053 *
     4054 * @return true on success
     4055 */
     4056
     4057bool fakeRunInsertObjects(
     4058    psDB            *dbh,               ///< Database handle
     4059    psArray         *objects            ///< array of fakeRunRow objects
     4060);
     4061
     4062/** Insert data from a binary FITS table fakeRunRow into the database
     4063 *
     4064 * This function expects a psFits object with a FITS table as the first
     4065 * extension.  The table must have at least one row of data in it, that is of
     4066 * the appropriate format (number of columns and their type).  All other
     4067 * extensions are ignored.
     4068 *
     4069 * @return true on success
     4070 */
     4071
     4072bool fakeRunInsertFits(
     4073    psDB            *dbh,               ///< Database handle
     4074    const psFits    *fits               ///< psFits object
     4075);
     4076
     4077/** Selects up to limit from the database and returns them in a binary FITS table
     4078 *
     4079 * This function assumes an empty psFits object and will create a FITS table
     4080 * as the first extension.
     4081 *
     4082 *  See psDBSelectRows() for documentation on the format of where.
     4083 *
     4084 * @return true on success
     4085 */
     4086
     4087bool fakeRunSelectRowsFits(
     4088    psDB            *dbh,               ///< Database handle
     4089    psFits          *fits,              ///< psFits object
     4090    const psMetadata *where,            ///< Row match criteria
     4091    unsigned long long limit            ///< Maximum number of elements to return
     4092);
     4093
     4094/** Convert a fakeRunRow into an equivalent psMetadata
     4095 *
     4096 * @return A psMetadata pointer or NULL on error
     4097 */
     4098
     4099psMetadata *fakeRunMetadataFromObject(
     4100    const fakeRunRow *object             ///< fooRow to convert into a psMetadata
     4101);
     4102
     4103/** Convert a psMetadata into an equivalent fooRow
     4104 *
     4105 * @return A fakeRunRow pointer or NULL on error
     4106 */
     4107
     4108fakeRunRow *fakeRunObjectFromMetadata(
     4109    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     4110);
     4111/** Selects up to limit rows from the database and returns as fakeRunRow objects in a psArray
     4112 *
     4113 *  See psDBSelectRows() for documentation on the format of where.
     4114 *
     4115 * @return A psArray pointer or NULL on error
     4116 */
     4117
     4118psArray *fakeRunSelectRowObjects(
     4119    psDB            *dbh,               ///< Database handle
     4120    const psMetadata *where,            ///< Row match criteria
     4121    unsigned long long limit            ///< Maximum number of elements to return
     4122);
     4123/** Deletes a row from the database coresponding to an fakeRun
     4124 *
     4125 *  Note that a 'where' search psMetadata is constructed from each object and
     4126 *  used to find rows to delete.
     4127 *
     4128 * @return A The number of rows removed or a negative value on error
     4129 */
     4130
     4131bool fakeRunDeleteObject(
     4132    psDB            *dbh,               ///< Database handle
     4133    const fakeRunRow *object    ///< Object to delete
     4134);
     4135/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     4136 *
     4137 *  Note that a 'where' search psMetadata is constructed from each object and
     4138 *  used to find rows to delete.
     4139 *
     4140 * @return A The number of rows removed or a negative value on error
     4141 */
     4142
     4143long long fakeRunDeleteRowObjects(
     4144    psDB            *dbh,               ///< Database handle
     4145    const psArray   *objects,           ///< Array of objects to delete
     4146    unsigned long long limit            ///< Maximum number of elements to delete
     4147);
     4148/** Formats and prints an array of fakeRunRow objects
     4149 *
     4150 * When mdcf is set the formated output is in psMetadataConfig
     4151 * format, otherwise it is in a simple tabular format.
     4152 *
     4153 * @return true on success
     4154 */
     4155
     4156bool fakeRunPrintObjects(
     4157    FILE            *stream,            ///< a stream
     4158    psArray         *objects,           ///< An array of fakeRunRow objects
     4159    bool            mdcf                ///< format as mdconfig or simple
     4160);
     4161/** Formats and prints an fakeRunRow object
     4162 *
     4163 * When mdcf is set the formated output is in psMetadataConfig
     4164 * format, otherwise it is in a simple tabular format.
     4165 *
     4166 * @return true on success
     4167 */
     4168
     4169bool fakeRunPrintObject(
     4170    FILE            *stream,            ///< a stream
     4171    fakeRunRow *object,    ///< an fakeRunRow object
     4172    bool            mdcf                ///< format as mdconfig or simple
     4173);
     4174/** fakeProcessedImfileRow data structure
     4175 *
     4176 * Structure for representing a single row of fakeProcessedImfile table data.
     4177 */
     4178
     4179typedef struct {
     4180    psS64           fake_id;
     4181    psS64           exp_id;
     4182    char            *class_id;
     4183    char            *uri;
     4184    psF32           dtime_fake;
     4185    char            *hostname;
     4186    char            *path_base;
     4187    psS16           fault;
     4188    psTime*         epoch;
     4189} fakeProcessedImfileRow;
     4190
     4191/** Creates a new fakeProcessedImfileRow object
     4192 *
     4193 *  @return A new fakeProcessedImfileRow object or NULL on failure.
     4194 */
     4195
     4196fakeProcessedImfileRow *fakeProcessedImfileRowAlloc(
     4197    psS64           fake_id,
     4198    psS64           exp_id,
     4199    const char      *class_id,
     4200    const char      *uri,
     4201    psF32           dtime_fake,
     4202    const char      *hostname,
     4203    const char      *path_base,
     4204    psS16           fault,
     4205    psTime*         epoch
     4206);
     4207
     4208/** Creates a new fakeProcessedImfile table
     4209 *
     4210 * @return true on success
     4211 */
     4212
     4213bool fakeProcessedImfileCreateTable(
     4214    psDB            *dbh                ///< Database handle
     4215);
     4216
     4217/** Deletes a fakeProcessedImfile table
     4218 *
     4219 * @return true on success
     4220 */
     4221
     4222bool fakeProcessedImfileDropTable(
     4223    psDB            *dbh                ///< Database handle
     4224);
     4225
     4226/** Insert a single row into a table
     4227 *
     4228 * This function constructs and inserts a single row based on it's parameters.
     4229 *
     4230 * @return true on success
     4231 */
     4232
     4233bool fakeProcessedImfileInsert(
     4234    psDB            *dbh,               ///< Database handle
     4235    psS64           fake_id,
     4236    psS64           exp_id,
     4237    const char      *class_id,
     4238    const char      *uri,
     4239    psF32           dtime_fake,
     4240    const char      *hostname,
     4241    const char      *path_base,
     4242    psS16           fault,
     4243    psTime*         epoch
     4244);
     4245
     4246/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     4247 *
     4248 * @return A The number of rows removed or a negative value on error
     4249 */
     4250
     4251long long fakeProcessedImfileDelete(
     4252    psDB            *dbh,               ///< Database handle
     4253    const psMetadata *where,            ///< Row match criteria
     4254    unsigned long long limit            ///< Maximum number of elements to delete
     4255);
     4256
     4257/** Insert a single fakeProcessedImfileRow object into a table
     4258 *
     4259 * This function constructs and inserts a single row based on it's parameters.
     4260 *
     4261 * @return true on success
     4262 */
     4263
     4264bool fakeProcessedImfileInsertObject(
     4265    psDB            *dbh,               ///< Database handle
     4266    fakeProcessedImfileRow *object             ///< fakeProcessedImfileRow object
     4267);
     4268
     4269/** Insert an array of fakeProcessedImfileRow object into a table
     4270 *
     4271 * This function constructs and inserts multiple rows based on it's parameters.
     4272 *
     4273 * @return true on success
     4274 */
     4275
     4276bool fakeProcessedImfileInsertObjects(
     4277    psDB            *dbh,               ///< Database handle
     4278    psArray         *objects            ///< array of fakeProcessedImfileRow objects
     4279);
     4280
     4281/** Insert data from a binary FITS table fakeProcessedImfileRow into the database
     4282 *
     4283 * This function expects a psFits object with a FITS table as the first
     4284 * extension.  The table must have at least one row of data in it, that is of
     4285 * the appropriate format (number of columns and their type).  All other
     4286 * extensions are ignored.
     4287 *
     4288 * @return true on success
     4289 */
     4290
     4291bool fakeProcessedImfileInsertFits(
     4292    psDB            *dbh,               ///< Database handle
     4293    const psFits    *fits               ///< psFits object
     4294);
     4295
     4296/** Selects up to limit from the database and returns them in a binary FITS table
     4297 *
     4298 * This function assumes an empty psFits object and will create a FITS table
     4299 * as the first extension.
     4300 *
     4301 *  See psDBSelectRows() for documentation on the format of where.
     4302 *
     4303 * @return true on success
     4304 */
     4305
     4306bool fakeProcessedImfileSelectRowsFits(
     4307    psDB            *dbh,               ///< Database handle
     4308    psFits          *fits,              ///< psFits object
     4309    const psMetadata *where,            ///< Row match criteria
     4310    unsigned long long limit            ///< Maximum number of elements to return
     4311);
     4312
     4313/** Convert a fakeProcessedImfileRow into an equivalent psMetadata
     4314 *
     4315 * @return A psMetadata pointer or NULL on error
     4316 */
     4317
     4318psMetadata *fakeProcessedImfileMetadataFromObject(
     4319    const fakeProcessedImfileRow *object             ///< fooRow to convert into a psMetadata
     4320);
     4321
     4322/** Convert a psMetadata into an equivalent fooRow
     4323 *
     4324 * @return A fakeProcessedImfileRow pointer or NULL on error
     4325 */
     4326
     4327fakeProcessedImfileRow *fakeProcessedImfileObjectFromMetadata(
     4328    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     4329);
     4330/** Selects up to limit rows from the database and returns as fakeProcessedImfileRow objects in a psArray
     4331 *
     4332 *  See psDBSelectRows() for documentation on the format of where.
     4333 *
     4334 * @return A psArray pointer or NULL on error
     4335 */
     4336
     4337psArray *fakeProcessedImfileSelectRowObjects(
     4338    psDB            *dbh,               ///< Database handle
     4339    const psMetadata *where,            ///< Row match criteria
     4340    unsigned long long limit            ///< Maximum number of elements to return
     4341);
     4342/** Deletes a row from the database coresponding to an fakeProcessedImfile
     4343 *
     4344 *  Note that a 'where' search psMetadata is constructed from each object and
     4345 *  used to find rows to delete.
     4346 *
     4347 * @return A The number of rows removed or a negative value on error
     4348 */
     4349
     4350bool fakeProcessedImfileDeleteObject(
     4351    psDB            *dbh,               ///< Database handle
     4352    const fakeProcessedImfileRow *object    ///< Object to delete
     4353);
     4354/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     4355 *
     4356 *  Note that a 'where' search psMetadata is constructed from each object and
     4357 *  used to find rows to delete.
     4358 *
     4359 * @return A The number of rows removed or a negative value on error
     4360 */
     4361
     4362long long fakeProcessedImfileDeleteRowObjects(
     4363    psDB            *dbh,               ///< Database handle
     4364    const psArray   *objects,           ///< Array of objects to delete
     4365    unsigned long long limit            ///< Maximum number of elements to delete
     4366);
     4367/** Formats and prints an array of fakeProcessedImfileRow objects
     4368 *
     4369 * When mdcf is set the formated output is in psMetadataConfig
     4370 * format, otherwise it is in a simple tabular format.
     4371 *
     4372 * @return true on success
     4373 */
     4374
     4375bool fakeProcessedImfilePrintObjects(
     4376    FILE            *stream,            ///< a stream
     4377    psArray         *objects,           ///< An array of fakeProcessedImfileRow objects
     4378    bool            mdcf                ///< format as mdconfig or simple
     4379);
     4380/** Formats and prints an fakeProcessedImfileRow object
     4381 *
     4382 * When mdcf is set the formated output is in psMetadataConfig
     4383 * format, otherwise it is in a simple tabular format.
     4384 *
     4385 * @return true on success
     4386 */
     4387
     4388bool fakeProcessedImfilePrintObject(
     4389    FILE            *stream,            ///< a stream
     4390    fakeProcessedImfileRow *object,    ///< an fakeProcessedImfileRow object
     4391    bool            mdcf                ///< format as mdconfig or simple
     4392);
     4393/** fakeMaskRow data structure
     4394 *
     4395 * Structure for representing a single row of fakeMask table data.
     4396 */
     4397
     4398typedef struct {
     4399    char            *label;
     4400} fakeMaskRow;
     4401
     4402/** Creates a new fakeMaskRow object
     4403 *
     4404 *  @return A new fakeMaskRow object or NULL on failure.
     4405 */
     4406
     4407fakeMaskRow *fakeMaskRowAlloc(
     4408    const char      *label
     4409);
     4410
     4411/** Creates a new fakeMask table
     4412 *
     4413 * @return true on success
     4414 */
     4415
     4416bool fakeMaskCreateTable(
     4417    psDB            *dbh                ///< Database handle
     4418);
     4419
     4420/** Deletes a fakeMask table
     4421 *
     4422 * @return true on success
     4423 */
     4424
     4425bool fakeMaskDropTable(
     4426    psDB            *dbh                ///< Database handle
     4427);
     4428
     4429/** Insert a single row into a table
     4430 *
     4431 * This function constructs and inserts a single row based on it's parameters.
     4432 *
     4433 * @return true on success
     4434 */
     4435
     4436bool fakeMaskInsert(
     4437    psDB            *dbh,               ///< Database handle
     4438    const char      *label
     4439);
     4440
     4441/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     4442 *
     4443 * @return A The number of rows removed or a negative value on error
     4444 */
     4445
     4446long long fakeMaskDelete(
     4447    psDB            *dbh,               ///< Database handle
     4448    const psMetadata *where,            ///< Row match criteria
     4449    unsigned long long limit            ///< Maximum number of elements to delete
     4450);
     4451
     4452/** Insert a single fakeMaskRow object into a table
     4453 *
     4454 * This function constructs and inserts a single row based on it's parameters.
     4455 *
     4456 * @return true on success
     4457 */
     4458
     4459bool fakeMaskInsertObject(
     4460    psDB            *dbh,               ///< Database handle
     4461    fakeMaskRow     *object             ///< fakeMaskRow object
     4462);
     4463
     4464/** Insert an array of fakeMaskRow object into a table
     4465 *
     4466 * This function constructs and inserts multiple rows based on it's parameters.
     4467 *
     4468 * @return true on success
     4469 */
     4470
     4471bool fakeMaskInsertObjects(
     4472    psDB            *dbh,               ///< Database handle
     4473    psArray         *objects            ///< array of fakeMaskRow objects
     4474);
     4475
     4476/** Insert data from a binary FITS table fakeMaskRow into the database
     4477 *
     4478 * This function expects a psFits object with a FITS table as the first
     4479 * extension.  The table must have at least one row of data in it, that is of
     4480 * the appropriate format (number of columns and their type).  All other
     4481 * extensions are ignored.
     4482 *
     4483 * @return true on success
     4484 */
     4485
     4486bool fakeMaskInsertFits(
     4487    psDB            *dbh,               ///< Database handle
     4488    const psFits    *fits               ///< psFits object
     4489);
     4490
     4491/** Selects up to limit from the database and returns them in a binary FITS table
     4492 *
     4493 * This function assumes an empty psFits object and will create a FITS table
     4494 * as the first extension.
     4495 *
     4496 *  See psDBSelectRows() for documentation on the format of where.
     4497 *
     4498 * @return true on success
     4499 */
     4500
     4501bool fakeMaskSelectRowsFits(
     4502    psDB            *dbh,               ///< Database handle
     4503    psFits          *fits,              ///< psFits object
     4504    const psMetadata *where,            ///< Row match criteria
     4505    unsigned long long limit            ///< Maximum number of elements to return
     4506);
     4507
     4508/** Convert a fakeMaskRow into an equivalent psMetadata
     4509 *
     4510 * @return A psMetadata pointer or NULL on error
     4511 */
     4512
     4513psMetadata *fakeMaskMetadataFromObject(
     4514    const fakeMaskRow *object             ///< fooRow to convert into a psMetadata
     4515);
     4516
     4517/** Convert a psMetadata into an equivalent fooRow
     4518 *
     4519 * @return A fakeMaskRow pointer or NULL on error
     4520 */
     4521
     4522fakeMaskRow *fakeMaskObjectFromMetadata(
     4523    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     4524);
     4525/** Selects up to limit rows from the database and returns as fakeMaskRow objects in a psArray
     4526 *
     4527 *  See psDBSelectRows() for documentation on the format of where.
     4528 *
     4529 * @return A psArray pointer or NULL on error
     4530 */
     4531
     4532psArray *fakeMaskSelectRowObjects(
     4533    psDB            *dbh,               ///< Database handle
     4534    const psMetadata *where,            ///< Row match criteria
     4535    unsigned long long limit            ///< Maximum number of elements to return
     4536);
     4537/** Deletes a row from the database coresponding to an fakeMask
     4538 *
     4539 *  Note that a 'where' search psMetadata is constructed from each object and
     4540 *  used to find rows to delete.
     4541 *
     4542 * @return A The number of rows removed or a negative value on error
     4543 */
     4544
     4545bool fakeMaskDeleteObject(
     4546    psDB            *dbh,               ///< Database handle
     4547    const fakeMaskRow *object    ///< Object to delete
     4548);
     4549/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     4550 *
     4551 *  Note that a 'where' search psMetadata is constructed from each object and
     4552 *  used to find rows to delete.
     4553 *
     4554 * @return A The number of rows removed or a negative value on error
     4555 */
     4556
     4557long long fakeMaskDeleteRowObjects(
     4558    psDB            *dbh,               ///< Database handle
     4559    const psArray   *objects,           ///< Array of objects to delete
     4560    unsigned long long limit            ///< Maximum number of elements to delete
     4561);
     4562/** Formats and prints an array of fakeMaskRow objects
     4563 *
     4564 * When mdcf is set the formated output is in psMetadataConfig
     4565 * format, otherwise it is in a simple tabular format.
     4566 *
     4567 * @return true on success
     4568 */
     4569
     4570bool fakeMaskPrintObjects(
     4571    FILE            *stream,            ///< a stream
     4572    psArray         *objects,           ///< An array of fakeMaskRow objects
     4573    bool            mdcf                ///< format as mdconfig or simple
     4574);
     4575/** Formats and prints an fakeMaskRow object
     4576 *
     4577 * When mdcf is set the formated output is in psMetadataConfig
     4578 * format, otherwise it is in a simple tabular format.
     4579 *
     4580 * @return true on success
     4581 */
     4582
     4583bool fakeMaskPrintObject(
     4584    FILE            *stream,            ///< a stream
     4585    fakeMaskRow *object,    ///< an fakeMaskRow object
     4586    bool            mdcf                ///< format as mdconfig or simple
     4587);
    39524588/** warpRunRow data structure
    39534589 *
     
    39574593typedef struct {
    39584594    psS64           warp_id;
    3959     psS64           cam_id;
     4595    psS64           fake_id;
    39604596    char            *mode;
    39614597    char            *state;
     
    39774613warpRunRow *warpRunRowAlloc(
    39784614    psS64           warp_id,
    3979     psS64           cam_id,
     4615    psS64           fake_id,
    39804616    const char      *mode,
    39814617    const char      *state,
     
    40184654    psDB            *dbh,               ///< Database handle
    40194655    psS64           warp_id,
    4020     psS64           cam_id,
     4656    psS64           fake_id,
    40214657    const char      *mode,
    40224658    const char      *state,
     
    41874823    char            *skycell_id;
    41884824    char            *tess_id;
    4189     psS64           cam_id;
    41904825    char            *class_id;
    41914826    psS16           fault;
     
    42014836    const char      *skycell_id,
    42024837    const char      *tess_id,
    4203     psS64           cam_id,
    42044838    const char      *class_id,
    42054839    psS16           fault
     
    42364870    const char      *skycell_id,
    42374871    const char      *tess_id,
    4238     psS64           cam_id,
    42394872    const char      *class_id,
    42404873    psS16           fault
Note: See TracChangeset for help on using the changeset viewer.