Changeset 106 for XMLIO_V2


Ignore:
Timestamp:
06/14/10 15:32:15 (14 years ago)
Author:
hozdoba
Message:

Commit intermédiaire en attendant l'arrivée de l'héritage par référence...
Prise en charge de la définition des fichiers.
Correction des fichiers xml de définition (pour tests).
Correction de deux problÚmes de mise à jour de context.
etc.

Location:
XMLIO_V2/dev/dev_rv
Files:
3 added
14 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/iodef_test.xml

    r102 r106  
    3838     </field_group> 
    3939 
    40      <field_group id="grid_U"  axis_ref="none" grid_ref="grid_U" src="/local/testsuite/iodef_test_include.xml"> 
     40     <field_group id="grid_U"  axis_ref="none" grid_ref="grid_U" src="/local/XMLIOSERVER_DEV/dev_rv/iodef_test_include.xml"> 
    4141       <field id="sozotaux" description="Wind Stress along i-axis"        unit="N/m2"    /> 
    4242       <field id="sozospgx" description="Zonal Surface Pressure Gradient" unit="N/kg"  /> 
     
    6868 
    6969     <file id="GYRE_1d_grid_T" name="grid_T" description="fichier de sortie journaliere" output_freq="86400" output_level="5" > 
    70        <field ref="votemper"  /> 
    71        <field ref="vosaline"  /> 
    72        <field ref="sosstsst"  /> 
    73        <field ref="sosaline"  /> 
    74        <field ref="sobarstf"  /> 
    75        <field ref="sossheig"  /> 
    76        <field ref="iowaflup"  /> 
    77        <field ref="sowaflep"  /> 
    78        <field ref="sowaflup"  /> 
    79        <field ref="sosalflx"  /> 
    80        <field ref="soshfldo"  /> 
    81        <field ref="sorunoff"  /> 
    82        <field ref="sowaflcd"  /> 
    83        <field ref="sohefldo"  /> 
    84        <field ref="somxl010"  /> 
    85        <field ref="somixhgt"  /> 
    86        <field ref="soicecov"  /> 
    87        <field ref="sohefldp"  /> 
    88        <field ref="sowafldp"  /> 
    89        <field ref="sosafldp"  /> 
    90        <field ref="sosurfps"  /> 
    91        <field ref="sobowlin"  /> 
    92        <field ref="sothedep"  /> 
    93        <field ref="so20chgt"  /> 
    94        <field ref="so28chgt"  /> 
    95        <field ref="sohtc300"  /> 
    96        <field ref="soicetem"  /> 
    97        <field ref="soicealb"  /> 
     70       <field field_ref="votemper"  /> 
     71       <field field_ref="vosaline"  /> 
     72       <field field_ref="sosstsst"  /> 
     73       <field field_ref="sosaline"  /> 
     74       <field field_ref="sobarstf"  /> 
     75       <field field_ref="sossheig"  /> 
     76       <field field_ref="iowaflup"  /> 
     77       <field field_ref="sowaflep"  /> 
     78       <field field_ref="sowaflup"  /> 
     79       <field field_ref="sosalflx"  /> 
     80       <field field_ref="soshfldo"  /> 
     81       <field field_ref="sorunoff"  /> 
     82       <field field_ref="sowaflcd"  /> 
     83       <field field_ref="sohefldo"  /> 
     84       <field field_ref="somxl010"  /> 
     85       <field field_ref="somixhgt"  /> 
     86       <field field_ref="soicecov"  /> 
     87       <field field_ref="sohefldp"  /> 
     88       <field field_ref="sowafldp"  /> 
     89       <field field_ref="sosafldp"  /> 
     90       <field field_ref="sosurfps"  /> 
     91       <field field_ref="sobowlin"  /> 
     92       <field field_ref="sothedep"  /> 
     93       <field field_ref="so20chgt"  /> 
     94       <field field_ref="so28chgt"  /> 
     95       <field field_ref="sohtc300"  /> 
     96       <field field_ref="soicetem"  /> 
     97       <field field_ref="soicealb"  /> 
    9898    </file> 
    9999   <file_group id="file_id"> 
    100     <file id="GYRE_1d_grid_U" description="fichier de sortie journaliere" output_freq="86400" level="5" > 
    101        <field ref="votemper"  enabled=".FALSE." /> 
    102        <field ref="vozocrtx"  /> 
    103        <field ref="vozoeivu"  /> 
    104        <field ref="sozotaux"  /> 
    105        <field ref="sozospgx"  /> 
    106     </file> 
    107  
    108     <file id="GYRE_1d_grid_V" description="fichier de sortie journaliere" output_freq="86400" level="5" > 
    109        <field ref="vomecrty"  /> 
    110        <field ref="vomeeivv"  /> 
    111        <field ref="sometauy"  /> 
    112        <field ref="somespgy"  /> 
     100    <file id="GYRE_1d_grid_U" description="fichier de sortie journaliere" output_freq="86400" output_level="5" > 
     101       <field field_ref="votemper"  enabled=".FALSE." /> 
     102       <field field_ref="vozocrtx"  /> 
     103       <field field_ref="vozoeivu"  /> 
     104       <field field_ref="sozotaux"  /> 
     105       <field field_ref="sozospgx"  /> 
     106    </file> 
     107 
     108    <file id="GYRE_1d_grid_V" description="fichier de sortie journaliere" output_freq="86400" output_level="5" > 
     109       <field field_ref="vomecrty"  /> 
     110       <field field_ref="vomeeivv"  /> 
     111       <field field_ref="sometauy"  /> 
     112       <field field_ref="somespgy"  /> 
    113113    </file> 
    114114   </file_group> 
    115     <file id="GYRE_1d_grid_W" description="fichier de sortie journaliere" output_freq="86400" level="5" > 
    116        <field ref="vovecrtz" /> 
    117        <field ref="voveeivw" /> 
    118        <field ref="votkeavt" /> 
    119        <field ref="votkeevd" /> 
    120        <field ref="votkeavm" /> 
    121        <field ref="votkeevm" /> 
    122        <field ref="soleahtw" /> 
    123        <field ref="soleaeiw" /> 
     115    <file id="GYRE_1d_grid_W" description="fichier de sortie journaliere" output_freq="86400" output_level="5" > 
     116       <field field_ref="vovecrtz" /> 
     117       <field field_ref="voveeivw" /> 
     118       <field field_ref="votkeavt" /> 
     119       <field field_ref="votkeevd" /> 
     120       <field field_ref="votkeavm" /> 
     121       <field field_ref="votkeevm" /> 
     122       <field field_ref="soleahtw" /> 
     123       <field field_ref="soleaeiw" /> 
    124124    </file> 
    125125 
     
    213213 
    214214     <file id="GYRE_1d_grid_T" name="grid_T_bis"  description="fichier de sortie journaliere" output_freq="86400" output_level="5" > 
    215        <field ref="votemper"  /> 
    216        <field ref="vosaline"  /> 
    217        <field ref="sosstsst"  /> 
    218        <field ref="sosaline"  /> 
    219        <field ref="sobarstf"  /> 
    220        <field ref="sossheig"  /> 
    221        <field ref="iowaflup"  /> 
    222        <field ref="sowaflep"  /> 
    223        <field ref="sowaflup"  /> 
    224        <field ref="sosalflx"  /> 
    225        <field ref="soshfldo"  /> 
    226        <field ref="sorunoff"  /> 
    227        <field ref="sowaflcd"  /> 
    228        <field ref="sohefldo"  /> 
    229        <field ref="somxl010"  /> 
    230        <field ref="somixhgt"  /> 
    231        <field ref="soicecov"  /> 
    232        <field ref="sohefldp"  /> 
    233        <field ref="sowafldp"  /> 
    234        <field ref="sosafldp"  /> 
    235        <field ref="sosurfps"  /> 
    236        <field ref="sobowlin"  /> 
    237        <field ref="sothedep"  /> 
    238        <field ref="so20chgt"  /> 
    239        <field ref="so28chgt"  /> 
    240        <field ref="sohtc300"  /> 
    241        <field ref="soicetem"  /> 
    242        <field ref="soicealb"  /> 
    243     </file> 
    244  
    245     <file id="GYRE_1d_grid_U" name="GYRE_1d_grid_U_bis" description="fichier de sortie journaliere" output_freq="86400" level="5" > 
    246        <field ref="votemper"  enabled=".FALSE." /> 
    247        <field ref="vozocrtx"  /> 
    248        <field ref="vozoeivu"  /> 
    249        <field ref="sozotaux"  /> 
    250        <field ref="sozospgx"  /> 
    251     </file> 
    252  
    253     <file id="GYRE_1d_grid_V" name="GYRE_1d_grid_V_bis" description="fichier de sortie journaliere" output_freq="86400" level="5" > 
    254        <field ref="vomecrty"  /> 
    255        <field ref="vomeeivv"  /> 
    256        <field ref="sometauy"  /> 
    257        <field ref="somespgy"  /> 
    258     </file> 
    259  
    260     <file id="GYRE_1d_grid_W" name="GYRE_1d_grid_W_bis"  description="fichier de sortie journaliere" output_freq="86400" level="5" > 
    261        <field ref="vovecrtz" /> 
    262        <field ref="voveeivw" /> 
    263        <field ref="votkeavt" /> 
    264        <field ref="votkeevd" /> 
    265        <field ref="votkeavm" /> 
    266        <field ref="votkeevm" /> 
    267        <field ref="soleahtw" /> 
    268        <field ref="soleaeiw" /> 
     215       <field field_ref="votemper"  /> 
     216       <field field_ref="vosaline"  /> 
     217       <field field_ref="sosstsst"  /> 
     218       <field field_ref="sosaline"  /> 
     219       <field field_ref="sobarstf"  /> 
     220       <field field_ref="sossheig"  /> 
     221       <field field_ref="iowaflup"  /> 
     222       <field field_ref="sowaflep"  /> 
     223       <field field_ref="sowaflup"  /> 
     224       <field field_ref="sosalflx"  /> 
     225       <field field_ref="soshfldo"  /> 
     226       <field field_ref="sorunoff"  /> 
     227       <field field_ref="sowaflcd"  /> 
     228       <field field_ref="sohefldo"  /> 
     229       <field field_ref="somxl010"  /> 
     230       <field field_ref="somixhgt"  /> 
     231       <field field_ref="soicecov"  /> 
     232       <field field_ref="sohefldp"  /> 
     233       <field field_ref="sowafldp"  /> 
     234       <field field_ref="sosafldp"  /> 
     235       <field field_ref="sosurfps"  /> 
     236       <field field_ref="sobowlin"  /> 
     237       <field field_ref="sothedep"  /> 
     238       <field field_ref="so20chgt"  /> 
     239       <field field_ref="so28chgt"  /> 
     240       <field field_ref="sohtc300"  /> 
     241       <field field_ref="soicetem"  /> 
     242       <field field_ref="soicealb"  /> 
     243    </file> 
     244 
     245    <file id="GYRE_1d_grid_U" name="GYRE_1d_grid_U_bis" description="fichier de sortie journaliere" output_freq="86400" output_level="5" > 
     246       <field field_ref="votemper"  enabled=".FALSE." /> 
     247       <field field_ref="vozocrtx"  /> 
     248       <field field_ref="vozoeivu"  /> 
     249       <field field_ref="sozotaux"  /> 
     250       <field field_ref="sozospgx"  /> 
     251    </file> 
     252 
     253    <file id="GYRE_1d_grid_V" name="GYRE_1d_grid_V_bis" description="fichier de sortie journaliere" output_freq="86400" output_level="5" > 
     254       <field field_ref="vomecrty"  /> 
     255       <field field_ref="vomeeivv"  /> 
     256       <field field_ref="sometauy"  /> 
     257       <field field_ref="somespgy"  /> 
     258    </file> 
     259 
     260    <file id="GYRE_1d_grid_W" name="GYRE_1d_grid_W_bis"  description="fichier de sortie journaliere" output_freq="86400" output_level="5" > 
     261       <field field_ref="vovecrtz" /> 
     262       <field field_ref="voveeivw" /> 
     263       <field field_ref="votkeavt" /> 
     264       <field field_ref="votkeevd" /> 
     265       <field field_ref="votkeavm" /> 
     266       <field field_ref="votkeevm" /> 
     267       <field field_ref="soleahtw" /> 
     268       <field field_ref="soleaeiw" /> 
    269269    </file> 
    270270 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/attribut_registrar.hpp

    r104 r106  
    33 
    44#include "attribut.hpp" 
     5 
     6using XMLIOSERVER::XML::THashAttributes; 
    57 
    68namespace XMLIOSERVER 
     
    1416       
    1517         void RegisterAttribut(BaseAttribut* attribut){ attrList.addObject(attribut); }          
    16          StrHashMap<BaseAttribut>& getAttributList(void) { return (attrList); }          
     18         const StrHashMap<BaseAttribut>& getAttributList(void) const { return (attrList); }          
    1719         size_t getNbAttributes() const {return (attrList.getSize()); } 
    18          bool hasAttribut(const string _id) { return (attrList.hasMappedValue(_id)); } 
     20         bool hasAttribut(const string& _id) { return (attrList.hasMappedValue(_id)); } 
    1921          
    20          BaseAttribut* getAttribut(const string _id) throw (XMLIOUndefinedValueException) { return (attrList[_id]); } 
     22         BaseAttribut* getAttribut(const string& _id) throw (XMLIOUndefinedValueException) { return (attrList[_id]); } 
     23          
     24         friend ostream& operator<< (ostream& out, const AttributRegistrar& c)  
     25         {             
     26            for(unsigned int i = 0; i < c.attrList.getVectorSize(); i++) out << *c.attrList.getVector()[i];           
     27            return (out); 
     28         }    
     29          
     30          
     31         void setAttributes(const THashAttributes& _attr) 
     32         { 
     33            for (THashAttributes::ConstIterator it = _attr.begin(); it != _attr.end(); it++) 
     34               if ((*it).first.compare(string("id"))!= 0 and (*it).first.compare(string("src"))!=0) 
     35               // (Au dessus) Non prise en compte de l'identifiant et de l'inclusion de fichiers externes lors de l'affectation des attributs. 
     36                  this->setSAttribut((*it).first, (*it).second);             
     37            return; 
     38         } 
     39          
     40         void addAttributes(const AttributRegistrar& _parent) 
     41         {   
     42            const StrHashMap<BaseAttribut>& _pattr = _parent.getAttributList(); 
     43            const StrHashMap<BaseAttribut>& _lattr = getAttributList();             
     44            //_pattr contient les attributs du parent, _lattr les attributs locaux. 
     45             
     46            for(unsigned int i = 0; i < _lattr.getVectorSize(); i++) 
     47            { 
     48               if(_lattr.getVector()[i]->_hasValue() or !_pattr.getVector()[i]->_hasValue()) continue; 
     49               _lattr.getVector()[i]->assignValue(_pattr.getVector()[i]); 
     50            } 
     51         } 
    2152         
    2253         void setSAttribut(const string& att_name, const std::string& value) 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp

    r105 r106  
    99      public: 
    1010             
    11          Context(void) : ObjectTemplate<Context>(), fieldDef(NULL) 
     11         Context(void) : ObjectTemplate<Context>(), fieldDef(NULL), fileDef(NULL) 
    1212         {/* Ne rien faire de plus */}                
    13          Context(const string& _id) : ObjectTemplate<Context>(_id), fieldDef(NULL) 
     13         Context(const string& _id) : ObjectTemplate<Context>(_id), fieldDef(NULL), fileDef(NULL) 
    1414         {/* Ne rien faire de plus */} 
    1515          
     
    1818            // On modifie le context courrant pour tout les ObjectTemplate 
    1919            Context::SetContext(id); 
     20             
     21            // Changement de context pour les champs et groupes de champs. 
    2022            FieldGroup::SetContext(id); 
    21             Field::SetContext(id); 
     23            CField::SetContext(id); 
     24             
     25            // Changement de context pour les champs et groupes de champs. 
     26            FileGroup::SetContext(id); 
     27            CFile::SetContext(id); 
    2228         } 
    2329          
     
    2531         {  
    2632            out << IncIndent << "<" << c.getName()<< " id=\"" <<  c.getId() << "\">" << std::endl; 
     33             
    2734            if(c.fieldDef != NULL) out << *(FieldGroup*)c.fieldDef << std::endl; 
     35            if(c.fileDef != NULL)  out << *(FileGroup*) c.fileDef  << std::endl; 
     36             
    2837            out << NIndent << "</" << c.getName()<< ">" << DecEndl; 
    2938            return (out); 
     
    3443            // Résolution des héritages descendants pour chacun des groupes de définitions. 
    3544            if(fieldDef != NULL) fieldDef->resolveDescInheritance(); 
     45            if(fileDef != NULL)  fileDef->resolveDescInheritance(); 
    3646         } 
    3747          
     
    7080                  } 
    7181                  else if (name.compare("file_definition") == 0) 
    72                   { // Parsing pour la définition des fichiers.                   
    73                      INFO("Le parsing des définitions de fichiers n'est pas encore implémenté"); 
     82                  { // Parsing pour la définition des fichiers.  
     83                                    
     84                     if (FileDefinition::HasObject("file_definition"))  
     85                        WARNING("Le context possÚde déjà un noeud de définition de fichiers, le dernier défini complétera le premier !"); 
     86                      
     87                     fileDef = (FileDefinition*)&FileDefinition::CreateObject("file_definition"); // << Conversion possible car la classe Field n'a pas de propriétés. 
     88                     fileDef->parse(_node); 
     89 
     90                     continue; 
    7491                  }  
    7592                  else if (name.compare("axis_definition") == 0) 
     
    97114          
    98115         FieldDefinition* getFieldDefinition(void) { return (this->fieldDef); } 
     116         FileDefinition*  getFileDefinition(void)  { return (this->fileDef);  } 
    99117                   
    100118         ~Context() 
    101          { if(fieldDef != NULL) delete fieldDef; }       
     119         {  
     120            if(fieldDef != NULL) delete fieldDef; 
     121            if(fileDef != NULL)  delete fileDef; 
     122         }       
    102123 
    103124       
     
    105126       
    106127         FieldDefinition*  fieldDef; 
    107          /*FileDefinition* fileDef; 
    108          AxisDefinition*   axisDef; 
     128         FileDefinition*  fileDef; 
     129         /*AxisDefinition*   axisDef; 
    109130         GridDefinition*   gridDef;*/ 
    110131 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp

    r105 r106  
    77namespace XMLIOSERVER 
    88{ 
    9    class Field : public ObjectTemplate<Field>, public FieldAttribut 
     9   class CField : public ObjectTemplate<CField>, public FieldAttribut 
    1010   { 
    1111      public: 
    1212       
    13          Field(void) : ObjectTemplate<Field>(), FieldAttribut() 
     13         CField(void) : ObjectTemplate<CField>(), FieldAttribut() 
    1414                        {/* Ne rien faire de plus */}                    
    15                         Field(const string& _id) : ObjectTemplate<Field>(_id), FieldAttribut() 
     15                        CField(const string& _id) : ObjectTemplate<CField>(_id), FieldAttribut() 
    1616         {/* Ne rien faire de plus */}   
    1717          
    18          friend ostream& operator<< (ostream& out, const Field& c)  
     18         friend ostream& operator<< (ostream& out, const CField& c)  
    1919         { 
    20             out << IncIndent << "<" << c.getName(); 
    21             if(c.hasId()) out << " id=\"" <<  c.getId() << "\""; 
    22             for(unsigned int i = 0; i < c.attrList.getVectorSize(); i++) out << *c.attrList.getVector()[i]; 
    23             out << "/>" << DecEndl; 
    24                             
     20            const AttributRegistrar &ar = c; 
     21            out << IncIndent << "<" << c.getName() << c.printId() << ar << "/>" << DecEndl;                      
    2522            return (out); 
    2623         } 
    27           
    28          void setAttributes(const THashAttributes& _attr) 
    29          { 
    30             for (THashAttributes::ConstIterator it = _attr.begin(); it != _attr.end(); it++) 
    31                if ((*it).first.compare(string("id"))) 
    32                // Non prise en compte de l'identifiant lors de l'affectation des attributs. 
    33                   this->setSAttribut((*it).first, (*it).second); 
    34          } 
    35           
    36          void addAttributes(const StrHashMap<BaseAttribut>& _pattr) 
    37          { 
    38             StrHashMap<BaseAttribut>& _lattr = getAttributList(); 
    39              
    40             //_pattr contient les attributs du parent, _lattr les attributs locaux. 
    41              
    42             for(unsigned int i = 0; i < _lattr.getVectorSize(); i++) 
    43             { 
    44                if(_lattr.getVector()[i]->_hasValue() or !_pattr.getVector()[i]->_hasValue()) continue; 
    45                _lattr.getVector()[i]->assignValue(_pattr.getVector()[i]); 
    46             } 
    47          } 
    48           
     24                   
    4925         const char* getName(void) const {return ("Field"); }    
    5026 
     
    6541         } 
    6642          
    67          ~Field(void)  
     43         ~CField(void)  
    6844         { /* Ne rien faire de plus */ }     
    6945       
  • XMLIO_V2/dev/dev_rv/src/XMLIO/field_attribut.hpp

    r104 r106  
    5050         } 
    5151      
    52    } ; // class CFieldAttribut 
     52   } ; // class FieldAttribut 
    5353    
    5454}// namespace XMLIOSERVER 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/field_group.hpp

    r105 r106  
    22#define __FIELD_GROUP__ 
    33 
    4  
    5 using XMLIOSERVER::XML::THashAttributes; 
    6  
    74namespace XMLIOSERVER 
    85{    
    9    class FieldGroup : public GroupTemplate<Field, FieldAttribut> 
     6   class FieldGroup : public GroupTemplate<CField, FieldAttribut> 
    107   { 
    118      public: 
    129       
    13          FieldGroup(void) : GroupTemplate<Field, FieldAttribut>() 
     10         FieldGroup(void) : GroupTemplate<CField, FieldAttribut>() 
    1411         {/* Ne rien faire de plus */}                
    15          FieldGroup(const string& _id) : GroupTemplate<Field, FieldAttribut>(_id) 
     12         FieldGroup(const string& _id) : GroupTemplate<CField, FieldAttribut>(_id) 
    1613         {/* Ne rien faire de plus */} 
    17           
    18          void setAttributes(const THashAttributes& _attr) 
    19          { 
    20             for (THashAttributes::ConstIterator it = _attr.begin(); it != _attr.end(); it++) 
    21                if ((*it).first.compare(string("id"))!= 0 and (*it).first.compare(string("src"))!=0) 
    22                // (Au dessus) Non prise en compte de l'identifiant et de l'inclusion de fichiers externes lors de l'affectation des attributs. 
    23                   this->setSAttribut((*it).first, (*it).second); 
    24              
    25             return; 
    26          } 
    27                   
     14                          
    2815         const char* getName(void) const {return ("Field_Group"); }   
    2916          
     17          
     18         /// TODO A remonter dans l'arbre des héritages 
    3019         friend ostream& operator<< (ostream& out, const FieldGroup& c)  
    31          {             
    32             out << IncIndent << "<" << c.getName(); 
    33             if(c.hasId()) out << " id=\"" <<  c.getId() << "\""; 
    34             for(unsigned int i = 0; i < c.attrList.getVectorSize(); i++) out << *c.attrList.getVector()[i]; 
    35             out << ">" << std::endl; 
     20         {    
     21            const AttributRegistrar &ar = c; 
     22            out << IncIndent << "<" << c.getName() << c.printId() << ar << ">" << std::endl;             
    3623             
    37              
     24            // Ecriture des sous-groupes. 
    3825            for(unsigned int i = 0; i < c.groupList.getVector().size() ; i++) 
    3926               out << *((FieldGroup*)c.groupList.getVector()[i])  << std::endl; 
    4027                
     28            // Ecriture des enfants. 
    4129            for(unsigned int i = 0; i < c.childList.getVector().size() ; i++) 
    4230               out << *(c.childList.getVector()[i]) << std::endl; 
    4331                
    4432            out << NIndent << "</" << c.getName()<< ">" << DecEndl; 
     33             
    4534            return (out); 
    46          }  
    47                            
    48          void addAttributes(const StrHashMap<BaseAttribut>& _pattr) 
    49          {           
    50             StrHashMap<BaseAttribut>& _lattr = getAttributList(); 
    51              
    52             //_pattr contient les attributs du parent, _lattr les attributs locaux. 
    53              
    54             for(unsigned int i = 0; i < _lattr.getVectorSize(); i++) 
    55             { 
    56                if(_lattr.getVector()[i]->_hasValue() or !_pattr.getVector()[i]->_hasValue()) continue; 
    57                _lattr.getVector()[i]->assignValue(_pattr.getVector()[i]); 
    58             } 
    59          } 
     35         }    
    6036          
    61          void resolveDescInheritance(StrHashMap<BaseAttribut>* _pattr = 0) 
     37         /// TODO A remonter dans l'arbre des héritages    
     38         void resolveDescInheritance(const AttributRegistrar* _parent = 0) 
    6239         { 
    63             const vector<Field*>&  childvect = childList.getVector(); 
    64             const vector<GroupTemplate<Field, FieldAttribut>*>& groupvect = groupList.getVector(); 
     40            const vector<CField*>&  childvect = childList.getVector(); 
     41            const vector<GroupTemplate<CField, FieldAttribut>*>& groupvect = groupList.getVector(); 
    6542             
    6643            // On complÚte les propres attributs du groupe. 
    67             if (_pattr!= NULL) addAttributes(*_pattr); 
     44            if (_parent!= NULL) addAttributes(*_parent); 
    6845             
    6946            for(unsigned int i = 0; i < childvect.size() ; i++) 
    7047            // on complÚte les attributs des champs enfants 
    71                childvect[i] -> addAttributes(this->attrList); 
     48               childvect[i] -> addAttributes(*this); 
    7249                
    7350            for(unsigned int i = 0; i < groupvect.size() ; i++) 
    7451            // on complÚte les attributs des groupes de champs enfants 
    75                ((FieldGroup*)groupvect[i]) -> resolveDescInheritance(&this->attrList); 
     52               ((FieldGroup*)groupvect[i]) -> resolveDescInheritance(this); 
    7653         } 
    7754          
    78          void parse (XMLNode& _node) 
     55         void parse (XMLNode& _node, bool _withAttr = true) 
    7956         { 
    8057            string name = _node.getElementName();             
     
    8259 
    8360            /// PARSING GESTION DES ATTRIBUTS /// 
    84             _node.getAttributes(attributes);   
    85             this->setAttributes(attributes); 
    86              
    87             if (attributes.end() != attributes.find("src")) 
    88             { // Si une demande d'inclusion de fichier est trouvé. 
    89                XMLNode _node_inc = getNodeIncludedFile(attributes["src"], name); 
    90                parse (_node_inc); 
     61            if (_withAttr) 
     62            { 
     63               _node.getAttributes(attributes);   
     64               this->setAttributes(attributes); 
     65                
     66               if (attributes.end() != attributes.find("src")) 
     67               { // Si une demande d'inclusion de fichier est trouvé. 
     68                  XMLNode _node_inc = getNodeIncludedFile(attributes["src"], name); 
     69                  parse (_node_inc); 
     70               } 
     71                
     72               attributes.clear(); 
    9173            } 
    92              
    93             attributes.clear(); 
    9474                
    9575            /// PARSING POUR GESION DES ENFANTS 
     
    121101                        fgroup = (FieldGroup*)(&createGroup()); 
    122102                        fgroup->parse(_node); 
    123                      } 
    124                          
     103                     }                         
    125104                     continue; 
    126105                         
    127106                  } 
    128107                  else if (name.compare("field") == 0) 
    129                   { // Parsing pour les champs 
     108                  { // Parsing pour les champs. 
    130109                   
    131                      Field* field = NULL; 
     110                     CField* field = NULL; 
    132111                   
    133112                     if (attributes.end() != attributes.find("id")) 
    134113                     {// Si l'identifiant est défini. 
    135                         if (Field::HasObject(attributes["id"])) 
     114                        if (CField::HasObject(attributes["id"])) 
    136115                           WARNING("Dans le context actuel, un champ du même nom existe déjà, le second fera référence au premier par défaut !");  // TODO TODO 
    137                         field = (Field*)(&createChild(attributes["id"])); 
     116                        field = (CField*)(&createChild(attributes["id"])); 
    138117                        field->parse(_node); 
    139118                     } 
    140119                     else 
    141120                     {// Si l'identifiant n'est pas défini. 
    142                         field = (Field*)(&createChild()); 
     121                        field = (CField*)(&createChild()); 
    143122                        field->parse(_node); 
    144                      }          
    145                      
     123                     }                   
    146124                     continue; 
    147125                  }  
  • XMLIO_V2/dev/dev_rv/src/XMLIO/main_cpp.cpp

    r105 r106  
    1111        try 
    1212        { 
    13       string file("/local/svn/dev_rv/test/iodef_test.xml"); 
     13      string file("/local/XMLIOSERVER_DEV/dev_rv/test/iodef_test.xml"); 
     14       
     15      //string file("/local/XMLIOSERVER_DEV/dev_rv/iodef_test.xml"); 
    1416      ifstream istr( file.c_str() , ifstream::in ); 
    1517       
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio.hpp

    r98 r106  
    2727#include "xmlio_xml_node.hpp" 
    2828#include "xmlio_object_template.hpp" 
     29 
    2930#include "field_attribut.hpp" 
    30 #include "field.hpp"       
    31 #include "xmlio_group_template.hpp"       
    32 #include "field_group.hpp"       
     31#include "file_attribut.hpp" 
     32 
     33#include "field.hpp"      
     34 
     35  
     36#include "xmlio_group_template.hpp"  
     37#include "field_group.hpp" 
     38 
     39#include "file.hpp"   
     40#include "file_group.hpp" 
     41     
    3342#include "context.hpp" 
    3443#include "xmlio_xml_parser.hpp"  
    3544 
    36  
    3745#endif // __XMLIO__  
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_container.hpp

    r104 r106  
    2828         {  
    2929            if(!hasMappedValue(kval)) 
    30                throw XMLIOUndefinedValueException("Appel de la méthode ExHashMap::operator[] invalide."); 
     30               throw XMLIOUndefinedValueException("Appel de la méthode ExHashMap::operator["+kval+"] invalide."); 
    3131            return (find(kval)->second);  
    3232         } 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_group_template.hpp

    r104 r106  
    1313         GroupTemplate(const string& _id) : ObjectTemplate<GroupTemplate<T, U> >(_id), U(), childList(), groupList() 
    1414         {/* Ne rien faire de plus */}             
    15        
     15           
    1616         /// Pour les groupes d'objets enfants /// 
    1717          
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_logger.hpp

    r105 r106  
    5151   // Initialisation de la classe de Logging 
    5252   static ILogger LOGGER("xmlio.log"); 
    53     
     53 
     54///////////////////////////////////////////////////////////////////// 
    5455static unsigned int Indent; 
    5556 
     
    5758{ for(unsigned int i = 0; i < Indent; i++) out << "  "; return(out); } 
    5859 
    59 std::ostream& IncIndent(std::ostream& out) 
    60 { Indent++; return (NIndent(out)); } 
    61  
    62 std::ostream& DecEndl(std::ostream& out) 
    63 { Indent--; return (NIndent(out)); } 
     60std::ostream& IncIndent(std::ostream& out) { Indent++; return (NIndent(out)); } 
     61std::ostream& DecEndl(std::ostream& out) { Indent--; return (NIndent(out)); } 
     62///////////////////////////////////////////////////////////////////// 
    6463 
    6564/************* POUR MEMOIRE ********************** 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_object.hpp

    r104 r106  
    3333         bool operator==(const AbstractObject& other) 
    3434         { 
    35             // Si l'un ou l'autre des objets n'a pas d'identifiant, les objets de ne sont pas "égaux". 
     35            // Si l'un ou l'autre des objets n'a pas d'identifiant, les objets ne sont pas "égaux". 
    3636            if(!this->hasId() or !other.hasId()) return false; 
    3737            return (id.compare(other.id) == 0); 
    3838         } 
     39          
     40         string printId(void) const 
     41         { if(hasId()) return (" id=\""+getId()+"\""); return (""); } 
    3942          
    4043         virtual ~AbstractObject(void) 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_xml_node.hpp

    r104 r106  
    6161            { 
    6262               XMLNode node(_rootName); 
    63                if ((_istr.good())) 
     63               if (_istr.good()) 
    6464               { // S'il est possible de lire le flux en entrée ... 
    6565                  InputSource src(_istr); 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_xml_parser.hpp

    r105 r106  
    8383                  string& id = (*it).first; 
    8484                  StrHashMap<Context>& sc = (*it).second; 
     85                  Context::SetCurrentContext(id); 
    8586                  delete sc[id]; 
    8687               } 
Note: See TracChangeset for help on using the changeset viewer.