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


Ignore:
Timestamp:
Apr 27, 2005, 1:55:00 PM (20 years ago)
Author:
ansari
Message:

1/ Prise en charge de DataTable et SwPPFDataTable pour piapp (NObjMgrAdapter) :
nomhistadapter.cc et piiinit.cc
2/ Lecture de tous les objets ds un fichier PPF par NamedObjMgr::ReadAll() pour
fichier PPF sans nametag.
3/ Ajout bloc try/catch ds PIStdImgApp::Run() (boucle d'evenements)

Reza , 27 Avril 2005

File:
1 edited

Legend:

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

    r2677 r2701  
    10471047{
    10481048ZSync(*myMutex);
     1049#ifdef SANS_EVOLPLANCK
    10491050bool ok = true;
    10501051PPersist* obj=NULL;
    10511052
    10521053PInPersist* ppin=NULL;
    1053 #ifdef SANS_EVOLPLANCK
    10541054TRY{
    10551055  ppin = new PInPersist(flnm);
     
    10581058}  CATCH(merr)
    10591059  { printf("NamedObjMgr::ReadAll()/Error Exception= %ld (%s) \n",
    1060     (long)merr, PeidaExc(merr));  ok = false; } ENDTRY;
    1061 #else
    1062 try {
    1063   ppin = new PInPersist(flnm);
    1064   if (ppin->NbNameTags() < 1)  obj = ppin->ReadObject();
    1065   else   obj = NULL;
    1066 }
    1067 catch (IOExc iox) {
    1068     cerr << "NamedObjMgr::ReadAll()/Error Exception - Msg= " << iox.Msg() << endl;
    1069     ok = false;
    1070 }
    1071 #endif
     1060    (long)merr, PeidaExc(merr));  ok = false; }
     1061ENDTRY;
    10721062if (!ok)  return;
    10731063if (obj) {
     
    10771067else ReadObj((*ppin), -1);
    10781068delete ppin;
     1069#else
     1070try {
     1071  PInPersist pis(flnm);
     1072  if (pis.NbNameTags() >= 1)  {
     1073    if (pis.NbNameTags() < pis.NbTopLevelObjects()) {
     1074      cout << "NamedObjMgr::ReadAll()/Warning File " << flnm << " NbNameTags="
     1075           << pis.NbNameTags() << " < NbTopLevelObjects= "
     1076           << pis.NbTopLevelObjects() << endl;
     1077      cout << " ... Reading " << pis.NbNameTags() << " objects at NameTags " ;
     1078    }
     1079    ReadObj(pis, -1);
     1080    return;
     1081  }
     1082
     1083  string nom = servnobjm->FileName2Name(flnm); 
     1084  int kn = 1;
     1085  for(int ii=0; ii<pis.NbTopLevelObjects(); ii++) {
     1086    PPersist* obj = pis.ReadObject();
     1087    if (!obj) continue;
     1088    AddObj_P(obj->DataObj(), nom, false);
     1089    kn++;
     1090    nom += (string)MuTyV(kn);
     1091  }
     1092}
     1093catch (IOExc& iox) {
     1094  cerr << "NamedObjMgr::ReadAll()/Error Exception - Msg= " << iox.Msg() << endl;
     1095}
     1096#endif
    10791097return;
    10801098}
Note: See TracChangeset for help on using the changeset viewer.