Changeset 120 for XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp
- Timestamp:
- 09/08/10 15:02:31 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp
r119 r120 22 22 os << NIndent << "<"<< Context::GetRootName() << ">" << std::endl; 23 23 24 HashMap<string, StrHashMap<Context> > &AllListContext = Context::GetAllListObject();25 for ( HashMap<string, StrHashMap<Context> >::Iterator it = AllListContext.begin(); it != AllListContext.end(); it++)24 Poco::HashMap<string, StrHashMap<Context> > &AllListContext = Context::GetAllListObject(); 25 for (Poco::HashMap<string, StrHashMap<Context> >::Iterator it = AllListContext.begin(); it != AllListContext.end(); it++) 26 26 // On sort chacun des contextes successivement. 27 27 { Context::SetCurrentContext((*it).first); os << *((*it).second)[(*it).first] << std::endl; } … … 32 32 static void FreeMemory(void) 33 33 { 34 HashMap<string, StrHashMap<Context> > &AllListContext = Context::GetAllListObject();35 for ( HashMap<string, StrHashMap<Context> >::Iterator it = AllListContext.begin(); it != AllListContext.end(); it++)34 Poco::HashMap<string, StrHashMap<Context> > &AllListContext = Context::GetAllListObject(); 35 for (Poco::HashMap<string, StrHashMap<Context> >::Iterator it = AllListContext.begin(); it != AllListContext.end(); it++) 36 36 { Context::SetCurrentContext((*it).first); delete ((*it).second)[(*it).first]; } 37 37 } 38 38 39 // Ne plus utiliser, disponible dans les classe treatment. 39 40 static void ResolveInheritance(void) 40 41 { 41 HashMap<string, StrHashMap<Context> > &AllListContext = Context::GetAllListObject();42 for ( HashMap<string, StrHashMap<Context> >::Iterator it = AllListContext.begin(); it != AllListContext.end(); it++)42 Poco::HashMap<string, StrHashMap<Context> > &AllListContext = Context::GetAllListObject(); 43 for (Poco::HashMap<string, StrHashMap<Context> >::Iterator it = AllListContext.begin(); it != AllListContext.end(); it++) 43 44 { 44 45 // Résolution des héritages descendants (cà d des héritages de groupes) pour chacun des contextes. … … 58 59 59 60 // Changement de context pour les champs et groupes de champs. 60 FieldGroup::SetContext(id); 61 CField::SetContext(id); 61 FieldGroup::SetContext(id); CField::SetContext(id); 62 62 63 63 // Changement de context pour les fichiers et groupes de fichiers. 64 FileGroup::SetContext(id); 65 CFile::SetContext(id); 64 FileGroup::SetContext(id); CFile::SetContext(id); 66 65 67 66 // Changement de context pour les grilles et groupes de grilles. 68 GridGroup::SetContext(id); 69 CGrid::SetContext(id); 67 GridGroup::SetContext(id); CGrid::SetContext(id); 70 68 71 69 // Changement de context pour les axes et groupes d'axes. 72 AxisGroup::SetContext(id); 73 CAxis::SetContext(id); 70 AxisGroup::SetContext(id); CAxis::SetContext(id); 74 71 } 75 72 … … 107 104 { gridDef = CreateInstanceAndParse<GridDefinition >(_node, GridDefinition ::GetDefName().c_str()); continue; } 108 105 109 WARNING("La définition est invalide, seul es les champs, grilles, axes et fichiers peuvent être définis !");106 WARNING("La définition est invalide, seuls les champs, grilles, axes et fichiers peuvent être définis !"); 110 107 111 108 } while (_node.goToNextElement()); … … 115 112 } 116 113 117 static string GetName(void) {return ("context"); }118 static string GetRootName(void) { return ("simulation"); }114 static string GetName(void) { return ("context"); } 115 static string GetRootName(void) { return ("simulation"); } 119 116 120 117 virtual bool hasChild(void) const … … 129 126 } 130 127 131 virtual void resolveDescInheritance(const AttributRegistrar* _parent = 0)128 virtual void resolveDescInheritance(const AttributRegistrar* const _parent = 0) 132 129 { 133 130 if (_parent != 0) return; … … 145 142 146 143 AbstractCalendar * getCalendar(void) const { return (this->ccalendar ); } 147 AbstractCalendar * setCalendar(const string& _calName, const string& dateStr)144 AbstractCalendar * setCalendar(const string& _calName, const string& _dateStr) 148 145 { 149 146 if (_calName.compare("D360") == 0) 150 return (ccalendar = new D360Calendar( dateStr));147 return (ccalendar = new D360Calendar(_dateStr)); 151 148 if (_calName.compare("AllLeap") == 0) 152 return (ccalendar = new AllLeapCalendar( dateStr));149 return (ccalendar = new AllLeapCalendar(_dateStr)); 153 150 if (_calName.compare("NoLeap") == 0) 154 return (ccalendar = new NoLeapCalendar( dateStr));151 return (ccalendar = new NoLeapCalendar(_dateStr)); 155 152 if (_calName.compare("Julian") == 0) 156 return (ccalendar = new JulianCalendar( dateStr));153 return (ccalendar = new JulianCalendar(_dateStr)); 157 154 if (_calName.compare("Gregorian") == 0) 158 return (ccalendar = new GregorianCalendar( dateStr));155 return (ccalendar = new GregorianCalendar(_dateStr)); 159 156 160 157 WARNING("L'identifiant "+_calName+" est inconnu, le calendrier grégorien sera choisi par défault pour le contexte "+getId()); 161 158 162 return (ccalendar = new GregorianCalendar( dateStr));159 return (ccalendar = new GregorianCalendar(_dateStr)); 163 160 } 164 161 … … 166 163 { 167 164 // Désallocation dynamique de mémoire pour chacun des groupes de définition si nécessaire. 168 if(fieldDef != NULL) delete fieldDef; 169 if(fileDef != NULL) delete fileDef; 170 if(axisDef != NULL) delete axisDef; 171 if(gridDef != NULL) delete gridDef; 165 if(fieldDef != NULL) delete fieldDef; if(fileDef != NULL) delete fileDef ; 166 if(axisDef != NULL) delete axisDef ; if(gridDef != NULL) delete gridDef ; 167 172 168 // Désallocation dynamique de mémoire pour le calendrier associé au contexte courant si nécessaire. 173 169 if(ccalendar != NULL) delete ccalendar;
Note: See TracChangeset
for help on using the changeset viewer.