| 632 | } |
| 633 | |
| 634 | int |
| 635 | XmlFileStream::write(Vector &data) |
| 636 | { |
| 637 | if (fileOpen == 0) |
| 638 | this->open(); |
| 639 | |
| 640 | // |
| 641 | // if not parallel, just write the data |
| 642 | // |
| 643 | |
| 644 | if (sendSelfCount == 0) { |
| 645 | numDataRows++; |
| 646 | |
| 647 | if (attributeMode == true) { |
| 648 | theFile << ">\n"; |
| 649 | attributeMode = false; |
| 650 | numIndent++; |
| 651 | } |
| 652 | |
| 653 | this->indent(); |
| 654 | (*this) << data; |
| 655 | return 0; |
| 656 | } |
| 657 | |
| 658 | // |
| 659 | // otherwise parallel |
| 660 | // |
| 661 | |
| 662 | |
| 663 | // |
| 664 | // process xml info in the files |
| 665 | // |
| 666 | |
| 667 | |
| 668 | // |
| 669 | // send data if not p0 |
| 670 | |
| 671 | if (sendSelfCount < 0) { |
| 672 | if (data.Size() != 0) { |
| 673 | theChannels[0]->sendVector(0, 0, data); |
| 674 | return 0; |
| 675 | } else { |
| 676 | return 0; |
| 677 | } |
| 678 | } |
| 679 | |
| 680 | // |
| 681 | // if p0 recv the data & write it out sorted |
| 682 | // |
| 683 | |
| 684 | // recv data |
| 685 | |
| 686 | numDataRows++; |
| 687 | |
| 688 | if (attributeMode == true) { |
| 689 | theFile << ">\n"; |
| 690 | attributeMode = false; |
| 691 | numIndent++; |
no test coverage detected