Changeset 119 for XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp
- Timestamp:
- 07/20/10 16:20:13 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp
r115 r119 9 9 public: 10 10 11 Context(void) : ObjectTemplate<Context>(), fieldDef(NULL), fileDef(NULL), axisDef(NULL), gridDef(NULL) 11 Context(void) : ObjectTemplate<Context>(), ccalendar(NULL), 12 fieldDef(NULL), fileDef(NULL), axisDef(NULL), gridDef(NULL) 12 13 {/* Ne rien faire de plus */} 13 Context(const string& _id) : ObjectTemplate<Context>(_id), fieldDef(NULL), fileDef(NULL), axisDef(NULL), gridDef(NULL) 14 15 Context(const string& _id) : ObjectTemplate<Context>(_id), ccalendar(NULL), 16 fieldDef(NULL), fileDef(NULL), axisDef(NULL), gridDef(NULL) 14 17 {/* Ne rien faire de plus */} 15 18 … … 92 95 { WARNING("Le noeud de définition possÚde un identifiant, ce dernier ne sera pas pris en compte lors du traitement !"); } 93 96 94 if (name.compare(FieldDefinition::GetDefName()) == 0) // Parsing définition des champs.97 if (name.compare(FieldDefinition::GetDefName()) == 0) // Parsing pour la définition des champs. 95 98 { fieldDef = CreateInstanceAndParse<FieldDefinition>(_node, FieldDefinition::GetDefName().c_str()); continue; } 96 99 97 if (name.compare(FileDefinition::GetDefName()) == 0) // Parsing définition des fichiers.100 if (name.compare(FileDefinition::GetDefName()) == 0) // Parsing pour la définition des fichiers. 98 101 { fileDef = CreateInstanceAndParse<FileDefinition >(_node, FileDefinition ::GetDefName().c_str()); continue; } 99 102 … … 136 139 } 137 140 138 FieldDefinition* getFieldDefinition(void) { return (this->fieldDef); } 139 FileDefinition * getFileDefinition(void) { return (this->fileDef ); } 140 AxisDefinition * getAxisDefinition(void) { return (this->axisDef ); } 141 GridDefinition * getGridDefinition(void) { return (this->gridDef ); } 141 FieldDefinition* getFieldDefinition(void) const { return (this->fieldDef); } 142 FileDefinition * getFileDefinition(void) const { return (this->fileDef ); } 143 AxisDefinition * getAxisDefinition(void) const { return (this->axisDef ); } 144 GridDefinition * getGridDefinition(void) const { return (this->gridDef ); } 145 146 AbstractCalendar * getCalendar(void) const { return (this->ccalendar ); } 147 AbstractCalendar * setCalendar(const string& _calName, const string& dateStr) 148 { 149 if (_calName.compare("D360") == 0) 150 return (ccalendar = new D360Calendar(dateStr)); 151 if (_calName.compare("AllLeap") == 0) 152 return (ccalendar = new AllLeapCalendar(dateStr)); 153 if (_calName.compare("NoLeap") == 0) 154 return (ccalendar = new NoLeapCalendar(dateStr)); 155 if (_calName.compare("Julian") == 0) 156 return (ccalendar = new JulianCalendar(dateStr)); 157 if (_calName.compare("Gregorian") == 0) 158 return (ccalendar = new GregorianCalendar(dateStr)); 159 160 WARNING("L'identifiant "+_calName+" est inconnu, le calendrier grégorien sera choisi par défault pour le contexte "+getId()); 161 162 return (ccalendar = new GregorianCalendar(dateStr)); 163 } 142 164 143 165 ~Context() 144 166 { 167 // Désallocation dynamique de mémoire pour chacun des groupes de définition si nécessaire. 145 168 if(fieldDef != NULL) delete fieldDef; 146 169 if(fileDef != NULL) delete fileDef; 147 170 if(axisDef != NULL) delete axisDef; 148 171 if(gridDef != NULL) delete gridDef; 172 // Désallocation dynamique de mémoire pour le calendrier associé au contexte courant si nécessaire. 173 if(ccalendar != NULL) delete ccalendar; 149 174 } 150 175 176 private: 151 177 152 private:178 AbstractCalendar* ccalendar; 153 179 154 180 FieldDefinition* fieldDef; … … 157 183 GridDefinition* gridDef; 158 184 159 160 185 }; //class Context 161 186 }// namespace XMLIOSERVER
Note: See TracChangeset
for help on using the changeset viewer.