- Timestamp:
- Mar 5, 2009, 11:13:29 AM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090215
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psModules/src/concepts/pmConcepts.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090215
-
branches/cnb_branches/cnb_branch_20090215/psModules/src/concepts/pmConcepts.h
r18364 r23197 12 12 #define PM_CONCEPTS_H 13 13 14 #include <pslib.h> 15 #include <pmFPALevel.h> 16 #include <pmFPA.h> 14 17 #include <pmConfig.h> 15 18 … … 34 37 35 38 /// Function to call to parse a concept once it has been read 36 typedef psMetadataItem* (*pmConceptParseFunc)(const psMetadataItem *concept, ///< Concept to parse 37 const psMetadataItem *pattern, ///< Pattern for parsing 38 pmConceptSource source, ///< Source of concept 39 const psMetadata *cameraFormat, ///< Camera format definition 40 const pmFPA *fpa, ///< FPA for concept, or NULL 41 const pmChip *chip, ///< Chip for concept, or NULL 42 const pmCell *cell ///< Cell for concept, or NULL 43 ); 39 typedef psMetadataItem* (*pmConceptParseFunc)( 40 const psMetadataItem *concept, ///< Concept to parse 41 const psMetadataItem *pattern, ///< Pattern for parsing 42 pmConceptSource source, ///< Source of concept 43 const psMetadata *cameraFormat, ///< Camera format definition 44 const pmFPA *fpa, ///< FPA for concept, or NULL 45 const pmChip *chip, ///< Chip for concept, or NULL 46 const pmCell *cell ///< Cell for concept, or NULL 47 ); 44 48 45 49 /// Function to call to format a concept for writing 46 typedef psMetadataItem* (*pmConceptFormatFunc)(const psMetadataItem *concept, ///< Concept to format 47 pmConceptSource source, ///< Source of concept 48 const psMetadata *cameraFormat, ///< Camera format definition 49 const pmFPA *fpa, ///< FPA for concept, or NULL 50 const pmChip *chip, ///< Chip for concept, or NULL 51 const pmCell *cell ///< Cell for concept, or NULL 52 ); 50 typedef psMetadataItem* (*pmConceptFormatFunc)( 51 const psMetadataItem *concept, ///< Concept to format 52 pmConceptSource source, ///< Source of concept 53 const psMetadata *cameraFormat, ///< Camera format definition 54 const pmFPA *fpa, ///< FPA for concept, or NULL 55 const pmChip *chip, ///< Chip for concept, or NULL 56 const pmCell *cell ///< Cell for concept, or NULL 57 ); 58 59 /// Function to call to copy a concept 60 typedef psMetadataItem* (*pmConceptCopyFunc)( 61 const psMetadataItem *target, ///< Target concept 62 const psMetadataItem *source, ///< Source concept 63 const psMetadata *cameraFormat, ///< Camera format definition 64 const pmFPA *fpa, ///< Source FPA for concept, or NULL 65 const pmChip *chip, ///< Source chip for concept, or NULL 66 const pmCell *cell ///< Source cell for concept, or NULL 67 ); 68 53 69 54 70 /// A "concept" specification … … 56 72 /// Defines the name, default comment, blank value, and functions to parse (after reading) and format (before 57 73 /// writing) the concept. 58 typedef struct 59 { 74 typedef struct { 60 75 psMetadataItem *blank; ///< Blank value of concept; also contains the name and comment 61 pmConceptParseFunc parse; ///< Function to call to read the concept 62 pmConceptFormatFunc format; ///< Function to call to write the concept 76 pmConceptParseFunc parse; ///< Function to call to read the concept, or NULL 77 pmConceptFormatFunc format; ///< Function to call to write the concept, or NULL 78 pmConceptCopyFunc copy; ///< Function to call to copy the concept, or NULL 63 79 bool required; ///< Is concept required (throw an error on problems)? 64 80 } … … 67 83 /// Allocator for pmConceptSpec 68 84 pmConceptSpec *pmConceptSpecAlloc(psMetadataItem *blank, ///< Blank value; contains the name 69 pmConceptParseFunc parse, ///< Function to call to parse the concept 70 pmConceptFormatFunc format, ///< Function to call to format the concept 85 pmConceptParseFunc parse, ///< Function to call to parse the concept/NULL 86 pmConceptFormatFunc format, ///< Function to call to format the concept/NULL 87 pmConceptCopyFunc copy, ///< Function to call to copy the concept, or NULL 71 88 bool required ///< Is concept required? 72 89 ); … … 92 109 pmConceptParseFunc parse, ///< Function to call to parse the concept, or NULL 93 110 pmConceptFormatFunc format, ///< Function to call to format the concept, or NULL 111 pmConceptCopyFunc copy, ///< Function to call to copy the concept, or NULL 94 112 bool required, ///< Is concept required? 95 113 pmFPALevel level ///< Level at which to store concept in the FPA hierarchy 96 114 ); 97 115 98 /// Get a list of defined concepts for a particular level.99 ps List *pmConceptsList(pmFPALevel level);116 /// Get the specifications for defined concepts of a particular level 117 psMetadata *pmConceptsSpecs(pmFPALevel level); 100 118 101 /// Read the concepts for the given set of fpa, chip, cell102 ///103 /// Attempts to read as many concepts as possible from the specified source for the specified FPA, chip and104 /// cell. That is, it will read chip- and cell-level concepts in addition to fpa-level concepts, if the chip105 /// and cell are provided.106 bool pmConceptsRead(pmFPA *fpa, ///< FPA for which to read concepts107 pmChip *chip, ///< Chip for which to read concepts, or NULL108 pmCell *cell, ///< Cell for which to read concepts, or NULL109 pmConceptSource source, ///< The source of the concepts to read110 pmConfig *config ///< Configuration111 );112 119 113 120 /// Set the concepts within the FPA to the blank value 114 121 bool pmConceptsBlankFPA(pmFPA *fpa ///< FPA for which to set blank concepts 115 );116 117 /// Read concepts for an FPA; optionally, read concepts at all lower levels.118 ///119 /// Once concepts should be available for reading at the FPA-level, this function attempts to read the120 /// concepts from the specified source. It also allows concepts to be read at lower levels by iterating over121 /// the components.122 bool pmConceptsReadFPA(pmFPA *fpa, ///< FPA for which to read concepts123 pmConceptSource source, ///< Source for concepts124 bool propagateDown, ///< Propagate to lower levels?125 pmConfig *config ///< Configuration126 );127 128 /// Write concepts for an FPA; optionally, write concepts at all lower levels.129 ///130 /// This function writes all concepts for the FPA to the specified "source". It also allows concepts to be131 /// written for all lower levels by iterating over the components.132 bool pmConceptsWriteFPA(const pmFPA *fpa, ///< FPA for which to write concepts133 pmConceptSource source, ///< Source for concepts134 bool propagateDown, ///< Propagate to lower levels?135 pmConfig *config ///< Configuration136 122 ); 137 123 … … 140 126 ); 141 127 142 /// Read concepts for a chip; optionally, read concepts at the FPA and cell levels.143 ///144 /// Once concepts should be available for reading at the FPA-level, this function attempts to read the145 /// concepts from the specified source. It also allows concepts to be read at the fpa level (through the146 /// parent), and the cell level by iterating over the components.147 bool pmConceptsReadChip(pmChip *chip, ///< Chip for which to read concepts148 pmConceptSource source, ///< Source for concepts149 bool propagateUp, ///< Propagate to higher levels?150 bool propagateDown, ///< Propagate to lower levels?151 pmConfig *config ///< Configuration152 );153 154 /// Write concepts for a chip; optionally, write concepts at the FPA and cell levels.155 ///156 /// This function writes all concepts for the chip to the specified "source". It also allows concepts to be157 /// written for the FPA, and the cell level by iterating over the components.158 bool pmConceptsWriteChip(const pmChip *chip, ///< Chip for which to write concepts159 pmConceptSource source, ///< Source for concepts160 bool propagateUp,///< Propagate to higher levels?161 bool propagateDown, ///< Propagate to lower levels?162 pmConfig *config ///< Configuration163 );164 165 128 /// Set the concepts within the cell to the blank value 166 129 bool pmConceptsBlankCell(pmCell *cell ///< Cell for which to set blank concepts 167 );168 169 /// Read concepts for a cell; optionally, read concepts for the parents.170 ///171 /// Once concepts should be available for reading at the FPA-level, this function attempts to read the172 /// concepts from the specified source. It also allows concepts to be read at upper levels through the173 /// parents (note, it would not read concepts for all chips, but only the parent of this cell).174 bool pmConceptsReadCell(pmCell *cell, ///< Cell for which to read concepts175 pmConceptSource source, ///< Source for concepts176 bool propagateUp, ///< Propagate to higher levels?177 pmConfig *config ///< Configuration178 );179 180 /// Write concepts for a cell; optionally, write concepts for the parents.181 ///182 /// This function writes all concepts for the chip to the specified "source". It also allows concepts to be183 /// written for the upper levels through the parents (note, it would not write concepts for all chips, but184 /// only the parent of this cell).185 bool pmConceptsWriteCell(const pmCell *cell, ///< FPA for which to write concepts186 pmConceptSource source, ///< Source for concepts187 bool propagateUp, ///< Propagate to higher levels?188 pmConfig *config ///< Configuration189 130 ); 190 131 … … 199 140 /// Frees the registered concepts so there is no memory leak when the user checks "persistent" memory. 200 141 void pmConceptsDone(void); 201 202 /// Copy all the concepts within an FPA to another FPA203 ///204 /// Iterates over all components of the FPA, and copies the concepts metadata from the source to the target.205 bool pmFPACopyConcepts(pmFPA *target, ///< The target FPA206 const pmFPA *source ///< The source FPA207 );208 209 /// Copy the concepts within an FPA to another FPA; optionally recurse to lower levels210 bool pmConceptsCopyFPA(pmFPA *target, ///< Target FPA211 const pmFPA *source, ///< Source FPA212 bool chips, ///< Recurse to chips level?213 bool cells ///< Recurse to cells level?214 );215 216 /// Copy the concepts within a chip to another chip; optionally recurse to lower level217 bool pmConceptsCopyChip(pmChip *target, ///< Target chip218 const pmChip *source, ///< Source chip219 bool cells ///< Recurse to cells level?220 );221 222 /// Copy the concepts within a cell to another cell223 bool pmConceptsCopyCell(pmCell *target, ///< Target cell224 const pmCell *source ///< Source cell225 );226 142 227 143 /// Interpolate a concept name to the actual value
Note:
See TracChangeset
for help on using the changeset viewer.
