Changeset 775 for XIOS/trunk/src/attribute_template_impl.hpp
- Timestamp:
- 11/02/15 11:46:25 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/attribute_template_impl.hpp
r591 r775 8 8 #include "attribute_template.hpp" 9 9 10 10 11 11 namespace xios 12 12 { … … 54 54 template <class T> 55 55 CAttributeTemplate<T>::~CAttributeTemplate(void) 56 { 56 { 57 57 // this->CType<T>::reset() ; 58 58 // this->clear(); … … 108 108 { 109 109 this->set(dynamic_cast<const CAttributeTemplate<T>& >(attr)) ; 110 } 110 } 111 111 112 112 template <class T> … … 114 114 { 115 115 CType<T>::set(attr) ; 116 } 116 } 117 117 118 118 template <class T> … … 120 120 { 121 121 this->setInheritedValue(dynamic_cast<const CAttributeTemplate<T>& >(attr)) ; 122 } 122 } 123 123 124 124 template <class T> … … 126 126 { 127 127 if (this->isEmpty() && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()) ; 128 } 128 } 129 129 130 130 template <class T> … … 133 133 if (this->isEmpty()) return inheritedValue.get() ; 134 134 else return getValue() ; 135 } 136 135 } 136 137 137 template <class T> 138 138 bool CAttributeTemplate<T>::hasInheritedValue(void) const 139 139 { 140 140 return !this->isEmpty() || !inheritedValue.isEmpty() ; 141 } 142 141 } 142 143 143 //--------------------------------------------------------------- 144 144 … … 188 188 { 189 189 return CType<T>::toBuffer(buffer) ; 190 /* 190 /* 191 191 if (isEmpty()) return buffer.put(true) ; 192 192 else … … 205 205 { 206 206 return CType<T>::fromBuffer(buffer) ; 207 /* 207 /* 208 208 bool empty ; 209 209 bool ret=true ; 210 210 ret&=buffer.get(empty) ; 211 if (empty) 211 if (empty) 212 212 { 213 213 clear() ; … … 230 230 template <class T> 231 231 size_t CAttributeTemplate<T>::size(void) const 232 { 232 { 233 233 return CType<T>::size() ;*/ 234 /* 234 /* 235 235 if (isEmpty()) return sizeof(bool) ; 236 236 else … … 245 245 void CAttributeTemplate<T>::generateCInterface(ostream& oss,const string& className) 246 246 { 247 CInterface::AttributeCInterface<T>(oss, className, this->getName()) ; 247 if (this->isAttributePublic()) 248 CInterface::AttributeCInterface<T>(oss, className, this->getName()) ; 248 249 // CInterface::AttributeIsDefinedCInterface(oss, className, this->getName()) ; 249 250 } 250 251 251 252 template <typename T> 252 253 void CAttributeTemplate<T>::generateFortran2003Interface(ostream& oss,const string& className) 253 254 { 254 CInterface::AttributeFortran2003Interface<T>(oss, className, this->getName()) ; 255 if (this->isAttributePublic()) 256 CInterface::AttributeFortran2003Interface<T>(oss, className, this->getName()) ; 255 257 // CInterface::AttributeIsDefinedFortran2003Interface(oss, className, this->getName()) ; 256 258 } 257 259 258 260 template <typename T> 259 261 void CAttributeTemplate<T>::generateFortranInterfaceDeclaration_(ostream& oss,const string& className) 260 262 { 261 CInterface::AttributeFortranInterfaceDeclaration<T>(oss, className, this->getName()+"_") ; 262 } 263 263 if (this->isAttributePublic()) 264 CInterface::AttributeFortranInterfaceDeclaration<T>(oss, className, this->getName()+"_") ; 265 } 266 264 267 template <typename T> 265 268 void CAttributeTemplate<T>::generateFortranInterfaceBody_(ostream& oss,const string& className) 266 269 { 267 CInterface::AttributeFortranInterfaceBody<T>(oss, className, this->getName()) ; 270 if (this->isAttributePublic()) 271 CInterface::AttributeFortranInterfaceBody<T>(oss, className, this->getName()) ; 268 272 } 269 273 … … 271 275 void CAttributeTemplate<T>::generateFortranInterfaceDeclaration(ostream& oss,const string& className) 272 276 { 273 CInterface::AttributeFortranInterfaceDeclaration<T>(oss, className, this->getName()) ; 274 } 275 277 if (this->isAttributePublic()) 278 CInterface::AttributeFortranInterfaceDeclaration<T>(oss, className, this->getName()) ; 279 } 280 276 281 template <typename T> 277 282 void CAttributeTemplate<T>::generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) 278 283 { 279 CInterface::AttributeFortranInterfaceGetDeclaration<T>(oss, className, this->getName()+"_") ; 280 } 281 282 284 if (this->isAttributePublic()) 285 CInterface::AttributeFortranInterfaceGetDeclaration<T>(oss, className, this->getName()+"_") ; 286 } 287 288 283 289 template <typename T> 284 290 void CAttributeTemplate<T>::generateFortranInterfaceGetBody_(ostream& oss,const string& className) 285 291 { 286 CInterface::AttributeFortranInterfaceGetBody<T>(oss, className, this->getName()) ; 292 if (this->isAttributePublic()) 293 CInterface::AttributeFortranInterfaceGetBody<T>(oss, className, this->getName()) ; 287 294 } 288 295 … … 290 297 void CAttributeTemplate<T>::generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) 291 298 { 292 CInterface::AttributeFortranInterfaceGetDeclaration<T>(oss, className, this->getName()) ; 293 } 294 295 296 /* 297 //--------------------------------------------------------------- 298 299 // Spécialisations des templates pour la fonction [toString] 299 if (this->isAttributePublic()) 300 CInterface::AttributeFortranInterfaceGetDeclaration<T>(oss, className, this->getName()) ; 301 } 302 303 304 /* 305 //--------------------------------------------------------------- 306 307 // Spécialisations des templates pour la fonction [toString] 300 308 301 309 template <> … … 304 312 //--------------------------------------------------------------- 305 313 306 // Spécialisations des templates pour la fonction [fromString] 314 // Spécialisations des templates pour la fonction [fromString] 307 315 308 316 template <> // Chaîne de caractÚres. … … 333 341 template <> // Booléen 334 342 void CAttributeTemplate<bool>::toBinary(StdOStream & os) const; 335 343 336 344 template <> // Double 337 345 void CAttributeTemplate<double>::toBinary(StdOStream & os) const; … … 349 357 template <> // Booléen 350 358 void CAttributeTemplate<bool>::fromBinary(StdIStream & is); 351 359 352 360 template <> // Double 353 361 void CAttributeTemplate<double>::fromBinary(StdIStream & is); 354 362 355 363 ///-------------------------------------------------------------- 356 */ 364 */ 357 365 } // namespace xios 358 366
Note: See TracChangeset
for help on using the changeset viewer.