Changeset 2895 in Sophya for trunk/SophyaExt/FitsIOServer/fitsmanager.cc
- Timestamp:
- Jan 12, 2006, 8:46:40 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fitsmanager.cc
r2864 r2895 12 12 struct hand_list_el { 13 13 FitsHandlerInterface * fhi; 14 string clname; 14 int glev; 15 string desc; 15 16 }; 16 17 … … 23 24 if (hlistp == NULL) hlistp = new HandlerList; 24 25 } 25 26 int FitsManager::RegisterHandler(FitsHandlerInterface * fhi, string clname) 26 /*! 27 \param fhi : handler object pointer (created by new) which will be kept in the 28 handler list 29 \param glev : global priority level associated with the handler. Used when different 30 handlers return the same value for CheckHandling() or CheckReadability(). 31 \param desc : classe name description associated with the handler 32 */ 33 int FitsManager::RegisterHandler(FitsHandlerInterface * fhi, int glev, string desc) 27 34 { 28 35 ChkHLP(); … … 36 43 hand_list_el hle; 37 44 hle.fhi = fhi; 38 hle.clname = clname; 45 hle.glev = glev; 46 hle.desc = desc; 39 47 hlistp->push_back(hle); 40 48 return hlistp->size(); … … 50 58 for(it = hlistp->begin(); it != hlistp->end(); it++) { 51 59 kk++; 52 cout << kk << "- " << (*it). clname<< " : "53 << typeid(*((*it).fhi)).name() << endl;60 cout << kk << "- " << (*it).desc << " : " 61 << typeid(*((*it).fhi)).name() << " glev= " <<(*it).glev << endl; 54 62 } 55 63 return hlistp->size(); … … 63 71 int hfg = 0; 64 72 int bhfg = 0; 73 int clev = 0; 74 int blev = 0; 65 75 for(it = hlistp->begin(); it != hlistp->end(); it++) { 66 76 hfg = (*it).fhi->CheckHandling(o); 67 if ( hfg > bhfg) {68 fhi = (*it).fhi; bhfg = hfg; 77 if ( ( hfg > bhfg ) || ( (hfg == bhfg) && ((*it).glev > blev) ) ) { 78 fhi = (*it).fhi; bhfg = hfg; blev = (*it).glev; 69 79 } 70 80 } … … 101 111 int hfg = 0; 102 112 int bhfg = 0; 113 int blev = 0; 103 114 for(it = hlistp->begin(); it != hlistp->end(); it++) { 104 115 hfg = (*it).fhi->CheckReadability(is); 105 if ( hfg > bhfg) {106 fhi = (*it).fhi; bhfg = hfg; 116 if ( ( hfg > bhfg ) || ( (hfg == bhfg) && ((*it).glev > blev) ) ) { 117 fhi = (*it).fhi; bhfg = hfg; blev = (*it).glev; 107 118 } 108 119 }
Note:
See TracChangeset
for help on using the changeset viewer.