Changeset 3381 for trunk/psLib/src/astronomy/psMetadata.h
- Timestamp:
- Mar 7, 2005, 10:58:51 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astronomy/psMetadata.h (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/psMetadata.h
r3341 r3381 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.3 8$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 2-28 23:34:10 $13 * @version $Revision: 1.39 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-03-07 20:58:50 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 21 21 #include <stdarg.h> 22 22 #include <stdio.h> 23 #include <sys/types.h> 24 #include <regex.h> 23 25 24 26 #include "psHash.h" … … 35 37 */ 36 38 typedef enum { 37 PS_META_S32, ///< Primitive data.38 PS_META_F32, ///< Primitive data.39 PS_META_F64, ///< Primitive data.40 PS_META_BOOL, ///< Primitive data.39 PS_META_S32, ///< psS32 primitive data. 40 PS_META_F32, ///< psF32 primitive data. 41 PS_META_F64, ///< psF64 primitive data. 42 PS_META_BOOL, ///< psBool primitive data. 41 43 PS_META_LIST, ///< List data (Stored as item.data.list). 42 44 PS_META_STR, ///< String data (Stored as item.data.V). … … 49 51 PS_META_ASTROM, ///< Astrometric coefficients (Stored as item.data.V). 50 52 PS_META_UNKNOWN, ///< Other data (Stored as item.data.V). 53 PS_META_MULTI, ///< Used internally, do not create an metadata item of this type. 51 54 PS_META_NTYPE ///< Number of types. Must be last. 52 55 } psMetadataType; … … 72 75 typedef enum { 73 76 PS_META_DEFAULT = 0, ///< default behaviour (duplicate entry is an error) 74 PS_META_REPLACE = 0x10000 ///< allow entry to be replaced 77 PS_META_REPLACE = 0x1000000, ///< allow entry to be replaced 78 PS_META_DUPLICATE_OK = 0x2000000 ///< allow duplicate entries 75 79 } psMetadataFlags; 80 81 #define PS_METADATA_FLAGS_MASK 0xFF000000 82 #define PS_METADATA_TYPE_MASK 0x00FFFFFF 76 83 77 84 /** Metadata data structure. … … 88 95 } 89 96 psMetadata; 97 98 /** Metadata iterator 99 * 100 * Iterator for metadata. 101 */ 102 typedef struct 103 { 104 psListIterator* iter; ///< iterator for the psMetadata's psList 105 regex_t* preg; ///< the subsetting regular expression 106 } 107 psMetadataIterator; 108 90 109 91 110 /** Metadata item data structure. … … 134 153 ); 135 154 155 /** Create a metadata item with specified string data. 156 * 157 * Returns a fill psMetadataItem ready for insertion into the psMetadata 158 * struct. 159 * 160 * @return psMetadataItem* : Pointer metadata item. 161 */ 136 162 psMetadataItem* psMetadataItemAllocStr( 137 const char* name, 138 const char* comment, 139 const char* value 140 ); 141 163 const char* name, ///< Name of metadata item. 164 const char* comment, ///< Comment for metadata item. 165 const char* value ///< the value of the metadata item. 166 ); 167 168 /** Create a metadata item with specified psF32 data. 169 * 170 * Returns a fill psMetadataItem ready for insertion into the psMetadata 171 * struct. 172 * 173 * @return psMetadataItem* : Pointer metadata item. 174 */ 142 175 psMetadataItem* psMetadataItemAllocF32( 143 const char* name, 144 const char* comment, 145 psF32 value 146 ); 147 176 const char* name, ///< Name of metadata item. 177 const char* comment, ///< Comment for metadata item. 178 psF32 value ///< the value of the metadata item. 179 ); 180 181 /** Create a metadata item with specified psF64 data. 182 * 183 * Returns a fill psMetadataItem ready for insertion into the psMetadata 184 * struct. 185 * 186 * @return psMetadataItem* : Pointer metadata item. 187 */ 148 188 psMetadataItem* psMetadataItemAllocF64( 149 const char* name, 150 const char* comment, 151 psF64 value 152 ); 153 189 const char* name, ///< Name of metadata item. 190 const char* comment, ///< Comment for metadata item. 191 psF64 value ///< the value of the metadata item. 192 ); 193 194 /** Create a metadata item with specified psS32 data. 195 * 196 * Returns a fill psMetadataItem ready for insertion into the psMetadata 197 * struct. 198 * 199 * @return psMetadataItem* : Pointer metadata item. 200 */ 154 201 psMetadataItem* psMetadataItemAllocS32( 155 const char* name, 156 const char* comment, 157 psS32 value 158 ); 159 202 const char* name, ///< Name of metadata item. 203 const char* comment, ///< Comment for metadata item. 204 psS32 value ///< the value of the metadata item. 205 ); 206 207 /** Create a metadata item with specified psBool data. 208 * 209 * Returns a fill psMetadataItem ready for insertion into the psMetadata 210 * struct. 211 * 212 * @return psMetadataItem* : Pointer metadata item. 213 */ 160 214 psMetadataItem* psMetadataItemAllocBool( 161 const char* name, 162 const char* comment, 163 psBool value 215 const char* name, ///< Name of metadata item. 216 const char* comment, ///< Comment for metadata item. 217 psBool value ///< the value of the metadata item. 164 218 ); 165 219 … … 207 261 psMetadata* md, ///< Metadata collection to insert metadat item. 208 262 psMetadataItem* item, ///< Metadata item to be added. 209 psS32 location ///< Location to be added. 263 psS32 location, ///< Location to be added. 264 psS32 flags ///< Options flag mask, see psMetadataFlags enum 210 265 ); 211 266 … … 218 273 psBool psMetadataAdd( 219 274 psMetadata* md, ///< Metadata collection to insert metadat item. 220 psS32 where,///< Location to be added.275 psS32 location, ///< Location to be added. 221 276 const char *name, ///< Name of metadata item. 222 psMetadataType type, ///< Type of metadata item.277 int type, ///< Type of metadata item (psMetadataType) and options (psMetadataFlags) 223 278 const char *comment, ///< Comment for metadata item. 224 279 ... ///< Arguments for name formatting and metadata item data. 225 280 ); 226 281 227 psBool psMetadataAddS32(psMetadata* md, psS32 where, const char* name, 282 #ifndef SWIG 283 /** Create and add a metadata item to metadata collection. 284 * 285 * Creates a new metadata item add to the metadata collection. 286 * 287 * @return bool: True for success, false for failure. 288 */ 289 psBool psMetadataAddV( 290 psMetadata* md, ///< Metadata collection to insert metadat item. 291 psS32 location, ///< Location to be added. 292 const char *name, ///< Name of metadata item. 293 int type, ///< Type of metadata item (psMetadataType) and options (psMetadataFlags) 294 const char *comment, ///< Comment for metadata item. 295 va_list list ///< Arguments for name formatting and metadata item data. 296 ); 297 #endif 298 299 psBool psMetadataAddS32(psMetadata* md, psS32 location, const char* name, 228 300 const char* comment, psS32 value); 229 psBool psMetadataAddF32(psMetadata* md, psS32 where, const char* name,301 psBool psMetadataAddF32(psMetadata* md, psS32 location, const char* name, 230 302 const char* comment, psF32 value); 231 psBool psMetadataAddF64(psMetadata* md, psS32 where, const char* name,303 psBool psMetadataAddF64(psMetadata* md, psS32 location, const char* name, 232 304 const char* comment, psF64 value); 233 psBool psMetadataAddList(psMetadata* md, psS32 where, const char* name,305 psBool psMetadataAddList(psMetadata* md, psS32 location, const char* name, 234 306 const char* comment, psList* value); 235 psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name,307 psBool psMetadataAddStr(psMetadata* md, psS32 location, const char* name, 236 308 const char* comment, const char* value); 237 psBool psMetadataAddVector(psMetadata* md, psS32 where, const char* name,309 psBool psMetadataAddVector(psMetadata* md, psS32 location, const char* name, 238 310 const char* comment, psVector* value); 239 psBool psMetadataAddImage(psMetadata* md, psS32 where, const char* name,311 psBool psMetadataAddImage(psMetadata* md, psS32 location, const char* name, 240 312 const char* comment, psImage* value); 241 psBool psMetadataAddHash(psMetadata* md, psS32 where, const char* name,313 psBool psMetadataAddHash(psMetadata* md, psS32 location, const char* name, 242 314 const char* comment, psHash* value); 243 psBool psMetadataAddLookupTable(psMetadata* md, psS32 where, const char* name,315 psBool psMetadataAddLookupTable(psMetadata* md, psS32 location, const char* name, 244 316 const char* comment, psLookupTable* value); 245 psBool psMetadataAddUnknown(psMetadata* md, psS32 where, const char* name,317 psBool psMetadataAddUnknown(psMetadata* md, psS32 location, const char* name, 246 318 const char* comment, psPtr value); 247 319 … … 340 412 * @return void* : Value of metadata item. 341 413 */ 342 void*psMetadataLookupPtr(414 psPtr psMetadataLookupPtr( 343 415 psBool *status, ///< Status of lookup. 344 416 psMetadata* md, ///< Metadata collection to lookup metadata item. … … 354 426 */ 355 427 psMetadataItem* psMetadataGet( 356 psMetadata* md, ///< Metadata collection to insert metadat item. 357 psS32 where ///< Location to be retrieved. 428 psMetadata* md, ///< Metadata collection to insert metadat item. 429 psS32 location ///< Location to be retrieved. 430 ); 431 432 /** Creates a psMetadataIterator to iterate over the specified psMetadata. 433 * 434 * Supports the subsetting of the metadata via keyword using regular 435 * expression. If no regular expression is specified, iteration 436 * over the entire psMetadata is performed. 437 * 438 * @return psMetadataIterator* a new psMetadataIterator, of NULL if error occurred 439 */ 440 psMetadataIterator* psMetadataIteratorAlloc( 441 psMetadata* md, ///< the psMetadata to iterate with 442 int location, ///< the initial starting point (after subsetting). 443 const char* regex 444 ///< A regular expression for subsetting the psMetadata. If NULL, no 445 ///< subsetting is performed. 446 ); 447 448 /** Set the iterator of the psMetadat to a given position. If location is 449 * invalid the iterator position is not changed. 450 * 451 * @return psBool TRUE if iterator successfully set, otherwise FALSE. 452 */ 453 psBool psMetadataIteratorSet( 454 psMetadataIterator* iterator, ///< psMetadata iterator 455 int location ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL 456 ); 457 458 /** Position the specified iterator to the next matching item in psMetadata, 459 * given the regular expression of the iterator 460 * 461 * @return psPtr the psMetadataItem at the original iterator position 462 * or NULL if the iterator went past the end of the list. 463 */ 464 psMetadataItem* psMetadataGetAndIncrement( 465 psMetadataIterator* iterator ///< iterator to move 466 ); 467 468 /** Position the specified iterator to the previous matching item in psMetadata, 469 * given the regular expression of the iterator 470 * 471 * @return psPtr the psMetadataItem at the original iterator position 472 * or NULL if the iterator went past the beginning of the 473 * list. 474 */ 475 psMetadataItem* psMetadataGetAndDecrement( 476 psMetadataIterator* iterator ///< iterator to move 358 477 ); 359 478
Note:
See TracChangeset
for help on using the changeset viewer.
