Changeset 3572 in Sophya for trunk/SophyaPI/PIext/nobjmgr.cc


Ignore:
Timestamp:
Feb 7, 2009, 10:50:34 PM (17 years ago)
Author:
cmv
Message:

char* -> const char* pour regler les problemes de deprecated string const... + comparaison unsigned signed + suppression EVOL_PLANCK rz+cmv 07/02/2009

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/nobjmgr.cc

    r3428 r3572  
    2020#include "dvlist.h"
    2121
    22 // EVOL-PLANCK
    23 #ifdef SANS_EVOLPLANCK
    24 #include "fitsimage.h" 
    25 #else
    2622#include "tvector.h"
    2723#include "pitvmaad.h"
    2824#include "piyfxdrw.h"
    29 #endif
    3025
    3126#include "pisurfdr.h"
     
    259254  }
    260255  NObjMgrSync zs(0); zs.NOp();
    261 #ifdef SANS_EVOLPLANCK
    262   bool fg = true;
    263 #else
    264256  bool fg = myVars->HasKey(key);
    265 #endif
    266257  myVars->SetS(key, val);
    267258  //  cout << " DEBUG::SetVar " << *myVars << endl;
     
    277268  }
    278269  NObjMgrSync zs(0); zs.NOp();
    279 #ifdef SANS_EVOLPLANCK
    280   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 #else
    285270  return(myVars->HasKey(key));
    286 #endif
    287271}
    288272
     
    295279  }
    296280  NObjMgrSync zs(0); zs.NOp();
    297 #ifdef SANS_EVOLPLANCK
    298   return(false);
    299 #else
    300281  return(myVars->DeleteKey(key));
    301 #endif
    302282}
    303283
     
    945925PPersist* ppobj=NULL;
    946926bool ok = true;
    947 #ifdef SANS_EVOLPLANCK
    948 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 #else
    956927try {
    957928  PInPersist pis(flnm);
     
    962933  ok = false;
    963934  }
    964 #endif
    965935if (!ok)  return;
    966936if (nobj.length()<1)  nobj = servnobjm->FileName2Name(flnm);
     
    1011981{
    1012982int_4 i; // $CHECK$ int -> int_4 a cause de TagKey
    1013 #ifdef SANS_EVOLPLANCK
    1014 int_4 cid, key, ln; // $CHECK$ int -> int_4 a cause de TagKey
    1015 #endif
    1016983int n0, n1;
    1017984bool ok = true;
     
    1021988int nread = 0;
    1022989int nbtags = 0;
    1023 #ifdef SANS_EVOLPLANCK
    1024 nbtags = s.NbTags();
    1025 #else
    1026990nbtags = s.NbNameTags();
    1027 #endif
    1028991if ( (nbtags < 1) || (num >= nbtags) ) {
    1029992  if (num >= 0) {
     
    1033996  }
    1034997
    1035 #ifdef SANS_EVOLPLANCK
    1036   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 #else
    1044998try {
    1045999  obj = s.ReadObject();
     
    10491003  ok = false;
    10501004  }
    1051 #endif
    10521005
    10531006  if (!ok)  return;
     
    10601013else { n0 = num; n1 = num+1; }
    10611014for(i=n0; i<n1; i++) {
    1062 #ifdef SANS_EVOLPLANCK
    1063   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 #else
    10751015  s.GotoNameTagNum(i);
    10761016  nom = s.GetTagName(i);
     
    10821022    ok = false;
    10831023    }
    1084 #endif
    10851024  if (ok)  { AddObj_P(obj->DataObj(), nom, true);  nread++; }
    10861025}
     
    10951034  //    sinon, tous les objets sequentiellement
    10961035{
    1097 #ifdef SANS_EVOLPLANCK
    1098 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 #else
    11181036try {
    11191037  PInPersist pis(flnm);
     
    11511069  cerr << "NamedObjMgr::ReadAll()/Error Exception - Msg= " << iox.Msg() << endl;
    11521070}
    1153 #endif
    11541071return;
    11551072}
     
    11931110bool ok = true;
    11941111POutPersist* pout=NULL;
    1195 #ifdef SANS_EVOLPLANCK
    1196 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 #else
    12021112try {
    12031113 pout = new POutPersist(flnm);
     
    12071117    ok = false;
    12081118}
    1209 #endif
    12101119if (!ok)  return;
    12111120NObjList::iterator it;
     
    12621171
    12631172POutPersist* pout=NULL;
    1264 #ifdef SANS_EVOLPLANCK
    1265 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 #else
    12711173try {
    12721174 pout = new POutPersist(flnm);
     
    12761178    ok = false;
    12771179}
    1278 #endif
    12791180if (!ok)  return;
    12801181NObjList::iterator it;
     
    15831484NObjMgrSync zs(0); zs.NOp();
    15841485
    1585 #ifdef SANS_EVOLPLANCK
    1586   cerr << " NamedObjMgr::DisplayVector() Error: Not implemented with PEIDA " << endl;
    1587 #else
    1588 
    15891486if(!myImgApp) return;
    15901487
     
    16511548return;
    16521549
    1653 #endif
    16541550}
    16551551
Note: See TracChangeset for help on using the changeset viewer.