Changeset 2895 in Sophya for trunk/SophyaExt
- Timestamp:
- Jan 12, 2006, 8:46:40 AM (20 years ago)
- Location:
- trunk/SophyaExt/FitsIOServer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fiosinit.cc
r2864 r2895 27 27 // FitsManager::RegisterHandler(new FitsArrayHandler<int_2> , "TArray<int_2>"); 28 28 cout << " ---- FitsIOServerInitiator / DEBUG ---- debut RegisterHandler " << endl; 29 FitsManager::RegisterHandler(new FitsArrayHandler<int_4> , "TArray<int_4>");30 FitsManager::RegisterHandler(new FitsArrayHandler<r_4> , "TArray<r_4>");31 FitsManager::RegisterHandler(new FitsArrayHandler< r_8 > , "TArray<r_8>");29 FitsManager::RegisterHandler(new FitsArrayHandler<int_4> , 1, "TArray<int_4> "); 30 FitsManager::RegisterHandler(new FitsArrayHandler<r_4> , 1, "TArray<r_4>"); 31 FitsManager::RegisterHandler(new FitsArrayHandler< r_8 > , 1, "TArray<r_8>"); 32 32 33 FitsManager::RegisterHandler(new FitsHandler<BaseDataTable>, "DataTable");33 FitsManager::RegisterHandler(new FitsHandler<BaseDataTable>, 1, "DataTable"); 34 34 35 35 cout << " ---- FitsIOServerInitiator / DEBUG ---- ListHandlers() : " << endl; -
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 } -
trunk/SophyaExt/FitsIOServer/fitsmanager.h
r2864 r2895 17 17 public: 18 18 //! Called once for each handler during init phase. 19 static int RegisterHandler(FitsHandlerInterface * fhi, string clname="");19 static int RegisterHandler(FitsHandlerInterface * fhi, int glev=0, string desc=""); 20 20 //! Print list of handlers on cout 21 21 static int ListHandlers();
Note:
See TracChangeset
for help on using the changeset viewer.