Changeset 173


Ignore:
Timestamp:
04/13/11 15:15:12 (13 years ago)
Author:
hozdoba
Message:
 
Location:
XMLIO_V2/dev/dev_rv/src/xmlio
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/xmlio/array_impl.hpp

    r171 r173  
    11#ifndef __XMLIO_CArray_impl__ 
    22#define __XMLIO_CArray_impl__ 
     3 
     4#include "array_mac.hpp" 
    35 
    46namespace xmlioserver 
     
    4143 
    4244   template <typename ValueType, StdSize NumDims, typename Allocator> 
    43       StdOStream & operator << (StdOStream & os, 
    44                                 const boost::shared_ptr<CArray<ValueType, NumDims, Allocator> > & array) 
    45    { os << *array; return (os); } 
     45      StdOStream & operator <<  
     46         (StdOStream & os, const boost::shared_ptr<CArray<ValueType, NumDims, Allocator> > & array) 
     47   {  
     48      os << *array;  
     49      return (os);  
     50   } 
     51    
     52   //---------------------------------------------------------------- 
     53    
     54   template <typename ValueType> void FromBinary 
     55         (StdIStream & is, ARRAY(ValueType, 1) & array) 
     56   { 
     57      ARRAY_ASSIGN(array, ValueType, 1, [1]); 
     58      array->fromBinary(is); 
     59   } 
     60    
     61   template <typename ValueType> void FromBinary 
     62         (StdIStream & is, ARRAY(ValueType, 2) & array) 
     63   { 
     64      ARRAY_ASSIGN(array, ValueType, 2, [1][1]); 
     65      array->fromBinary(is); 
     66   } 
    4667 
     68   template <typename ValueType> void FromBinary 
     69         (StdIStream & is, ARRAY(ValueType, 3) & array) 
     70   { 
     71      ARRAY_ASSIGN(array, ValueType, 3, [1][1][1]); 
     72      array->fromBinary(is); 
     73   } 
    4774   //---------------------------------------------------------------- 
    4875 
  • XMLIO_V2/dev/dev_rv/src/xmlio/attribute_map.cpp

    r171 r173  
    161161            if (!this->hasAttribute(key)) 
    162162               ERROR("CAttributeMap::fromBinary(StdIStream & is)", 
    163                      << "[ key = " << key << "] key not found !");  
    164                       
     163                     << "[ key = " << key << "] key not found !"); 
     164                                         
    165165            is.read (reinterpret_cast<char*>(&hasValue), sizeof(bool)); 
    166166             
  • XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template.hpp

    r152 r173  
    5353 
    5454            virtual void toBinary  (StdOStream & os) const; 
    55             virtual void fromBinary(StdIStream & is); 
     55            virtual void fromBinary(StdIStream & is);             
    5656 
    5757         protected : 
     
    6060            CAttributeTemplate(void); // Not implemented. 
    6161 
    62       }; // class CAttribute 
    63  
     62      }; // class CAttribute     
     63       
    6464   } // namespace tree 
     65    
     66   template <class T>  void FromBinary(StdIStream & is, T & obj); 
     67    
    6568} // namespace xmlioserver 
    6669 
  • XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template_impl.hpp

    r152 r173  
    11#ifndef __XMLIO_CAttributeTemplate_impl__ 
    22#define __XMLIO_CAttributeTemplate_impl__ 
     3 
     4#include "array.hpp" 
    35 
    46namespace xmlioserver 
     
    102104         void CAttributeTemplate<T>::fromBinary(StdIStream & is) 
    103105      { 
    104          this->getValue()->fromBinary(is); 
     106         T value; 
     107         FromBinary(is, value); 
     108         this->setValue(value); 
    105109      } 
    106110 
  • XMLIO_V2/dev/dev_rv/src/xmlio/group_template_impl.hpp

    r172 r173  
    160160                     ? V::GetName() : V::GetDefName(); 
    161161 
    162       oss << "< " << name << " "; 
     162      oss << "<" << name << " "; 
    163163      if (this->hasId() && (this->getId().compare(V::GetDefName()) != 0)) 
    164164         oss << " id=\"" << this->getId() << "\" "; 
     
    185185         } 
    186186             
    187          oss << "</ " << name << " >"; 
     187         oss << "</" << name << " >"; 
    188188      } 
    189189      else 
  • XMLIO_V2/dev/dev_rv/src/xmlio/indent.cpp

    r152 r173  
    1010   unsigned int CIndent::Indent   = 0; 
    1111   StdString    CIndent::Increm   = StdString("   "); 
    12    bool         CIndent::WithLine = true; 
     12   bool         CIndent::WithLine = false; 
    1313 
    1414   StdOStream & CIndent::NIndent(StdOStream& out) 
     
    4242             line.find(xml::CXMLNode::GetRootName()) != StdString::npos) 
    4343            retvalue << CIndent::NIndent << line <<  std::endl; 
    44          else if (line.find("</ ") != StdString::npos) 
     44         else if (line.find("</") != StdString::npos) 
    4545            retvalue << CIndent::NIndent   << line << CIndent::DecEndl << std::endl; 
    4646         else if (line.find(" />") != StdString::npos) 
  • XMLIO_V2/dev/dev_rv/src/xmlio/main_server.cpp

    r171 r173  
    1313   { 
    1414      comm::CMPIManager::Initialise(&argc, &argv); // < seulement en mode connecté 
     15 
     16      //CTreeManager::ParseFile  ("test/iodef_simple_test.xml"); 
     17             
     18      /*StdOFStream ofs("data/data.bin"); 
     19      CTreeManager::ToBinary(ofs); 
     20      ofs.close();*/ 
    1521       
    16       // Création d'un contexte 
    17       boost::shared_ptr<CContext> contxt = CTreeManager::CreateContext("mon_context"); 
     22      StdIFStream ifs("data/data.bin");     
     23      CTreeManager::FromBinary(ifs); 
     24      ifs.close(); 
    1825       
    19        
    20       boost::shared_ptr<CGridGroup>   grid_def   =  
    21          CObjectFactory::GetObject<CGridGroup>(StdString("grid_definition")); 
    22       boost::shared_ptr<CAxisGroup>   axis_def   =  
    23          CObjectFactory::GetObject<CAxisGroup>(StdString("axis_definition")); 
    24       boost::shared_ptr<CDomainGroup> domain_def =  
    25          CObjectFactory::GetObject<CDomainGroup>(StdString("domain_definition")); 
    26        
    27       // Ajout d'une grille, d'un axe et d'un domaine. 
    28       boost::shared_ptr<CGrid>   grid   =  
    29          CGroupFactory::CreateChild(grid_def  , StdString("ma_grille")); 
    30       boost::shared_ptr<CAxis>   axis   =  
    31          CGroupFactory::CreateChild(axis_def  , StdString("mon_axe")); 
    32       boost::shared_ptr<CDomain> domain =  
    33          CGroupFactory::CreateChild(domain_def, StdString("mon_domaine")); 
    34           
    35       boost::shared_ptr<CDomain> sdomain =  
    36          CGroupFactory::CreateChild(domain_def, StdString("mon_super_domaine")); 
    37        
    38       // Définition des attributs de la grille. 
    39       grid->domain_ref.setValue(StdString("mon_domaine")); 
    40       grid->axis_ref.setValue(StdString("mon_axe")); 
    41        
    42       // Définition des attributs de l'axe. 
    43       ARRAY_CREATE(zvalue, double, 1, [10]); 
    44             
    45       axis->size.setValue(zvalue->num_elements()); 
    46       axis->zvalue.setValue(zvalue); 
    47        
    48       // Définition des attributs du domaine l'axe. 
    49       ARRAY_CREATE(latvalue, double, 1, [200]); 
    50       ARRAY_CREATE(lonvalue, double, 1, [200]); 
    51        
    52       ARRAY_CREATE(mask, bool, 2, [20][10]); 
    53        
    54       for (StdSize i = 0; i<mask->num_elements(); i++) 
    55          (mask->data())[i] = i%2; 
    56        
    57       domain->ni_glo.setValue(40); 
    58       domain->nj_glo.setValue(40); 
    59        
    60       domain->ibegin.setValue(1); 
    61       domain->ni.setValue(20);       
    62       domain->jbegin.setValue(1); 
    63       domain->nj.setValue(10); 
    64        
    65       domain->data_dim.setValue(2); 
    66        
    67       domain->mask.setValue(mask); 
    68       domain->lonvalue.setValue(lonvalue); 
    69       domain->latvalue.setValue(latvalue); 
    70             
    71       // Résolution 
    72       grid->solveReference(); 
    73        
    74       std::cout << grid->storeIndex  << std::endl; 
    75       std::cout << grid->out_i_index << std::endl; 
    76       std::cout << grid->out_j_index << std::endl; 
    77       std::cout << grid->out_l_index << std::endl; 
     26      StdIFStream ifss("data/data.bin");     
     27      CTreeManager::FromBinary(ifss); 
     28      ifss.close(); 
    7829       
    7930      // Sortie de l'arborescence xml sous forme de fichier. 
    8031      CTreeManager::PrintTreeToFile("data/def/test.xml"); 
    81        
    82        
    83       ARRAY_CREATE(sarray, double, 1, [1]); 
    84       StdIFStream ifs("data/monfichierbinaire"); 
    85       sarray->fromBinary(ifs); 
    86       ifs.close(); 
    87        
    88       
    89       
    90       
    91       
    92       
    93       
    94       
    9532      
    9633      
  • XMLIO_V2/dev/dev_rv/src/xmlio/manager/tree_manager.cpp

    r168 r173  
    2121         boost::shared_ptr<CContextGroup> group_context = CContext::GetContextGroup(); 
    2222         CTreeManager::SetCurrentContextId(id); 
     23         bool hasctxt = CObjectFactory::HasObject<CContext>(id); 
    2324          
    2425         boost::shared_ptr<tree::CContext> context = 
    2526               CObjectFactory::CreateObject<tree::CContext>(id); 
    26          CGroupFactory::AddChild(group_context, context); 
     27         if (!hasctxt) CGroupFactory::AddChild(group_context, context); 
    2728 
    2829#define DECLARE_NODE(Name_, name_) \ 
     
    5960 
    6061      void CTreeManager::ParseFile(const StdString & filename) 
    61       { xml::CXMLParser::ParseFile(filename); } 
     62      {  
     63         xml::CXMLParser::ParseFile(filename);  
     64      } 
    6265 
    6366      void CTreeManager::ParseString(const StdString & xmlContent) 
    64       { xml::CXMLParser::ParseString(xmlContent); } 
     67      {  
     68         xml::CXMLParser::ParseString(xmlContent);  
     69      } 
    6570 
    6671      void CTreeManager::ParseStream(StdIStream & stream) 
    67       { xml::CXMLParser::ParseStream(stream); } 
     72      {  
     73         xml::CXMLParser::ParseStream(stream);  
     74      } 
     75       
     76      //-------------------------------------------------------------- 
     77       
     78      void CTreeManager::ToBinary(StdOStream & os) 
     79      { 
     80         StdString currentContextId = 
     81            CObjectFactory::GetCurrentContextId(); 
     82         std::vector<boost::shared_ptr<CContext> > def_vector = 
     83            CContext::GetContextGroup()->getChildList(); 
     84             
     85         const StdSize size = def_vector.size();          
     86         const ENodeType cenum = CContext::GetType(); 
     87         const ENodeType genum = CContextGroup::GetType(); 
     88          
     89         os.write (reinterpret_cast<const char*>(&genum) , sizeof(ENodeType));  
     90         os.write (reinterpret_cast<const char*>(&size) , sizeof(StdSize)); 
     91          
     92         for (StdSize i = 0; i < size; i++) 
     93         { 
     94            boost::shared_ptr<CContext> context = def_vector[i];          
     95            CTreeManager::SetCurrentContextId(context->getId());                 
     96            const bool hid = context->hasId(); // Toujours vrai 
     97             
     98            os.write (reinterpret_cast<const char*>(&cenum), sizeof(ENodeType));       
     99            os.write (reinterpret_cast<const char*>(&hid), sizeof(bool)); 
     100             
     101            if (hid) 
     102            { 
     103               const StdString & id = context->getId(); 
     104               const StdSize size   = id.size(); 
     105                   
     106               os.write (reinterpret_cast<const char*>(&size), sizeof(StdSize)); 
     107               os.write (id.data(), size * sizeof(char));          
     108            }  
     109             
     110            context->toBinary(os); 
     111         } 
     112         CTreeManager::SetCurrentContextId(currentContextId);           
     113      } 
     114       
     115      void CTreeManager::FromBinary(StdIStream & is) 
     116      { 
     117         StdSize ctxtnb = 0; 
     118         ENodeType renum = Unknown; 
     119          
     120         boost::shared_ptr<CContextGroup> group_context = 
     121                           CContext::GetContextGroup(); 
     122                            
     123         is.read (reinterpret_cast<char*>(&renum), sizeof(StdSize));    
     124         is.read (reinterpret_cast<char*>(&ctxtnb), sizeof(ENodeType)); 
     125 
     126         if (renum != CContextGroup::GetType()) 
     127            ERROR("CTreeManager::FromBinary(StdIStream & is)", 
     128                  << "[ renum = " << renum << "] Bad type !"); 
     129 
     130         for (StdSize i = 0; i < ctxtnb; i++) 
     131         { 
     132            bool hid = false; 
     133            is.read (reinterpret_cast<char*>(&renum), sizeof(tree::ENodeType)); 
     134            is.read (reinterpret_cast<char*>(&hid), sizeof(bool)); 
     135             
     136            if (renum != CContext::GetType()) 
     137               ERROR("CTreeManager::FromBinary(StdIStream & is)", 
     138                     << "[ renum = " << renum << "] Bad type !"); 
     139                            
     140            if (hid) 
     141            { 
     142               StdSize size  = 0; 
     143               is.read (reinterpret_cast<char*>(&size), sizeof(StdSize)); 
     144               StdString id(size, ' '); 
     145               is.read (const_cast<char *>(id.data()), size * sizeof(char)); 
     146                
     147               CTreeManager::SetCurrentContextId(id);                
     148               bool hasctxt = CObjectFactory::HasObject<CContext>(id); 
     149                
     150               boost::shared_ptr<CContext> context = 
     151                  CObjectFactory::CreateObject<CContext>(id); 
     152                   
     153               if (!hasctxt) 
     154                  CGroupFactory::AddChild(group_context, context); 
     155               context->fromBinary(is); 
     156            } 
     157         } 
     158      } 
    68159 
    69160      ///------------------------------------------------------------- 
  • XMLIO_V2/dev/dev_rv/src/xmlio/manager/tree_manager.hpp

    r157 r173  
    3333            static void ParseString(const StdString & xmlContent); 
    3434            static void ParseStream(StdIStream & stream); 
     35             
     36            /// Binaire /// 
     37            static void ToBinary  (StdOStream & os); 
     38            static void FromBinary(StdIStream & is); 
    3539 
    3640      }; // class CTreeManager 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/context.cpp

    r168 r173  
    11#include "context.hpp" 
     2 
     3#include "tree_manager.hpp" 
    24 
    35#include "attribute_template_impl.hpp" 
     
    6466                    << " ce dernier ne sera pas pris en compte lors du traitement !"); } 
    6567 
    66    #define DECLARE_NODE(Name_, name_)    \ 
    67       if (name.compare(C##Name_##Definition::GetDefName()) == 0) \ 
    68       { CObjectFactory::CreateObject<C##Name_##Definition>(C##Name_##Definition::GetDefName()) -> parse(node); \ 
     68#define DECLARE_NODE(Name_, name_)    \ 
     69   if (name.compare(C##Name_##Definition::GetDefName()) == 0) \ 
     70   { CObjectFactory::CreateObject<C##Name_##Definition>(C##Name_##Definition::GetDefName()) -> parse(node); \ 
    6971   continue; } 
    70    #define DECLARE_NODE_PAR(Name_, name_) 
    71    #include "node_type.conf" 
     72#define DECLARE_NODE_PAR(Name_, name_) 
     73#include "node_type.conf" 
    7274 
    7375            DEBUG(<< "L'élément nommé \'"     << name 
     
    9395 
    9496      out << "<? xml version=\"1.0\" ?>" << std::endl; 
    95       out << "< "  << xml::CXMLNode::GetRootName() << " >" << std::endl; 
     97      out << "<"  << xml::CXMLNode::GetRootName() << " >" << std::endl; 
    9698       
    9799      for (; it != end; it++) 
    98100      { 
    99          boost::shared_ptr<CContext> context = *it; 
    100          CObjectFactory::SetCurrentContextId(context->getId()); 
    101          CGroupFactory::SetCurrentContextId(context->getId()); 
     101         boost::shared_ptr<CContext> context = *it;          
     102         CTreeManager::SetCurrentContextId(context->getId());          
    102103         out << *context << std::endl; 
    103104      } 
    104105       
    105       out << "</ " << xml::CXMLNode::GetRootName() << " >" << std::endl; 
    106  
    107       CObjectFactory::SetCurrentContextId(currentContextId); 
    108        CGroupFactory::SetCurrentContextId(currentContextId); 
    109    } 
    110  
     106      out << "</" << xml::CXMLNode::GetRootName() << " >" << std::endl; 
     107      CTreeManager::SetCurrentContextId(currentContextId);   
     108   } 
     109    
     110   //---------------------------------------------------------------- 
     111    
     112   void CContext::toBinary(StdOStream & os) const 
     113   { 
     114      SuperClass::toBinary(os); 
     115        
     116#define DECLARE_NODE(Name_, name_)                                         \ 
     117   {                                                                       \ 
     118      ENodeType renum = C##Name_##Definition::GetType();                   \ 
     119      bool val = CObjectFactory::HasObject<C##Name_##Definition>           \ 
     120                     (C##Name_##Definition::GetDefName());                 \ 
     121      os.write (reinterpret_cast<const char*>(&renum), sizeof(ENodeType)); \ 
     122      os.write (reinterpret_cast<const char*>(&val), sizeof(bool));        \ 
     123      if (val) CObjectFactory::GetObject<C##Name_##Definition>             \ 
     124                     (C##Name_##Definition::GetDefName())->toBinary(os);   \ 
     125   }    
     126#define DECLARE_NODE_PAR(Name_, name_) 
     127#include "node_type.conf" 
     128   } 
     129    
     130   //---------------------------------------------------------------- 
     131    
     132   void CContext::fromBinary(StdIStream & is) 
     133   { 
     134      SuperClass::fromBinary(is); 
     135#define DECLARE_NODE(Name_, name_)                                         \ 
     136   {                                                                       \ 
     137      bool val = false;                                                    \ 
     138      ENodeType renum = Unknown;                                           \ 
     139      is.read (reinterpret_cast<char*>(&renum), sizeof(ENodeType));        \ 
     140      is.read (reinterpret_cast<char*>(&val), sizeof(bool));               \ 
     141      if (renum != C##Name_##Definition::GetType())                        \ 
     142         ERROR("CContext::fromBinary(StdIStream & is)",                    \ 
     143               << "[ renum = " << renum << "] Bad type !");                \ 
     144      if (val) CObjectFactory::CreateObject<C##Name_##Definition>          \ 
     145                  (C##Name_##Definition::GetDefName()) -> fromBinary(is);  \ 
     146   }    
     147#define DECLARE_NODE_PAR(Name_, name_) 
     148#include "node_type.conf" 
     149       
     150   } 
     151    
     152    
    111153   //---------------------------------------------------------------- 
    112154 
     
    114156   { 
    115157      StdOStringStream oss; 
    116       oss << "< " << CContext::GetName() 
     158      oss << "<" << CContext::GetName() 
    117159          << " id=\"" << this->getId() << "\" " 
    118160          << SuperClassAttribute::toString() << ">" << std::endl; 
     
    124166      { 
    125167 
    126    #define DECLARE_NODE(Name_, name_)    \ 
    127       if (CObjectFactory::HasObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())) \ 
     168#define DECLARE_NODE(Name_, name_)    \ 
     169   if (CObjectFactory::HasObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())) \ 
    128170   oss << *CObjectFactory::GetObject<C##Name_##Definition>(C##Name_##Definition::GetDefName()) << std::endl; 
    129    #define DECLARE_NODE_PAR(Name_, name_) 
    130    #include "node_type.conf" 
    131  
    132       } 
    133  
    134       oss << "</ " << CContext::GetName() << " >"; 
     171#define DECLARE_NODE_PAR(Name_, name_) 
     172#include "node_type.conf" 
     173 
     174      } 
     175 
     176      oss << "</" << CContext::GetName() << " >"; 
    135177 
    136178      return (oss.str()); 
     
    141183   void CContext::solveDescInheritance(const CAttributeMap * const UNUSED(parent)) 
    142184   { 
    143    #define DECLARE_NODE(Name_, name_)    \ 
    144       if (CObjectFactory::HasObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())) \ 
     185#define DECLARE_NODE(Name_, name_)    \ 
     186   if (CObjectFactory::HasObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())) \ 
    145187   CObjectFactory::GetObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())->solveDescInheritance(); 
    146    #define DECLARE_NODE_PAR(Name_, name_) 
    147    #include "node_type.conf" 
     188#define DECLARE_NODE_PAR(Name_, name_) 
     189#include "node_type.conf" 
    148190   } 
    149191 
     
    152194   bool CContext::hasChild(void) const 
    153195   { 
    154       return (false || 
    155    #define DECLARE_NODE(Name_, name_)    \ 
    156       CObjectFactory::HasObject<C##Name_##Definition>  (C##Name_##Definition::GetDefName())   || 
    157    #define DECLARE_NODE_PAR(Name_, name_) 
    158    #include "node_type.conf" 
     196      return ( 
     197#define DECLARE_NODE(Name_, name_)    \ 
     198   CObjectFactory::HasObject<C##Name_##Definition>  (C##Name_##Definition::GetDefName())   || 
     199#define DECLARE_NODE_PAR(Name_, name_) 
     200#include "node_type.conf" 
    159201      false); 
    160    } 
     202} 
    161203 
    162204   //---------------------------------------------------------------- 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/context.hpp

    r168 r173  
    2020   // Declare/Define CFileAttribute 
    2121   BEGIN_DECLARE_ATTRIBUTE_MAP(CContext) 
    22    #include "context_attribute.conf" 
     22include "context_attribute.conf" 
    2323   END_DECLARE_ATTRIBUTE_MAP(CContext) 
    2424 
     
    7373 
    7474         virtual StdString toString(void) const; 
     75         virtual void toBinary  (StdOStream & os) const; 
     76         virtual void fromBinary(StdIStream & is); 
    7577 
    7678   }; // class CContext 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.hpp

    r168 r173  
    2222   // Declare/Define CDomainAttribute 
    2323   BEGIN_DECLARE_ATTRIBUTE_MAP(CDomain) 
    24    #include "domain_attribute.conf" 
     24include "domain_attribute.conf" 
    2525   END_DECLARE_ATTRIBUTE_MAP(CDomain) 
    2626 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/field.hpp

    r168 r173  
    2727   // Declare/Define CFieldAttribute 
    2828   BEGIN_DECLARE_ATTRIBUTE_MAP(CField) 
    29    #include "field_attribute.conf" 
     29include "field_attribute.conf" 
    3030   END_DECLARE_ATTRIBUTE_MAP(CField) 
    3131 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/file.cpp

    r168 r173  
    138138      StdOStringStream oss; 
    139139 
    140       oss << "< " << CFile::GetName() << " "; 
     140      oss << "<" << CFile::GetName() << " "; 
    141141      if (this->hasId()) 
    142142         oss << " id=\"" << this->getId() << "\" "; 
     
    144144      if (this->getVirtualFieldGroup().get() != NULL) 
    145145         oss << *this->getVirtualFieldGroup() << std::endl; 
    146       oss << "</ " << CFile::GetName() << " >"; 
     146      oss << "</" << CFile::GetName() << " >"; 
    147147      return (oss.str()); 
    148148   } 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/file.hpp

    r168 r173  
    2222   // Declare/Define CFileAttribute 
    2323   BEGIN_DECLARE_ATTRIBUTE_MAP(CFile) 
    24    #include "file_attribute.conf" 
     24include "file_attribute.conf" 
    2525   END_DECLARE_ATTRIBUTE_MAP(CFile) 
    2626 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.hpp

    r169 r173  
    2323   // Declare/Define CGridAttribute 
    2424   BEGIN_DECLARE_ATTRIBUTE_MAP(CGrid) 
    25    #include "grid_attribute.conf" 
     25include "grid_attribute.conf" 
    2626   END_DECLARE_ATTRIBUTE_MAP(CGrid) 
    2727 
  • XMLIO_V2/dev/dev_rv/src/xmlio/object_factory_impl.hpp

    r152 r173  
    8585      } 
    8686      else if (CObjectFactory::HasObject<U>(id)) 
     87      { 
    8788         return (CObjectFactory::GetObject<U>(id)); 
     89      } 
    8890      else 
    8991      { 
  • XMLIO_V2/dev/dev_rv/src/xmlio/object_template_impl.hpp

    r172 r173  
    5656   { 
    5757      StdOStringStream oss; 
    58       oss << "< " << T::GetName(); 
     58      oss << "<" << T::GetName(); 
    5959      if (this->hasId()) 
    6060         oss << " id=\"" << this->getId() << "\""; 
  • XMLIO_V2/dev/dev_rv/src/xmlio/xml_parser.cpp

    r152 r173  
    5353 
    5454                  if (attributes.end() == attributes.find("id")) 
    55                   {  DEBUG("Le context ne sera pas traité car il n'est pas identifié !"); 
    56                      continue; } 
     55                  {   
     56                     DEBUG("Le context ne sera pas traité car il n'est pas identifié !"); 
     57                     continue;  
     58                  } 
    5759 
    5860                  CObjectFactory::SetCurrentContextId(attributes["id"]); 
    5961                  CGroupFactory::SetCurrentContextId(attributes["id"]); 
    6062 
    61                   if(CObjectFactory::HasObject<tree::CContext>(attributes["id"])) 
    62                   {  DEBUG("Le context ne sera pas traité car il existe déjà un autre context possédant le même nom !"); 
    63                      continue; } 
     63                  bool hasctxt = CObjectFactory::HasObject<tree::CContext>(attributes["id"]); 
     64 
     65                  if(hasctxt) 
     66                  {   
     67                     DEBUG("Le context ne sera pas traité car " 
     68                           << "il existe déjà un autre context possédant le même nom !"); 
     69                     continue;  
     70                  } 
    6471 
    6572                  boost::shared_ptr<tree::CContext> context = 
    6673                     CObjectFactory::CreateObject<tree::CContext>(attributes["id"]); 
    67                   CGroupFactory::AddChild(group_context, context); 
     74                  if (!hasctxt) CGroupFactory::AddChild(group_context, context); 
    6875                  context->parse(node); 
    6976 
Note: See TracChangeset for help on using the changeset viewer.