Changeset 131 for XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp
- Timestamp:
- 10/13/10 15:25:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp
r128 r131 9 9 public: 10 10 11 Context(void) : ObjectTemplate<Context>(), ccalendar(NULL), 12 fieldDef(NULL), fileDef(NULL), axisDef(NULL), gridDef(NULL), domainDef(NULL) 11 Context(void) 12 : ObjectTemplate<Context>(), ccalendar(NULL), 13 fieldDef(NULL), fileDef(NULL), axisDef(NULL), gridDef(NULL), domainDef(NULL) 13 14 {/* Ne rien faire de plus */} 14 15 15 Context(const string& _id) : ObjectTemplate<Context>(_id), ccalendar(NULL), 16 fieldDef(NULL), fileDef(NULL), axisDef(NULL), gridDef(NULL), domainDef(NULL) 16 Context(const string& _id) 17 : ObjectTemplate<Context>(_id), ccalendar(NULL), 18 fieldDef(NULL), fileDef(NULL), axisDef(NULL), gridDef(NULL), domainDef(NULL) 17 19 {/* Ne rien faire de plus */} 18 20 19 FieldDefinition * getFieldDefinition (void)const { return (this->fieldDef ); }20 FileDefinition * getFileDefinition (void)const { return (this->fileDef ); }21 AxisDefinition * getAxisDefinition (void)const { return (this->axisDef ); }22 GridDefinition * getGridDefinition (void)const { return (this->gridDef ); }21 FieldDefinition * getFieldDefinition (void) const { return (this->fieldDef ); } 22 FileDefinition * getFileDefinition (void) const { return (this->fileDef ); } 23 AxisDefinition * getAxisDefinition (void) const { return (this->axisDef ); } 24 GridDefinition * getGridDefinition (void) const { return (this->gridDef ); } 23 25 DomainDefinition * getDomainDefinition(void) const { return (this->domainDef); } 24 26 25 27 AbstractCalendar * getCalendar(void) const { return (this->ccalendar ); } 28 26 29 AbstractCalendar * setCalendar(const string& _calName, const string& _dateStr) 27 30 { … … 42 45 } 43 46 44 ~Context( )47 ~Context(void) 45 48 { 46 49 // Désallocation dynamique de mémoire pour chacun des groupes de définition si nécessaire. … … 76 79 { WARNING("Le noeud de définition possÚde un identifiant, ce dernier ne sera pas pris en compte lors du traitement !"); } 77 80 78 if (name.compare(FieldDefinition::GetDefName()) == 0) // Parsing pour la définition des champs. 79 { fieldDef = CreateInstanceAndParse<FieldDefinition >(_node, FieldDefinition::GetDefName().c_str()); continue; } 80 81 if (name.compare(FileDefinition::GetDefName()) == 0) // Parsing pour la définition des fichiers. 82 { fileDef = CreateInstanceAndParse<FileDefinition >(_node, FileDefinition ::GetDefName().c_str()); continue; } 83 84 if (name.compare(AxisDefinition::GetDefName()) == 0) // Parsing pour la définition des axes. 85 { axisDef = CreateInstanceAndParse<AxisDefinition >(_node, AxisDefinition ::GetDefName().c_str()); continue; } 86 87 if (name.compare(GridDefinition::GetDefName()) == 0) // Parsing pour la définition des grilles. 88 { gridDef = CreateInstanceAndParse<GridDefinition >(_node, GridDefinition ::GetDefName().c_str()); continue; } 89 90 if (name.compare(DomainDefinition::GetDefName()) == 0) // Parsing pour la définition des domaines. 91 { domainDef = CreateInstanceAndParse<DomainDefinition>(_node, DomainDefinition::GetDefName().c_str()); continue; } 81 if (name.compare(FieldDefinition::GetDefName()) == 0) 82 // Parsing pour la définition des champs. 83 { fieldDef = CreateInstanceAndParse<FieldDefinition > 84 (_node, FieldDefinition::GetDefName().c_str()); continue; } 85 86 if (name.compare(FileDefinition::GetDefName()) == 0) 87 // Parsing pour la définition des fichiers. 88 { fileDef = CreateInstanceAndParse<FileDefinition > 89 (_node, FileDefinition ::GetDefName().c_str()); continue; } 90 91 if (name.compare(AxisDefinition::GetDefName()) == 0) 92 // Parsing pour la définition des axes. 93 { axisDef = CreateInstanceAndParse<AxisDefinition > 94 (_node, AxisDefinition ::GetDefName().c_str()); continue; } 95 96 if (name.compare(GridDefinition::GetDefName()) == 0) 97 // Parsing pour la définition des grilles. 98 { gridDef = CreateInstanceAndParse<GridDefinition > 99 (_node, GridDefinition ::GetDefName().c_str()); continue; } 100 101 if (name.compare(DomainDefinition::GetDefName()) == 0) 102 // Parsing pour la définition des domaines. 103 { domainDef = CreateInstanceAndParse<DomainDefinition> 104 (_node, DomainDefinition::GetDefName().c_str()); continue; } 92 105 93 106 WARNING("La définition est invalide, seuls les champs, grilles, axes et fichiers peuvent être définis !"); … … 134 147 135 148 Poco::HashMap<string, StrHashMap<Context> > &AllListContext = Context::GetAllListObject(); 136 for (Poco::HashMap<string, StrHashMap<Context> >::Iterator it = AllListContext.begin(); it != AllListContext.end(); it++) 149 Poco::HashMap<string, StrHashMap<Context> >::Iterator it; 150 151 for (it = AllListContext.begin(); it != AllListContext.end(); it++) 137 152 // On sort chacun des contextes successivement. 138 153 { … … 149 164 { 150 165 Poco::HashMap<string, StrHashMap<Context> > &AllListContext = Context::GetAllListObject(); 151 for (Poco::HashMap<string, StrHashMap<Context> >::Iterator it = AllListContext.begin(); it != AllListContext.end(); it++) 166 Poco::HashMap<string, StrHashMap<Context> >::Iterator it; 167 168 for (it = AllListContext.begin(); it != AllListContext.end(); it++) 152 169 { Context::SetCurrentContext((*it).first); delete ((*it).second)[(*it).first]; } 153 170 } … … 157 174 { 158 175 Poco::HashMap<string, StrHashMap<Context> > &AllListContext = Context::GetAllListObject(); 159 for (Poco::HashMap<string, StrHashMap<Context> >::Iterator it = AllListContext.begin(); it != AllListContext.end(); it++) 176 Poco::HashMap<string, StrHashMap<Context> >::Iterator it; 177 178 for ( it = AllListContext.begin(); it != AllListContext.end(); it++) 160 179 { 161 180 // Résolution des héritages descendants (cà d des héritages de groupes) pour chacun des contextes. … … 164 183 165 184 // Résolution des héritages par référence au niveau des fichiers. 166 const std::vector<CFile*>& allFiles = CFile::GetCurrentListObject().getVector(); 167 for (unsigned int i = 0; i < allFiles.size(); i++) allFiles[i]->solveFieldRefInheritance(); 185 const std::vector<CFile*>& allFiles = 186 CFile::GetCurrentListObject().getVector(); 187 188 for (unsigned int i = 0; i < allFiles.size(); i++) 189 allFiles[i]->solveFieldRefInheritance(); 168 190 } 169 191 } … … 180 202 } 181 203 204 static const std::stack<string>& GetStackContextId(void) 205 { return (Context::Stid); } 206 182 207 static Context* GetCurrentContext(void) 183 208 { return (Context::GetObject(Context::GetCurrentContextId())); } … … 208 233 private: 209 234 210 static st ack<string> Stid;235 static std::stack<string> Stid; 211 236 212 237 AbstractCalendar * ccalendar; … … 220 245 }; //class Context 221 246 222 st ack<string> Context::Stid;247 std::stack<string> Context::Stid; 223 248 224 249 }// namespace XMLIOSERVER
Note: See TracChangeset
for help on using the changeset viewer.