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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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) 
Note: See TracChangeset for help on using the changeset viewer.