Changeset 110 for XMLIO_V2/dev/dev_rv/src
- Timestamp:
- 06/21/10 10:53:06 (14 years ago)
- Location:
- XMLIO_V2/dev/dev_rv/src/XMLIO
- Files:
-
- 6 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp
r108 r110 9 9 public: 10 10 11 Context(void) : ObjectTemplate<Context>(), fieldDef(NULL), fileDef(NULL) //, axisDef(NULL), gridDef(NULL)11 Context(void) : ObjectTemplate<Context>(), fieldDef(NULL), fileDef(NULL), axisDef(NULL), gridDef(NULL) 12 12 {/* Ne rien faire de plus */} 13 Context(const string& _id) : ObjectTemplate<Context>(_id), fieldDef(NULL), fileDef(NULL) //, axisDef(NULL), gridDef(NULL)13 Context(const string& _id) : ObjectTemplate<Context>(_id), fieldDef(NULL), fileDef(NULL), axisDef(NULL), gridDef(NULL) 14 14 {/* Ne rien faire de plus */} 15 15 … … 41 41 ((*it).second)[(*it).first]->resolveDescInheritance(); 42 42 43 // Résolution des héritages par référence au niveau des fichiers 43 // Résolution des héritages par référence au niveau des fichiers. 44 44 const std::vector<CFile*>& allFiles = CFile::GetCurrentListObject().getVector(); 45 45 for (unsigned int i = 0; i < allFiles.size(); i++) allFiles[i]->resolveFieldRefInheritance(); … … 61 61 62 62 // Changement de context pour les grilles et groupes de grilles. 63 //GridGroup::SetContext(id);64 //CGrid::SetContext(id);63 GridGroup::SetContext(id); 64 CGrid::SetContext(id); 65 65 66 66 // Changement de context pour les axes et groupes d'axes. 67 //AxisGroup::SetContext(id);68 //CAxis::SetContext(id);67 AxisGroup::SetContext(id); 68 CAxis::SetContext(id); 69 69 } 70 70 71 v oid parse (XMLNode& _node)71 virtual void parse (XMLNode& _node) 72 72 { 73 73 THashAttributes attributes; … … 92 92 if (name.compare(FieldDefinition::GetDefName()) == 0) // Parsing définition des champs. 93 93 { fieldDef = CreateInstanceAndParse<FieldDefinition>(attributes, _node, "field_definition"); continue; } 94 94 95 if (name.compare(FileDefinition::GetDefName()) == 0) // Parsing définition des fichiers. 95 96 { fileDef = CreateInstanceAndParse<FileDefinition>(attributes, _node, "file_definition"); continue; } 96 97 97 if (name.compare("axis_definition") == 0) 98 { // Parsing pour la définition des axes. 99 INFO("Le parsing des définitions d'axes n'est pas encore implémenté"); 100 //axisDef = CreateInstance<AxisDefinition>(attributes, _node, "axis_definition"); 101 continue; 102 } 98 if (name.compare(AxisDefinition::GetDefName()) == 0) // Parsing pour la définition des axes. 99 { axisDef = CreateInstanceAndParse<AxisDefinition>(attributes, _node, "axis_definition"); continue; } 103 100 104 if (name.compare("grid_definition") == 0) 105 { // Parsing pour la définition des grilles. 106 INFO("Le parsing des définitions de grilles n'est pas encore implémenté"); 107 //gridDef = CreateInstance<GridDefinition>(attributes, _node, "grid_definition"); 108 continue; 109 } 101 if (name.compare(GridDefinition::GetDefName()) == 0) // Parsing pour la définition des grilles. 102 { gridDef = CreateInstanceAndParse<GridDefinition>(attributes, _node, "grid_definition"); continue; } 110 103 111 104 WARNING("La définition est invalide, seules les champs, grilles, axes et fichiers peuvent être définis !"); … … 123 116 124 117 virtual bool hasChild(void) const 125 { return ((fieldDef != NULL) or (fileDef != NULL) /* or (axisDef != NULL) or (gridDef != NULL) */); }118 { return ((fieldDef != NULL) or (fileDef != NULL) or (axisDef != NULL) or (gridDef != NULL)); } 126 119 virtual void printChild(ostream& out) const 127 120 { 128 if(fieldDef != NULL) out << *(FieldGroup*) fieldDef << std::endl;129 if(fileDef != NULL) out << *(FileGroup*) fileDef << std::endl;130 //if(axisDef != NULL) out << *(AxisDefinition*)axisDef<< std::endl;131 //if(gridDef != NULL) out << *(GridDefinition*)gridDef<< std::endl;121 if(fieldDef != NULL) out << *(FieldGroup*) fieldDef << std::endl; 122 if(fileDef != NULL) out << *(FileGroup*) fileDef << std::endl; 123 if(axisDef != NULL) out << *(AxisDefinition*) axisDef << std::endl; 124 if(gridDef != NULL) out << *(GridDefinition*) gridDef << std::endl; 132 125 } 133 126 virtual void resolveDescInheritance(const AttributRegistrar* _parent = 0) … … 136 129 if(fieldDef != NULL) fieldDef->resolveDescInheritance(); 137 130 if(fileDef != NULL) fileDef ->resolveDescInheritance(); 138 //if(axisDef != NULL) axisDef ->resolveDescInheritance();139 //if(gridDef != NULL) gridDef ->resolveDescInheritance();131 if(axisDef != NULL) axisDef ->resolveDescInheritance(); 132 if(gridDef != NULL) gridDef ->resolveDescInheritance(); 140 133 } 141 134 142 135 FieldDefinition* getFieldDefinition(void) { return (this->fieldDef); } 143 136 FileDefinition* getFileDefinition(void) { return (this->fileDef); } 144 //AxisDefinition* getAxisDefinition(void) { return (this->axisDef);}145 //GridDefinition* getGridDefinition(void) { return (this->gridDef);}137 AxisDefinition* getAxisDefinition(void) { return (this->axisDef); } 138 GridDefinition* getGridDefinition(void) { return (this->gridDef); } 146 139 147 140 ~Context() … … 149 142 if(fieldDef != NULL) delete fieldDef; 150 143 if(fileDef != NULL) delete fileDef; 151 //if(axisDef != NULL) delete axisDef;152 //if(gridDef != NULL) delete gridDef;144 if(axisDef != NULL) delete axisDef; 145 if(gridDef != NULL) delete gridDef; 153 146 } 154 147 … … 158 151 FieldDefinition* fieldDef; 159 152 FileDefinition* fileDef; 160 /*AxisDefinition* axisDef;161 GridDefinition* gridDef; */153 AxisDefinition* axisDef; 154 GridDefinition* gridDef; 162 155 163 156 -
XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp
r109 r110 27 27 } 28 28 29 void parse (XMLNode& _node)30 {31 string name = _node.getElementName();32 THashAttributes attributes;33 34 /// PARSING GESTION DES ATTRIBUTS ///35 _node.getAttributes(attributes);36 this->setAttributes(attributes);37 attributes.clear();38 39 /// PARSING POUR GESION DES ENFANTS ///40 // Rien à faire.41 }42 43 29 ~CField(void) 44 30 { /* Ne rien faire de plus */ } 45 31 46 }; // class Field32 }; // class CField 47 33 48 34 }; // namespace XMLIOSERVER -
XMLIO_V2/dev/dev_rv/src/XMLIO/field_group.hpp
r107 r110 32 32 } 33 33 34 /// PARSING POUR GES ION DES ENFANTS34 /// PARSING POUR GESTION DES ENFANTS 35 35 if (!(_node.goToChildElement())) 36 36 WARNING("Le groupe de champ ne contient pas d'enfant !"); … … 38 38 { 39 39 ////////////////////////////////////// 40 do { // Parcours des contextspour traitement.40 do { // Parcours pour traitement. 41 41 42 42 string name = _node.getElementName(); -
XMLIO_V2/dev/dev_rv/src/XMLIO/file.hpp
r109 r110 18 18 static string GetName(void) { return ("file"); } 19 19 20 v oid parse (XMLNode& _node)20 virtual void parse (XMLNode& _node) 21 21 { 22 22 string name = _node.getElementName(); -
XMLIO_V2/dev/dev_rv/src/XMLIO/file_group.hpp
r107 r110 33 33 } 34 34 35 /// PARSING POUR GES ION DES ENFANTS ///35 /// PARSING POUR GESTION DES ENFANTS /// 36 36 if (!(_node.goToChildElement())) 37 37 WARNING("Le groupe de fichier ne contient pas d'enfant !"); … … 39 39 { 40 40 ////////////////////////////////////// 41 do { // Parcours des contextspour traitement.41 do { // Parcours pour traitement. 42 42 43 43 string name = _node.getElementName(); -
XMLIO_V2/dev/dev_rv/src/XMLIO/main_cpp.cpp
r108 r110 11 11 try 12 12 { 13 string file("/local/XMLIOSERVER_DEV/dev_rv/test/iodef_test.xml");14 //string file("/local/XMLIOSERVER_DEV/dev_rv/iodef_test.xml");13 //string file("/local/XMLIOSERVER_DEV/dev_rv/test/iodef_test.xml"); 14 string file("/local/XMLIOSERVER_DEV/dev_rv/iodef_test.xml"); 15 15 16 16 ifstream istr( file.c_str() , ifstream::in ); -
XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio.hpp
r109 r110 28 28 #include "xmlio_object_template.hpp" 29 29 30 // Gestion des attributs des objets. 31 #include "grid_attribut.hpp" 32 #include "axis_attribut.hpp" 30 33 #include "field_attribut.hpp" 31 34 #include "file_attribut.hpp" 32 35 36 #include "xmlio_group_template.hpp" 37 38 // Prise en charge des champs... 33 39 #include "field.hpp" 34 35 36 #include "xmlio_group_template.hpp"37 40 #include "field_group.hpp" 38 41 // Prise en charge des fichiers ... 39 42 #include "file.hpp" 40 43 #include "file_group.hpp" 44 // Prise en charge des axes ... 45 #include "axis.hpp" 46 #include "axis_group.hpp" 47 // Prise en charge des grilles ... 48 #include "grid.hpp" 49 #include "grid_group.hpp" 41 50 42 51 #include "context.hpp" -
XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_object_template.hpp
r109 r110 60 60 sset.insert(baseObject = refer); 61 61 } 62 } 63 64 virtual void parse (XMLNode& _node) 65 { 66 string name = _node.getElementName(); 67 THashAttributes attributes; 68 69 /// PARSING GESTION DES ATTRIBUTS /// 70 _node.getAttributes(attributes); 71 this->setAttributes(attributes); 72 attributes.clear(); 73 74 /// PARSING POUR GESION DES ENFANTS /// 75 // Rien à faire. 62 76 } 63 77
Note: See TracChangeset
for help on using the changeset viewer.