IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 3, 2004, 1:19:07 PM (22 years ago)
Author:
harman
Message:

Updates for version 10 of SDRS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psMetadata.h

    r2521 r2607  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-11-30 00:27:14 $
     13*  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-12-03 23:14:34 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3333 */
    3434typedef enum {
    35     PS_META_ITEM_SET = 0,              ///< Null. Metadata is in psMetadataItem.items
    36     PS_META_BOOL,                      ///< Boolean data.
    37     PS_META_S32,                       ///< Signed 32-bit integer data.
    38     PS_META_F32,                       ///< Single-precision float data.
    39     PS_META_F64,                       ///< Double-precision float data.
    40     PS_META_STR,                       ///< String data (Stored in as psPtr ).
    41     PS_META_VEC,                       ///< Vector data (Stored in as psPtr ).
    42     PS_META_HASH,                      ///< Hash data (Stored in as psPtr ).
    43     PS_META_IMG,                       ///< Image data (Stored in as psPtr ).
    44     PS_META_LOOKUPTABLE,               ///< Lookup table data (Stored as void *).
    45     PS_META_JPEG,                      ///< JPEG data (Stored in as psPtr ).
    46     PS_META_PNG,                       ///< PNG data (Stored in as psPtr ).
    47     PS_META_ASTROM,                    ///< Astrometric coefficients (Stored in as psPtr ).
    48     PS_META_UNKNOWN,                   ///< Other data (Stored in as psPtr ).
     35    PS_META_PRIMITIVE,                 ///< Primitive data.
     36    PS_META_LIST,                      ///< List data (Stored as item.data.list).
     37    PS_META_STR,                       ///< String data (Stored as item.data.V).
     38    PS_META_VEC,                       ///< Vector data (Stored as item.data.V).
     39    PS_META_IMG,                       ///< Image data (Stored as item.data.V).
     40    PS_META_HASH,                      ///< Hash data (Stored as item.data.V).
     41    PS_META_LOOKUPTABLE,               ///< Lookup table data (Stored as item.data.V).
     42    PS_META_JPEG,                      ///< JPEG data (Stored as item.data.V).
     43    PS_META_PNG,                       ///< PNG data (Stored as item.data.V).
     44    PS_META_ASTROM,                    ///< Astrometric coefficients (Stored as item.data.V).
     45    PS_META_UNKNOWN,                   ///< Other data (Stored as item.data.V).
    4946    PS_META_NTYPE                      ///< Number of types. Must be last.
    5047} psMetadataType;
    51 
    52 /** Metadata item data structure.
    53  *
    54  * Struct for maintaining metadata items of varying types. It also contains
    55  * information about the item name, flags, comments, and other items with the same name.
    56  */
    57 typedef struct psMetadataItem
    58 {
    59     const psS32 id;                      ///< Unique ID for metadata item.
    60     char *restrict name;               ///< Name of metadata item.
    61     psMetadataType type;               ///< Type of metadata item.
    62     union {
    63         psBool B;                        ///< boolean data
    64         psS32 S32;                     ///< Signed 32-bit integer data.
    65         psF32 F32;                     ///< Single-precision float data.
    66         psF64 F64;                     ///< Double-precision float data.
    67         psPtr V;                       ///< Pointer to other type of data.
    68     } data;                            ///< Union for data types.
    69     char *comment;                     ///< Optional comment ("", not NULL).
    70     psList* restrict items;            ///< List of psMetadataItems with same name.
    71 }
    72 psMetadataItem;
    7348
    7449/** Metadata data structure.
     
    8560}
    8661psMetadata;
     62
     63/** Metadata item data structure.
     64 *
     65 * Struct for maintaining metadata items of varying types. It also contains
     66 * information about the item name, flags, comments, and other items with the same name.
     67 */
     68typedef struct psMetadataItem
     69{
     70    const psS32 id;                    ///< Unique ID for metadata item.
     71    char *name;                        ///< Name of metadata item.
     72    psMetadataType type;               ///< Type of metadata item.
     73    psElemType pType;                  ///< Primitive data type
     74    union {
     75        psBool B;                      ///< boolean data
     76        psS32 S32;                     ///< Signed 32-bit integer data.
     77        psF32 F32;                     ///< Single-precision float data.
     78        psF64 F64;                     ///< Double-precision float data.
     79        psList *list;                  ///< List data.
     80        psMetadata *md;                ///< Metadata data.
     81        psPtr V;                       ///< Pointer to other type of data.
     82    } data;                            ///< Union for data types.
     83    char *comment;                     ///< Optional comment ("", not NULL).
     84}
     85psMetadataItem;
    8786
    8887/** Create a metadata item.
     
    103102psMetadataItem* psMetadataItemAlloc(
    104103    const char *name,                  ///< Name of metadata item.
     104    psElemType pType,                  ///< Primitive type.
    105105    psMetadataType type,               ///< Type of metadata item.
    106106    const char *comment,               ///< Comment for metadata item.
     
    125125psMetadataItem* psMetadataItemAllocV(
    126126    const char *name,                  ///< Name of metadata item.
     127    psElemType pType,                  ///< Primitive type.
    127128    psMetadataType type,               ///< Type of metadata item.
    128129    const char *comment,               ///< Comment for metadata item.
     
    149150    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
    150151    psMetadataItem* restrict item,     ///< Metadata item to be added.
    151     psS32 location                       ///< Location to be added.
     152    psS32 location                     ///< Location to be added.
    152153);
    153154
     
    160161psBool psMetadataAdd(
    161162    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
    162     psS32 where,                         ///< Location to be added.
     163    psS32 where,                       ///< Location to be added.
    163164    const char *name,                  ///< Name of metadata item.
     165    psElemType pType,                  ///< Primitive type.
    164166    psMetadataType type,               ///< Type of metadata item.
    165167    const char *comment,               ///< Comment for metadata item.
     
    179181psBool psMetadataRemove(
    180182    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
    181     psS32 where,                         ///< Location to be removed.
     183    psS32 where,                       ///< Location to be removed.
    182184    const char *restrict key           ///< Name of metadata key.
    183185);
     
    205207psMetadataItem* psMetadataGet(
    206208    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
    207     psS32 where                          ///< Location to be retrieved.
     209    psS32 where                        ///< Location to be retrieved.
    208210);
    209211
     
    217219psBool psMetadataSetIterator(
    218220    psMetadata* restrict md,           ///< Metadata collection to iterate.
    219     psS32 where                          ///< Location of iterator.
     221    psS32 where                        ///< Location of iterator.
    220222);
    221223
     
    229231    psMetadata* restrict md,           ///< Metadata collection to iterate.
    230232    const char *restrict match,        ///< Beginning of key name.
    231     psS32 which                          ///< Iterator to be used.
     233    psS32 which                        ///< Iterator to be used.
    232234);
    233235
     
    241243    psMetadata* restrict md,           ///< Metadata collection to iterate.
    242244    const char *restrict match,        ///< Beginning of key name.
    243     psS32 which                          ///< Iterator to be used.
     245    psS32 which                        ///< Iterator to be used.
    244246);
    245247
Note: See TracChangeset for help on using the changeset viewer.