Ignore:
Timestamp:
10/11/10 16:10:10 (14 years ago)
Author:
hozdoba
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp

    r125 r128  
    1818         CField(const string& _id) : ObjectTemplate<CField>(_id), FieldAttribut(), lastStored(NULL), grid(NULL), file(NULL) 
    1919         {/* Ne rien faire de plus */} 
    20  
    21          static string GetName(void) { return ("field"); } 
    22          static string GetDefName(void)  { return (CField::GetName()); } 
    2320 
    2421         inline void solveGridRef(void) ; 
     
    4845         void setRelFile(CFile* _file) { file = _file; } 
    4946 
     47      public: /* virtual */ 
     48 
    5049         virtual CField* getReference(void) const 
    5150         { 
     
    5958         virtual ~CField(void) 
    6059         { if(lastStored !=  NULL) delete lastStored; } 
     60 
     61      public: /* static */ 
     62 
     63         static string GetName(void) { return ("field"); } 
     64         static string GetDefName(void)  { return (CField::GetName()); } 
    6165 
    6266      private : 
     
    7579DECLARE_GROUP(Field) 
    7680 
     81/* Pour la gestion des références aux groupes de champs */ 
     82namespace XMLIOSERVER 
     83{ 
     84   template <> 
     85      CField& GroupTemplate<CField, FieldAttribut>::createChildRef(const CField* const _ori) 
     86   { 
     87      if (!_ori->hasId()) 
     88         throw (new XMLIOUndefinedValueException("Impossible de créer une référence à un élément sans identifiant !")); 
     89 
     90      CField& obj = *ObjectTemplate<CField>::CreateObject(); 
     91      obj.field_ref = _ori->getId(); 
     92      childList.addObject(&obj); 
     93      return (obj); 
     94   } 
     95 
     96   template <> 
     97      void GroupTemplate<CField, FieldAttribut>::solveRefInheritance (void) 
     98   { 
     99      std::vector<CField*> _allf ; 
     100 
     101      if(!group_ref.hasValue() || (GetName().compare("field_group") != 0)) return; 
     102      if (!GroupTemplate<CField, FieldAttribut>::HasObject(group_ref)) 
     103      { WARNING("Référence invalide sur l'objet "+GetName()+" nommé \""+((string)group_ref)+"\""); return; } 
     104 
     105      const GroupTemplate<CField, FieldAttribut>* const gref 
     106               = GroupTemplate<CField, FieldAttribut>::GetObject(group_ref); 
     107 
     108      gref->getAllChildren(_allf); 
     109      std::vector<CField*>::iterator it ; 
     110      for ( it = _allf.begin() ; it != _allf.end(); it++ ) 
     111         this->createChildRef(*it); 
     112   } 
     113 
     114 
     115} // namespace XMLIOSERVER 
     116 
    77117#endif // __FIELD__ 
Note: See TracChangeset for help on using the changeset viewer.