Changeset 778
- Timestamp:
- 11/04/15 15:50:19 (8 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/attribute.hpp
r591 r778 52 52 // virtual void toBinary (StdOStream & os) const = 0; 53 53 // virtual void fromBinary(StdIStream & is) = 0; 54 55 //! Returns true if and only if the attribute should be publicly exposed in the API 56 virtual bool isPublic() const { return true; } 54 57 55 58 virtual void generateCInterface(ostream& oss, const string& className) = 0 ; -
XIOS/trunk/src/attribute_array.hpp
r775 r778 15 15 /// ////////////////////// Déclarations ////////////////////// /// 16 16 template <typename T_numtype, int N_rank> 17 class CAttributeArray : public CAttribute, public CArray<T_numtype, N_rank> , public PublicAttributes17 class CAttributeArray : public CAttribute, public CArray<T_numtype, N_rank> 18 18 { 19 19 public : -
XIOS/trunk/src/attribute_array_impl.hpp
r775 r778 133 133 void CAttributeArray<T_numtype, N_rank>::generateCInterface(ostream& oss,const string& className) 134 134 { 135 if (this->isAttributePublic()) 136 CInterface::AttributeCInterface<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 135 CInterface::AttributeCInterface<CArray<T_numtype, N_rank> >(oss, className, this->getName()); 137 136 } 138 137 … … 140 139 void CAttributeArray<T_numtype, N_rank>::generateFortran2003Interface(ostream& oss,const string& className) 141 140 { 142 if (this->isAttributePublic()) 143 CInterface::AttributeFortran2003Interface<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 141 CInterface::AttributeFortran2003Interface<CArray<T_numtype, N_rank> >(oss, className, this->getName()); 144 142 } 145 143 … … 147 145 void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceDeclaration_(ostream& oss,const string& className) 148 146 { 149 if (this->isAttributePublic()) 150 CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()+"_") ; 147 CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName() + "_"); 151 148 } 152 149 … … 154 151 void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceBody_(ostream& oss,const string& className) 155 152 { 156 if (this->isAttributePublic()) 157 CInterface::AttributeFortranInterfaceBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 153 CInterface::AttributeFortranInterfaceBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()); 158 154 } 159 155 … … 161 157 void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceDeclaration(ostream& oss,const string& className) 162 158 { 163 if (this->isAttributePublic()) 164 CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 159 CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()); 165 160 } 166 161 … … 168 163 void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) 169 164 { 170 if (this->isAttributePublic()) 171 CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()+"_") ; 165 CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName() + "_"); 172 166 } 173 167 … … 175 169 void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceGetBody_(ostream& oss,const string& className) 176 170 { 177 if (this->isAttributePublic()) 178 CInterface::AttributeFortranInterfaceGetBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 171 CInterface::AttributeFortranInterfaceGetBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()); 179 172 } 180 173 … … 182 175 void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) 183 176 { 184 if (this->isAttributePublic()) 185 CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 177 CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()); 186 178 } 187 179 } // namespace xios -
XIOS/trunk/src/attribute_map.cpp
r649 r778 226 226 for (; it != end; it++) 227 227 { 228 oss << std::endl << iendl; 229 it->second->generateCInterface(oss, className); 230 oss << iendl; 231 it->second->generateCInterfaceIsDefined(oss, className); 228 if (it->second->isPublic()) 229 { 230 oss << std::endl << iendl; 231 it->second->generateCInterface(oss, className); 232 oss << iendl; 233 it->second->generateCInterfaceIsDefined(oss, className); 234 } 232 235 } 233 236 } … … 238 241 for (; it != end; it++) 239 242 { 240 oss << std::endl << iendl; 241 it->second->generateFortran2003Interface(oss, className); 242 oss << iendl; 243 it->second->generateFortran2003InterfaceIsDefined(oss, className); 243 if (it->second->isPublic()) 244 { 245 oss << std::endl << iendl; 246 it->second->generateFortran2003Interface(oss, className); 247 oss << iendl; 248 it->second->generateFortran2003InterfaceIsDefined(oss, className); 249 } 244 250 } 245 251 } … … 258 264 for (it = begin; it != end; it++) 259 265 { 260 oss << ", " << it->second->getName() << "_"; 261 if (oss.tellp() - startPos > 90) 262 { 263 oss << " &" << iendl; 264 startPos = oss.tellp(); 266 if (it->second->isPublic()) 267 { 268 oss << ", " << it->second->getName() << "_"; 269 if (oss.tellp() - startPos > 90) 270 { 271 oss << " &" << iendl; 272 startPos = oss.tellp(); 273 } 265 274 } 266 275 } … … 274 283 for (it = begin; it != end; it++) 275 284 { 276 oss << iendl; 277 it->second->generateFortranInterfaceDeclaration_(oss, className); 278 } 279 280 for (it = begin; it != end; it++) 281 { 282 oss << std::endl << iendl; 283 it->second->generateFortranInterfaceBody_(oss, className); 285 if (it->second->isPublic()) 286 { 287 oss << iendl; 288 it->second->generateFortranInterfaceDeclaration_(oss, className); 289 } 290 } 291 292 for (it = begin; it != end; it++) 293 { 294 if (it->second->isPublic()) 295 { 296 oss << std::endl << iendl; 297 it->second->generateFortranInterfaceBody_(oss, className); 298 } 284 299 } 285 300 … … 299 314 for (it = begin; it != end; it++) 300 315 { 301 oss << ", " << it->second->getName() << "_"; 302 if (oss.tellp() - startPos > 90) 303 { 304 oss << " &" << iendl; 305 startPos = oss.tellp(); 316 if (it->second->isPublic()) 317 { 318 oss << ", " << it->second->getName() << "_"; 319 if (oss.tellp() - startPos > 90) 320 { 321 oss << " &" << iendl; 322 startPos = oss.tellp(); 323 } 306 324 } 307 325 } … … 315 333 for (it = begin; it != end; it++) 316 334 { 317 oss << iendl; 318 it->second->generateFortranInterfaceGetDeclaration_(oss, className); 319 } 320 321 for (it = begin; it != end; it++) 322 { 323 oss << std::endl << iendl; 324 it->second->generateFortranInterfaceGetBody_(oss, className); 335 if (it->second->isPublic()) 336 { 337 oss << iendl; 338 it->second->generateFortranInterfaceGetDeclaration_(oss, className); 339 } 340 } 341 342 for (it = begin; it != end; it++) 343 { 344 if (it->second->isPublic()) 345 { 346 oss << std::endl << iendl; 347 it->second->generateFortranInterfaceGetBody_(oss, className); 348 } 325 349 } 326 350 … … 340 364 for (it = begin; it != end; it++) 341 365 { 342 oss << ", " << it->second->getName() << "_"; 343 if (oss.tellp() - startPos > 90) 344 { 345 oss << " &" << iendl; 346 startPos = oss.tellp(); 366 if (it->second->isPublic()) 367 { 368 oss << ", " << it->second->getName() << "_"; 369 if (oss.tellp() - startPos > 90) 370 { 371 oss << " &" << iendl; 372 startPos = oss.tellp(); 373 } 347 374 } 348 375 } … … 356 383 for (it = begin; it != end; it++) 357 384 { 358 oss << iendl; 359 it->second->generateFortranInterfaceIsDefinedDeclaration_(oss, className); 360 } 361 362 for (it = begin; it != end; it++) 363 { 364 oss << std::endl << iendl; 365 it->second->generateFortranInterfaceIsDefinedBody_(oss, className); 385 if (it->second->isPublic()) 386 { 387 oss << iendl; 388 it->second->generateFortranInterfaceIsDefinedDeclaration_(oss, className); 389 } 390 } 391 392 for (it = begin; it != end; it++) 393 { 394 if (it->second->isPublic()) 395 { 396 oss << std::endl << iendl; 397 it->second->generateFortranInterfaceIsDefinedBody_(oss, className); 398 } 366 399 } 367 400 … … 381 414 for (it = begin; it != end; it++) 382 415 { 383 oss << ", " << it->second->getName(); 384 if (oss.tellp() - startPos > 90) 385 { 386 oss << " &" << iendl; 387 startPos = oss.tellp(); 416 if (it->second->isPublic()) 417 { 418 oss << ", " << it->second->getName(); 419 if (oss.tellp() - startPos > 90) 420 { 421 oss << " &" << iendl; 422 startPos = oss.tellp(); 423 } 388 424 } 389 425 } … … 397 433 for (it = begin; it != end; it++) 398 434 { 399 oss << iendl; 400 it->second->generateFortranInterfaceDeclaration(oss, className); 435 if (it->second->isPublic()) 436 { 437 oss << iendl; 438 it->second->generateFortranInterfaceDeclaration(oss, className); 439 } 401 440 } 402 441 … … 410 449 for (it = begin; it != end; it++) 411 450 { 412 oss << ", " << it->second->getName(); 413 if (oss.tellp() - startPos > 90) 414 { 415 oss << " &" << iendl; 416 startPos = oss.tellp(); 451 if (it->second->isPublic()) 452 { 453 oss << ", " << it->second->getName(); 454 if (oss.tellp() - startPos > 90) 455 { 456 oss << " &" << iendl; 457 startPos = oss.tellp(); 458 } 417 459 } 418 460 } … … 434 476 for (it = begin; it != end; it++) 435 477 { 436 oss << ", " << it->second->getName(); 437 if (oss.tellp() - startPos > 90) 438 { 439 oss << " &" << iendl; 440 startPos = oss.tellp(); 478 if (it->second->isPublic()) 479 { 480 oss << ", " << it->second->getName(); 481 if (oss.tellp() - startPos > 90) 482 { 483 oss << " &" << iendl; 484 startPos = oss.tellp(); 485 } 441 486 } 442 487 } … … 450 495 for (it = begin; it != end; it++) 451 496 { 452 oss << iendl; 453 it->second->generateFortranInterfaceGetDeclaration(oss, className); 497 if (it->second->isPublic()) 498 { 499 oss << iendl; 500 it->second->generateFortranInterfaceGetDeclaration(oss, className); 501 } 454 502 } 455 503 … … 463 511 for (it = begin; it != end; it++) 464 512 { 465 oss << ", " << it->second->getName(); 466 if (oss.tellp() - startPos > 90) 467 { 468 oss << " &" << iendl; 469 startPos = oss.tellp(); 513 if (it->second->isPublic()) 514 { 515 oss << ", " << it->second->getName(); 516 if (oss.tellp() - startPos > 90) 517 { 518 oss << " &" << iendl; 519 startPos = oss.tellp(); 520 } 470 521 } 471 522 } … … 487 538 for (it = begin; it != end; it++) 488 539 { 489 oss << ", " << it->second->getName(); 490 if (oss.tellp() - startPos > 90) 491 { 492 oss << " &" << iendl; 493 startPos = oss.tellp(); 540 if (it->second->isPublic()) 541 { 542 oss << ", " << it->second->getName(); 543 if (oss.tellp() - startPos > 90) 544 { 545 oss << " &" << iendl; 546 startPos = oss.tellp(); 547 } 494 548 } 495 549 } … … 503 557 for (it = begin; it != end; it++) 504 558 { 505 oss << iendl; 506 it->second->generateFortranInterfaceIsDefinedDeclaration(oss, className); 559 if (it->second->isPublic()) 560 { 561 oss << iendl; 562 it->second->generateFortranInterfaceIsDefinedDeclaration(oss, className); 563 } 507 564 } 508 565 … … 516 573 for (it = begin; it != end; it++) 517 574 { 518 oss << ", " << it->second->getName(); 519 if (oss.tellp() - startPos > 90) 520 { 521 oss << " &" << iendl; 522 startPos = oss.tellp(); 575 if (it->second->isPublic()) 576 { 577 oss << ", " << it->second->getName(); 578 if (oss.tellp() - startPos > 90) 579 { 580 oss << " &" << iendl; 581 startPos = oss.tellp(); 582 } 523 583 } 524 584 } … … 540 600 for (it = begin; it != end; it++) 541 601 { 542 oss << ", " << it->second->getName(); 543 if (oss.tellp() - startPos > 90) 544 { 545 oss << " &" << iendl; 546 startPos = oss.tellp(); 602 if (it->second->isPublic()) 603 { 604 oss << ", " << it->second->getName(); 605 if (oss.tellp() - startPos > 90) 606 { 607 oss << " &" << iendl; 608 startPos = oss.tellp(); 609 } 547 610 } 548 611 } … … 558 621 for (it = begin; it != end; it++) 559 622 { 560 oss << iendl; 561 it->second->generateFortranInterfaceDeclaration(oss, className); 623 if (it->second->isPublic()) 624 { 625 oss << iendl; 626 it->second->generateFortranInterfaceDeclaration(oss, className); 627 } 562 628 } 563 629 … … 571 637 for (it = begin; it != end; it++) 572 638 { 573 oss << ", " << it->second->getName(); 574 if (oss.tellp() - startPos > 90) 575 { 576 oss << " &" << iendl; 577 startPos = oss.tellp(); 639 if (it->second->isPublic()) 640 { 641 oss << ", " << it->second->getName(); 642 if (oss.tellp() - startPos > 90) 643 { 644 oss << " &" << iendl; 645 startPos = oss.tellp(); 646 } 578 647 } 579 648 } … … 595 664 for (it = begin; it != end; it++) 596 665 { 597 oss << ", " << it->second->getName(); 598 if (oss.tellp() - startPos > 90) 599 { 600 oss << " &" << iendl; 601 startPos = oss.tellp(); 666 if (it->second->isPublic()) 667 { 668 oss << ", " << it->second->getName(); 669 if (oss.tellp() - startPos > 90) 670 { 671 oss << " &" << iendl; 672 startPos = oss.tellp(); 673 } 602 674 } 603 675 } … … 613 685 for (it = begin; it != end; it++) 614 686 { 615 oss << iendl; 616 it->second->generateFortranInterfaceGetDeclaration(oss, className); 687 if (it->second->isPublic()) 688 { 689 oss << iendl; 690 it->second->generateFortranInterfaceGetDeclaration(oss, className); 691 } 617 692 } 618 693 … … 626 701 for (it = begin; it != end; it++) 627 702 { 628 oss << ", " << it->second->getName(); 629 if (oss.tellp() - startPos > 90) 630 { 631 oss << " &" << iendl; 632 startPos = oss.tellp(); 703 if (it->second->isPublic()) 704 { 705 oss << ", " << it->second->getName(); 706 if (oss.tellp() - startPos > 90) 707 { 708 oss << " &" << iendl; 709 startPos = oss.tellp(); 710 } 633 711 } 634 712 } … … 650 728 for (it = begin; it != end; it++) 651 729 { 652 oss << ", " << it->second->getName(); 653 if (oss.tellp() - startPos > 90) 654 { 655 oss << " &" << iendl; 656 startPos = oss.tellp(); 730 if (it->second->isPublic()) 731 { 732 oss << ", " << it->second->getName(); 733 if (oss.tellp() - startPos > 90) 734 { 735 oss << " &" << iendl; 736 startPos = oss.tellp(); 737 } 657 738 } 658 739 } … … 668 749 for (it = begin; it != end; it++) 669 750 { 670 oss << iendl; 671 it->second->generateFortranInterfaceIsDefinedDeclaration(oss, className); 751 if (it->second->isPublic()) 752 { 753 oss << iendl; 754 it->second->generateFortranInterfaceIsDefinedDeclaration(oss, className); 755 } 672 756 } 673 757 … … 681 765 for (it = begin; it != end; it++) 682 766 { 683 oss << ", " << it->second->getName(); 684 if (oss.tellp() - startPos > 90) 685 { 686 oss << " &" << iendl; 687 startPos = oss.tellp(); 767 if (it->second->isPublic()) 768 { 769 oss << ", " << it->second->getName(); 770 if (oss.tellp() - startPos > 90) 771 { 772 oss << " &" << iendl; 773 startPos = oss.tellp(); 774 } 688 775 } 689 776 } -
XIOS/trunk/src/attribute_template.hpp
r775 r778 18 18 /// ////////////////////// Déclarations ////////////////////// /// 19 19 template <class T> 20 class CAttributeTemplate : public CAttribute, public CType<T> , public PublicAttributes20 class CAttributeTemplate : public CAttribute, public CType<T> 21 21 { 22 22 typedef CAttribute SuperClass; -
XIOS/trunk/src/attribute_template_impl.hpp
r775 r778 245 245 void CAttributeTemplate<T>::generateCInterface(ostream& oss,const string& className) 246 246 { 247 if (this->isAttributePublic()) 248 CInterface::AttributeCInterface<T>(oss, className, this->getName()) ; 249 // CInterface::AttributeIsDefinedCInterface(oss, className, this->getName()) ; 247 CInterface::AttributeCInterface<T>(oss, className, this->getName()); 250 248 } 251 249 … … 253 251 void CAttributeTemplate<T>::generateFortran2003Interface(ostream& oss,const string& className) 254 252 { 255 if (this->isAttributePublic()) 256 CInterface::AttributeFortran2003Interface<T>(oss, className, this->getName()) ; 257 // CInterface::AttributeIsDefinedFortran2003Interface(oss, className, this->getName()) ; 253 CInterface::AttributeFortran2003Interface<T>(oss, className, this->getName()); 258 254 } 259 255 … … 261 257 void CAttributeTemplate<T>::generateFortranInterfaceDeclaration_(ostream& oss,const string& className) 262 258 { 263 if (this->isAttributePublic()) 264 CInterface::AttributeFortranInterfaceDeclaration<T>(oss, className, this->getName()+"_") ; 259 CInterface::AttributeFortranInterfaceDeclaration<T>(oss, className, this->getName() + "_"); 265 260 } 266 261 … … 268 263 void CAttributeTemplate<T>::generateFortranInterfaceBody_(ostream& oss,const string& className) 269 264 { 270 if (this->isAttributePublic()) 271 CInterface::AttributeFortranInterfaceBody<T>(oss, className, this->getName()) ; 265 CInterface::AttributeFortranInterfaceBody<T>(oss, className, this->getName()); 272 266 } 273 267 … … 275 269 void CAttributeTemplate<T>::generateFortranInterfaceDeclaration(ostream& oss,const string& className) 276 270 { 277 if (this->isAttributePublic()) 278 CInterface::AttributeFortranInterfaceDeclaration<T>(oss, className, this->getName()) ; 271 CInterface::AttributeFortranInterfaceDeclaration<T>(oss, className, this->getName()); 279 272 } 280 273 … … 282 275 void CAttributeTemplate<T>::generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) 283 276 { 284 if (this->isAttributePublic()) 285 CInterface::AttributeFortranInterfaceGetDeclaration<T>(oss, className, this->getName()+"_") ; 277 CInterface::AttributeFortranInterfaceGetDeclaration<T>(oss, className, this->getName() + "_"); 286 278 } 287 279 … … 290 282 void CAttributeTemplate<T>::generateFortranInterfaceGetBody_(ostream& oss,const string& className) 291 283 { 292 if (this->isAttributePublic()) 293 CInterface::AttributeFortranInterfaceGetBody<T>(oss, className, this->getName()) ; 284 CInterface::AttributeFortranInterfaceGetBody<T>(oss, className, this->getName()); 294 285 } 295 286 … … 297 288 void CAttributeTemplate<T>::generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) 298 289 { 299 if (this->isAttributePublic()) 300 CInterface::AttributeFortranInterfaceGetDeclaration<T>(oss, className, this->getName()) ; 290 CInterface::AttributeFortranInterfaceGetDeclaration<T>(oss, className, this->getName()); 301 291 } 302 292 -
XIOS/trunk/src/declare_attribute.hpp
r775 r778 27 27 type operator=(const type & value) \ 28 28 { return (CAttributeTemplate<type>::operator=(value)); } \ 29 virtual bool is AttributePublic()\29 virtual bool isPublic() const \ 30 30 { return false; } \ 31 31 virtual ~name##_attr(void) \ … … 48 48 using CAttributeArray<T_num, T_rank>::operator = ; \ 49 49 name##_attr(void) : CAttributeArray<T_num, T_rank> (#name, *CAttributeMap::Current) {} \ 50 virtual bool is AttributePublic()\50 virtual bool isPublic() const \ 51 51 { return false; } \ 52 52 virtual ~name##_attr(void) {} \
Note: See TracChangeset
for help on using the changeset viewer.