Changeset 3572 in Sophya for trunk/SophyaPI/PIext/nobjmgr.cc
- Timestamp:
- Feb 7, 2009, 10:50:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nobjmgr.cc
r3428 r3572 20 20 #include "dvlist.h" 21 21 22 // EVOL-PLANCK23 #ifdef SANS_EVOLPLANCK24 #include "fitsimage.h"25 #else26 22 #include "tvector.h" 27 23 #include "pitvmaad.h" 28 24 #include "piyfxdrw.h" 29 #endif30 25 31 26 #include "pisurfdr.h" … … 259 254 } 260 255 NObjMgrSync zs(0); zs.NOp(); 261 #ifdef SANS_EVOLPLANCK262 bool fg = true;263 #else264 256 bool fg = myVars->HasKey(key); 265 #endif266 257 myVars->SetS(key, val); 267 258 // cout << " DEBUG::SetVar " << *myVars << endl; … … 277 268 } 278 269 NObjMgrSync zs(0); zs.NOp(); 279 #ifdef SANS_EVOLPLANCK280 DVList::ValList::const_iterator it;281 for(it=myVars->Begin(); it!= myVars->End(); it++)282 if ((*it).first == key) return true;283 return(false);284 #else285 270 return(myVars->HasKey(key)); 286 #endif287 271 } 288 272 … … 295 279 } 296 280 NObjMgrSync zs(0); zs.NOp(); 297 #ifdef SANS_EVOLPLANCK298 return(false);299 #else300 281 return(myVars->DeleteKey(key)); 301 #endif302 282 } 303 283 … … 945 925 PPersist* ppobj=NULL; 946 926 bool ok = true; 947 #ifdef SANS_EVOLPLANCK948 TRY{949 PInPersist pis(flnm);950 ppobj = PPersistMgr::ReadObject(pis);951 if (ppobj == NULL) ok = false;952 } CATCH(merr)953 { printf("NamedObjMgr::ReadObj()/Error Exception= %ld (%s) \n",954 (long)merr, PeidaExc(merr)); ok = false; } ENDTRY;955 #else956 927 try { 957 928 PInPersist pis(flnm); … … 962 933 ok = false; 963 934 } 964 #endif965 935 if (!ok) return; 966 936 if (nobj.length()<1) nobj = servnobjm->FileName2Name(flnm); … … 1011 981 { 1012 982 int_4 i; // $CHECK$ int -> int_4 a cause de TagKey 1013 #ifdef SANS_EVOLPLANCK1014 int_4 cid, key, ln; // $CHECK$ int -> int_4 a cause de TagKey1015 #endif1016 983 int n0, n1; 1017 984 bool ok = true; … … 1021 988 int nread = 0; 1022 989 int nbtags = 0; 1023 #ifdef SANS_EVOLPLANCK1024 nbtags = s.NbTags();1025 #else1026 990 nbtags = s.NbNameTags(); 1027 #endif1028 991 if ( (nbtags < 1) || (num >= nbtags) ) { 1029 992 if (num >= 0) { … … 1033 996 } 1034 997 1035 #ifdef SANS_EVOLPLANCK1036 TRY {1037 obj = PPersistMgr::ReadObject(s);1038 if (obj == NULL) ok = false;1039 } CATCH(merr) {1040 printf("NamedObjMgr::ReadObj()/Error Exception= %ld (%s) \n", (long)merr, PeidaExc(merr));1041 ok = false;1042 } ENDTRY;1043 #else1044 998 try { 1045 999 obj = s.ReadObject(); … … 1049 1003 ok = false; 1050 1004 } 1051 #endif1052 1005 1053 1006 if (!ok) return; … … 1060 1013 else { n0 = num; n1 = num+1; } 1061 1014 for(i=n0; i<n1; i++) { 1062 #ifdef SANS_EVOLPLANCK1063 key = s.TagKey(i, cid, ln);1064 if (ln <= 0) nom = "";1065 else nom = s.TagName(i);1066 s.GotoTag(i);1067 TRY {1068 obj = PPersistMgr::ReadObject(s);1069 if (obj == NULL) ok = false;1070 } CATCH(merr) {1071 printf("NamedObjMgr::ReadObj()/Error Exception= %ld (%s) \n", (long)merr, PeidaExc(merr));1072 ok = false;1073 } ENDTRY;1074 #else1075 1015 s.GotoNameTagNum(i); 1076 1016 nom = s.GetTagName(i); … … 1082 1022 ok = false; 1083 1023 } 1084 #endif1085 1024 if (ok) { AddObj_P(obj->DataObj(), nom, true); nread++; } 1086 1025 } … … 1095 1034 // sinon, tous les objets sequentiellement 1096 1035 { 1097 #ifdef SANS_EVOLPLANCK1098 bool ok = true;1099 PPersist* obj=NULL;1100 1101 PInPersist* ppin=NULL;1102 TRY{1103 ppin = new PInPersist(flnm);1104 if (ppin->NbTags() < 1) obj = PPersistMgr::ReadObject((*ppin));1105 else obj = NULL;1106 } CATCH(merr)1107 { printf("NamedObjMgr::ReadAll()/Error Exception= %ld (%s) \n",1108 (long)merr, PeidaExc(merr)); ok = false; }1109 ENDTRY;1110 if (!ok) return;1111 if (obj) {1112 string nom = servnobjm->FileName2Name(flnm);1113 AddObj(obj->DataObj(), nom, false);1114 }1115 else ReadObj((*ppin), -1);1116 delete ppin;1117 #else1118 1036 try { 1119 1037 PInPersist pis(flnm); … … 1151 1069 cerr << "NamedObjMgr::ReadAll()/Error Exception - Msg= " << iox.Msg() << endl; 1152 1070 } 1153 #endif1154 1071 return; 1155 1072 } … … 1193 1110 bool ok = true; 1194 1111 POutPersist* pout=NULL; 1195 #ifdef SANS_EVOLPLANCK1196 TRY{1197 pout = new POutPersist(flnm);1198 } CATCH(merr)1199 { printf("NamedObjMgr::SaveObjects()/Error Exception= %ld (%s) \n",1200 (long)merr, PeidaExc(merr)); ok = false; } ENDTRY;1201 #else1202 1112 try { 1203 1113 pout = new POutPersist(flnm); … … 1207 1117 ok = false; 1208 1118 } 1209 #endif1210 1119 if (!ok) return; 1211 1120 NObjList::iterator it; … … 1262 1171 1263 1172 POutPersist* pout=NULL; 1264 #ifdef SANS_EVOLPLANCK1265 TRY{1266 pout = new POutPersist(flnm);1267 } CATCH(merr)1268 { printf("NamedObjMgr::SaveAll()/Error Exception= %ld (%s) \n",1269 (long)merr, PeidaExc(merr)); ok = false; } ENDTRY;1270 #else1271 1173 try { 1272 1174 pout = new POutPersist(flnm); … … 1276 1178 ok = false; 1277 1179 } 1278 #endif1279 1180 if (!ok) return; 1280 1181 NObjList::iterator it; … … 1583 1484 NObjMgrSync zs(0); zs.NOp(); 1584 1485 1585 #ifdef SANS_EVOLPLANCK1586 cerr << " NamedObjMgr::DisplayVector() Error: Not implemented with PEIDA " << endl;1587 #else1588 1589 1486 if(!myImgApp) return; 1590 1487 … … 1651 1548 return; 1652 1549 1653 #endif1654 1550 } 1655 1551
Note:
See TracChangeset
for help on using the changeset viewer.