Changeset 3341 for trunk/psLib/src/collections/psMetadata.h
- Timestamp:
- Feb 28, 2005, 1:34:10 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/collections/psMetadata.h (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psMetadata.h
r3264 r3341 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-02- 17 19:26:23$13 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-02-28 23:34:10 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psHash.h" 25 25 #include "psList.h" 26 #include "psImage.h" 27 #include "psLookupTable.h" 26 28 27 29 /// @addtogroup Metadata … … 33 35 */ 34 36 typedef enum { 35 PS_META_PRIMITIVE, ///< Primitive data. 37 PS_META_S32, ///< Primitive data. 38 PS_META_F32, ///< Primitive data. 39 PS_META_F64, ///< Primitive data. 40 PS_META_BOOL, ///< Primitive data. 36 41 PS_META_LIST, ///< List data (Stored as item.data.list). 37 42 PS_META_STR, ///< String data (Stored as item.data.V). … … 47 52 } psMetadataType; 48 53 54 #define PS_META_IS_PRIMITIVE(TYPE) \ 55 (TYPE == PS_META_S32 || \ 56 TYPE == PS_META_F32 || \ 57 TYPE == PS_META_F64 || \ 58 TYPE == PS_META_BOOL) 59 60 #define PS_META_PRIMITIVE_TYPE(METATYPE) ( \ 61 (METATYPE==PS_META_S32) ? PS_TYPE_S32 : \ 62 (METATYPE==PS_META_F32) ? PS_TYPE_F32 : \ 63 (METATYPE==PS_META_F64) ? PS_TYPE_F64 : \ 64 (METATYPE==PS_META_BOOL) ? PS_TYPE_BOOL : PS_TYPE_PTR ) 65 49 66 /** Option flags for psMetadata functions 50 67 * … … 55 72 typedef enum { 56 73 PS_META_DEFAULT = 0, ///< default behaviour (duplicate entry is an error) 57 PS_META_REPLACE ///< allow entry to be replaced74 PS_META_REPLACE = 0x10000 ///< allow entry to be replaced 58 75 } psMetadataFlags; 59 76 … … 82 99 char *name; ///< Name of metadata item. 83 100 psMetadataType type; ///< Type of metadata item. 84 psElemType pType; ///< Primitive data type85 101 union { 86 102 psBool B; ///< boolean data … … 113 129 psMetadataItem* psMetadataItemAlloc( 114 130 const char *name, ///< Name of metadata item. 115 psElemType pType, ///< Primitive type.116 131 psMetadataType type, ///< Type of metadata item. 117 132 const char *comment, ///< Comment for metadata item. 118 133 ... ///< Arguments for name formatting and metadata item data. 134 ); 135 136 psMetadataItem* psMetadataItemAllocStr( 137 const char* name, 138 const char* comment, 139 const char* value 140 ); 141 142 psMetadataItem* psMetadataItemAllocF32( 143 const char* name, 144 const char* comment, 145 psF32 value 146 ); 147 148 psMetadataItem* psMetadataItemAllocF64( 149 const char* name, 150 const char* comment, 151 psF64 value 152 ); 153 154 psMetadataItem* psMetadataItemAllocS32( 155 const char* name, 156 const char* comment, 157 psS32 value 158 ); 159 160 psMetadataItem* psMetadataItemAllocBool( 161 const char* name, 162 const char* comment, 163 psBool value 119 164 ); 120 165 … … 137 182 psMetadataItem* psMetadataItemAllocV( 138 183 const char *name, ///< Name of metadata item. 139 psElemType pType, ///< Primitive type.140 184 psMetadataType type, ///< Type of metadata item. 141 185 const char *comment, ///< Comment for metadata item. … … 161 205 */ 162 206 psBool psMetadataAddItem( 163 psMetadata* md, ///< Metadata collection to insert metadat item.164 psMetadataItem* item, ///< Metadata item to be added.165 psS32 location ///< Location to be added.207 psMetadata* md, ///< Metadata collection to insert metadat item. 208 psMetadataItem* item, ///< Metadata item to be added. 209 psS32 location ///< Location to be added. 166 210 ); 167 211 … … 173 217 */ 174 218 psBool psMetadataAdd( 175 psMetadata* md, ///< Metadata collection to insert metadat item. 176 psS32 where, ///< Location to be added. 177 const char *name, ///< Name of metadata item. 178 psElemType pType, ///< Primitive type. 179 psMetadataType type, ///< Type of metadata item. 180 const char *comment, ///< Comment for metadata item. 181 ... ///< Arguments for name formatting and metadata item data. 182 ); 219 psMetadata* md, ///< Metadata collection to insert metadat item. 220 psS32 where, ///< Location to be added. 221 const char *name, ///< Name of metadata item. 222 psMetadataType type, ///< Type of metadata item. 223 const char *comment, ///< Comment for metadata item. 224 ... ///< Arguments for name formatting and metadata item data. 225 ); 226 227 psBool psMetadataAddS32(psMetadata* md, psS32 where, const char* name, 228 const char* comment, psS32 value); 229 psBool psMetadataAddF32(psMetadata* md, psS32 where, const char* name, 230 const char* comment, psF32 value); 231 psBool psMetadataAddF64(psMetadata* md, psS32 where, const char* name, 232 const char* comment, psF64 value); 233 psBool psMetadataAddList(psMetadata* md, psS32 where, const char* name, 234 const char* comment, psList* value); 235 psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name, 236 const char* comment, const char* value); 237 psBool psMetadataAddVector(psMetadata* md, psS32 where, const char* name, 238 const char* comment, psVector* value); 239 psBool psMetadataAddImage(psMetadata* md, psS32 where, const char* name, 240 const char* comment, psImage* value); 241 psBool psMetadataAddHash(psMetadata* md, psS32 where, const char* name, 242 const char* comment, psHash* value); 243 psBool psMetadataAddLookupTable(psMetadata* md, psS32 where, const char* name, 244 const char* comment, psLookupTable* value); 245 psBool psMetadataAddUnknown(psMetadata* md, psS32 where, const char* name, 246 const char* comment, psPtr value); 247 183 248 184 249 /** Remove an item from metadata collection.
Note:
See TracChangeset
for help on using the changeset viewer.
