Changeset 110


Ignore:
Timestamp:
06/21/10 10:53:06 (14 years ago)
Author:
hozdoba
Message:

Prise en charge simplifiée des axes et des grilles.
Simplification du code.

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  
    99      public: 
    1010 
    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) 
    1212         {/* 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) 
    1414         {/* Ne rien faire de plus */} 
    1515 
     
    4141               ((*it).second)[(*it).first]->resolveDescInheritance(); 
    4242 
    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. 
    4444               const std::vector<CFile*>& allFiles = CFile::GetCurrentListObject().getVector(); 
    4545               for (unsigned int i = 0; i < allFiles.size(); i++) allFiles[i]->resolveFieldRefInheritance(); 
     
    6161 
    6262            // 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); 
    6565 
    6666            // 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); 
    6969         } 
    7070 
    71          void parse (XMLNode& _node) 
     71         virtual void parse (XMLNode& _node) 
    7272         { 
    7373            THashAttributes attributes; 
     
    9292                  if (name.compare(FieldDefinition::GetDefName()) == 0) // Parsing définition des champs. 
    9393                  { fieldDef = CreateInstanceAndParse<FieldDefinition>(attributes, _node, "field_definition"); continue; } 
     94 
    9495                  if (name.compare(FileDefinition::GetDefName()) == 0) // Parsing définition des fichiers. 
    9596                  { fileDef = CreateInstanceAndParse<FileDefinition>(attributes, _node, "file_definition"); continue; } 
    9697 
    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; } 
    103100 
    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; } 
    110103 
    111104                  WARNING("La définition est invalide, seules les champs, grilles, axes et fichiers peuvent être définis !"); 
     
    123116 
    124117         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)); } 
    126119         virtual void printChild(ostream& out) const 
    127120         { 
    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; 
    132125         } 
    133126         virtual void resolveDescInheritance(const AttributRegistrar* _parent = 0) 
     
    136129            if(fieldDef != NULL) fieldDef->resolveDescInheritance(); 
    137130            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(); 
    140133         } 
    141134 
    142135         FieldDefinition* getFieldDefinition(void) { return (this->fieldDef); } 
    143136         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); } 
    146139 
    147140         ~Context() 
     
    149142            if(fieldDef != NULL) delete fieldDef; 
    150143            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; 
    153146         } 
    154147 
     
    158151         FieldDefinition*  fieldDef; 
    159152         FileDefinition*   fileDef; 
    160          /*AxisDefinition*   axisDef; 
    161          GridDefinition*   gridDef;*/ 
     153         AxisDefinition*   axisDef; 
     154         GridDefinition*   gridDef; 
    162155 
    163156 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp

    r109 r110  
    2727         } 
    2828 
    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  
    4329         ~CField(void) 
    4430         { /* Ne rien faire de plus */ } 
    4531 
    46    }; // class Field 
     32   }; // class CField 
    4733 
    4834}; // namespace XMLIOSERVER 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/field_group.hpp

    r107 r110  
    3232            } 
    3333 
    34             /// PARSING POUR GESION DES ENFANTS 
     34            /// PARSING POUR GESTION DES ENFANTS 
    3535            if (!(_node.goToChildElement())) 
    3636               WARNING("Le groupe de champ ne contient pas d'enfant !"); 
     
    3838            { 
    3939               ////////////////////////////////////// 
    40                do { // Parcours des contexts pour traitement. 
     40               do { // Parcours pour traitement. 
    4141 
    4242                  string name = _node.getElementName(); 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/file.hpp

    r109 r110  
    1818         static string GetName(void) { return ("file"); } 
    1919 
    20          void parse (XMLNode& _node) 
     20         virtual void parse (XMLNode& _node) 
    2121         { 
    2222            string name = _node.getElementName(); 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/file_group.hpp

    r107 r110  
    3333            } 
    3434 
    35             /// PARSING POUR GESION DES ENFANTS /// 
     35            /// PARSING POUR GESTION DES ENFANTS /// 
    3636            if (!(_node.goToChildElement())) 
    3737               WARNING("Le groupe de fichier ne contient pas d'enfant !"); 
     
    3939            { 
    4040               ////////////////////////////////////// 
    41                do { // Parcours des contexts pour traitement. 
     41               do { // Parcours pour traitement. 
    4242 
    4343                  string name = _node.getElementName(); 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/main_cpp.cpp

    r108 r110  
    1111   try 
    1212   { 
    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"); 
    1515 
    1616      ifstream istr( file.c_str() , ifstream::in ); 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio.hpp

    r109 r110  
    2828#include "xmlio_object_template.hpp" 
    2929 
     30// Gestion des attributs des objets. 
     31#include "grid_attribut.hpp" 
     32#include "axis_attribut.hpp" 
    3033#include "field_attribut.hpp" 
    3134#include "file_attribut.hpp" 
    3235 
     36#include "xmlio_group_template.hpp" 
     37 
     38// Prise en charge des champs... 
    3339#include "field.hpp" 
    34  
    35  
    36 #include "xmlio_group_template.hpp" 
    3740#include "field_group.hpp" 
    38  
     41// Prise en charge des fichiers ... 
    3942#include "file.hpp" 
    4043#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" 
    4150 
    4251#include "context.hpp" 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_object_template.hpp

    r109 r110  
    6060               sset.insert(baseObject = refer); 
    6161            } 
     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. 
    6276         } 
    6377 
Note: See TracChangeset for help on using the changeset viewer.