Changeset 495 in Sophya for trunk/SophyaPI/PIext/nobjmgr.cc
- Timestamp:
- Oct 21, 1999, 8:58:45 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nobjmgr.cc
r493 r495 684 684 void NamedObjMgr::ReadObj(string const & flnm, string & nobj) 685 685 { 686 PPersist* obj=NULL;686 PPersist* ppobj=NULL; 687 687 bool ok = true; 688 688 #ifdef SANS_EVOLPLANCK 689 689 TRY{ 690 690 PInPersist pis(flnm); 691 obj = PPersistMgr::ReadObject(pis);692 if ( obj == NULL) ok = false;691 ppobj = PPersistMgr::ReadObject(pis); 692 if (ppobj == NULL) ok = false; 693 693 } CATCH(merr) 694 694 { printf("NamedObjMgr::ReadObj()/Error Exception= %ld (%s) \n", 695 695 (long)merr, PeidaExc(merr)); ok = false; } ENDTRY; 696 696 #else 697 try { 698 PInPersist pis(flnm); 699 ppobj = pis.ReadObject(); 700 } 701 catch (IOExc iox) { 702 cerr << "NamedObjMgr::ReadObj()/Error Exception - Msg= " << iox.Msg() << endl; 703 ok = false; 704 } 705 #endif 697 706 if (!ok) return; 698 707 if (nobj.length()<1) nobj = servnobjm->FileName2Name(flnm); 699 AddObj( obj->DataObj(), nobj, true);708 AddObj(ppobj->DataObj(), nobj, true); 700 709 return; 701 710 } … … 713 722 if ( (s.NbTags() < 1) || (num >= s.NbTags()) ) { 714 723 if (num >= 0) { 715 printf("NamedObjMgr::ReadObj(PInPersist, %d) Error! NbTags = %d \n", num, s.NbTags()); 724 cerr << "NamedObjMgr::ReadObj(PInPersist, " << num << " Error! NbTags =" 725 << s.NbTags() << endl; 716 726 return; 717 727 } 728 729 #ifdef SANS_EVOLPLANCK 718 730 TRY { 719 731 obj = PPersistMgr::ReadObject(s); … … 723 735 ok = false; 724 736 } ENDTRY; 737 #else 738 try { 739 obj = s.ReadObject(); 740 } 741 catch (IOExc iox) { 742 cerr << "NamedObjMgr::ReadObj()/Error Exception - Msg= " << iox.Msg() << endl; 743 ok = false; 744 } 745 #endif 746 725 747 if (!ok) return; 726 748 nom = ""; … … 732 754 else { n0 = num; n1 = num+1; } 733 755 for(i=n0; i<n1; i++) { 756 #ifdef SANS_EVOLPLANCK 734 757 key = s.TagKey(i, cid, ln); 735 758 if (ln <= 0) nom = ""; … … 743 766 ok = false; 744 767 } ENDTRY; 768 #else 769 s.GotoTagNum(i); 770 try { 771 obj = s.ReadObject(); 772 char buffnom[64]; 773 sprintf(buffnom,"O%d",i); 774 nom = buffnom; 775 } 776 catch (IOExc iox) { 777 cerr << "NamedObjMgr::ReadObj()/Error Exception - Msg= " << iox.Msg() << endl; 778 ok = false; 779 } 780 #endif 745 781 if (ok) { AddObj(obj->DataObj(), nom, true); nread++; } 746 782 } … … 756 792 757 793 PInPersist* ppin; 794 #ifdef SANS_EVOLPLANCK 758 795 TRY{ 759 796 ppin = new PInPersist(flnm); … … 763 800 { printf("NamedObjMgr::ReadAll()/Error Exception= %ld (%s) \n", 764 801 (long)merr, PeidaExc(merr)); ok = false; } ENDTRY; 765 802 #else 803 try { 804 ppin = new PInPersist(flnm); 805 if (ppin->NbTags() < 1) obj = ppin->ReadObject(); 806 else obj = NULL; 807 } 808 catch (IOExc iox) { 809 cerr << "NamedObjMgr::ReadAll()/Error Exception - Msg= " << iox.Msg() << endl; 810 ok = false; 811 } 812 #endif 766 813 if (!ok) return; 767 814 if (obj) { … … 784 831 #endif 785 832 786 TRY{787 833 // obj = RzReadFits((char*)flnm.c_str(), ImgOffX, ImgOffY, ImgSizX, ImgSizY, ImgBitSgn); 788 834 #ifdef SANS_EVOLPLANCK 835 TRY{ 789 836 obj = RzReadFits((char*)flnm.c_str()); 790 #else791 printf("NamedObjMgr::ReadFITS( NON-Disponible EVOL-PLANCK) \n");792 obj = NULL;793 #endif794 837 if (obj == NULL) ok = false; 795 838 } CATCH(merr) { … … 801 844 AddObj((AnyDataObj*)obj, nobj); 802 845 } 846 #else 847 printf("NamedObjMgr::ReadFITS( NON-Disponible EVOL-PLANCK) \n"); 848 #endif 803 849 return; 804 850 } … … 834 880 bool ok = true; 835 881 POutPersist* pout; 882 #ifdef SANS_EVOLPLANCK 836 883 TRY{ 837 884 pout = new POutPersist(flnm); … … 839 886 { printf("NamedObjMgr::SaveObjects()/Error Exception= %ld (%s) \n", 840 887 (long)merr, PeidaExc(merr)); ok = false; } ENDTRY; 888 #else 889 try { 890 pout = new POutPersist(flnm); 891 } 892 catch (IOExc iox) { 893 cerr << "NamedObjMgr::SaveObjects()/Error Exception - Msg= " << iox.Msg() << endl; 894 ok = false; 895 } 896 #endif 841 897 if (!ok) return; 842 898 NObjList::iterator it; … … 857 913 858 914 POutPersist* pout; 915 #ifdef SANS_EVOLPLANCK 859 916 TRY{ 860 917 pout = new POutPersist(flnm); … … 862 919 { printf("NamedObjMgr::SaveAll()/Error Exception= %ld (%s) \n", 863 920 (long)merr, PeidaExc(merr)); ok = false; } ENDTRY; 921 #else 922 try { 923 pout = new POutPersist(flnm); 924 } 925 catch (IOExc iox) { 926 cerr << "NamedObjMgr::SaveAll()/Error Exception - Msg= " << iox.Msg() << endl; 927 ok = false; 928 } 929 #endif 864 930 if (!ok) return; 865 931 NObjList::iterator it;
Note:
See TracChangeset
for help on using the changeset viewer.