Changeset 775 for XIOS/trunk/src/attribute_array_impl.hpp
- Timestamp:
- 11/02/15 11:46:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/attribute_array_impl.hpp
r501 r775 7 7 #include "attribute_array.hpp" 8 8 9 9 10 10 namespace xios 11 11 { … … 47 47 inheritedValue.reset() ; 48 48 } 49 49 50 50 template <typename T_numtype, int N_rank> 51 51 CArray<T_numtype,N_rank> CAttributeArray<T_numtype, N_rank>::getValue(void) const … … 65 65 { 66 66 this->set(dynamic_cast<const CAttributeArray<T_numtype,N_rank>& >(attr)) ; 67 } 67 } 68 68 69 69 template <typename T_numtype, int N_rank> … … 71 71 { 72 72 this->setValue(attr) ; 73 } 74 75 73 } 74 75 76 76 template <typename T_numtype, int N_rank> 77 77 void CAttributeArray<T_numtype,N_rank>::setInheritedValue(const CAttribute& attr) 78 78 { 79 79 this->setInheritedValue(dynamic_cast<const CAttributeArray<T_numtype,N_rank>& >(attr)) ; 80 } 80 } 81 81 82 82 template <typename T_numtype, int N_rank> 83 83 void CAttributeArray<T_numtype,N_rank>::setInheritedValue(const CAttributeArray& attr) 84 84 { 85 if (this->isEmpty() && attr.hasInheritedValue()) 85 if (this->isEmpty() && attr.hasInheritedValue()) 86 86 { 87 87 inheritedValue.resize(attr.shape()) ; 88 88 inheritedValue=attr ; 89 89 } 90 } 90 } 91 91 92 92 template <typename T_numtype, int N_rank> … … 95 95 if (this->isEmpty()) return inheritedValue.copy() ; 96 96 else return getValue() ; 97 } 98 97 } 98 99 99 template <typename T_numtype, int N_rank> 100 100 bool CAttributeArray<T_numtype,N_rank>::hasInheritedValue(void) const 101 101 { 102 102 return !this->isEmpty() || !inheritedValue.isEmpty() ; 103 } 104 103 } 104 105 105 106 106 template <typename T_numtype, int N_rank> … … 133 133 void CAttributeArray<T_numtype, N_rank>::generateCInterface(ostream& oss,const string& className) 134 134 { 135 CInterface::AttributeCInterface<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 135 if (this->isAttributePublic()) 136 CInterface::AttributeCInterface<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 136 137 } 137 138 138 139 template <typename T_numtype, int N_rank> 139 140 void CAttributeArray<T_numtype, N_rank>::generateFortran2003Interface(ostream& oss,const string& className) 140 141 { 141 CInterface::AttributeFortran2003Interface<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 142 if (this->isAttributePublic()) 143 CInterface::AttributeFortran2003Interface<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 142 144 } 143 145 144 146 template <typename T_numtype, int N_rank> 145 147 void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceDeclaration_(ostream& oss,const string& className) 146 148 { 147 CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()+"_") ; 149 if (this->isAttributePublic()) 150 CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()+"_") ; 148 151 } 149 152 150 153 template <typename T_numtype, int N_rank> 151 154 void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceBody_(ostream& oss,const string& className) 152 155 { 153 CInterface::AttributeFortranInterfaceBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 156 if (this->isAttributePublic()) 157 CInterface::AttributeFortranInterfaceBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 154 158 } 155 159 … … 157 161 void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceDeclaration(ostream& oss,const string& className) 158 162 { 159 CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 163 if (this->isAttributePublic()) 164 CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 160 165 } 161 166 162 167 template <typename T_numtype, int N_rank> 163 168 void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) 164 169 { 165 CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()+"_") ; 170 if (this->isAttributePublic()) 171 CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()+"_") ; 166 172 } 167 173 168 174 template <typename T_numtype, int N_rank> 169 175 void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceGetBody_(ostream& oss,const string& className) 170 176 { 171 CInterface::AttributeFortranInterfaceGetBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 177 if (this->isAttributePublic()) 178 CInterface::AttributeFortranInterfaceGetBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 172 179 } 173 180 … … 175 182 void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) 176 183 { 177 CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 184 if (this->isAttributePublic()) 185 CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 178 186 } 179 187 } // namespace xios
Note: See TracChangeset
for help on using the changeset viewer.