Ignore:
Timestamp:
06/06/17 17:58:16 (7 years ago)
Author:
oabramkina
Message:

Two server levels: merging with trunk r1137.
There are bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/attribute_template_impl.hpp

    r778 r1158  
    7171         T CAttributeTemplate<T>::getValue(void) const 
    7272      { 
    73          return CType<T>::get() ; 
    74 /* 
    75          if (SuperClass::isEmpty()) 
    76          { 
    77             ERROR("T CAttributeTemplate<T>::getValue(void) const", 
    78                   << "[ id = " << this->getId() << "]" 
    79                   << " L'attribut est requis mais n'est pas défini !"); 
    80           } 
    81          return (SuperClass::getValue<T>()); 
     73        return CType<T>::get() ; 
     74/* 
     75        if (SuperClass::isEmpty()) 
     76        { 
     77           ERROR("T CAttributeTemplate<T>::getValue(void) const", 
     78                 << "[ id = " << this->getId() << "]" 
     79                 << " L'attribut est requis mais n'est pas défini !"); 
     80         } 
     81        return (SuperClass::getValue<T>()); 
    8282*/ 
    8383      } 
     
    125125    void CAttributeTemplate<T>::setInheritedValue(const CAttributeTemplate& attr) 
    126126    { 
    127       if (this->isEmpty() && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()) ; 
     127      if (this->isEmpty() && _canInherite && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()) ; 
    128128    } 
    129129 
     
    139139    { 
    140140      return !this->isEmpty() || !inheritedValue.isEmpty() ; 
     141    } 
     142 
     143    template <class T> 
     144    bool CAttributeTemplate<T>::isEqual(const CAttribute& attr) 
     145    { 
     146      const CAttributeTemplate<T>& tmp = dynamic_cast<const CAttributeTemplate<T>& >(attr); 
     147      return this->isEqual_(tmp); 
     148    } 
     149 
     150    template <class T> 
     151    bool CAttributeTemplate<T>::isEqual_(const CAttributeTemplate& attr) 
     152    { 
     153      if ((!this->hasInheritedValue() && !attr.hasInheritedValue())) 
     154          return true; 
     155      if (this->hasInheritedValue() && attr.hasInheritedValue()) 
     156          return (this->getInheritedValue() == attr.getInheritedValue()); 
     157      else  
     158        return false; 
    141159    } 
    142160 
Note: See TracChangeset for help on using the changeset viewer.