Changeset 1215 in Sophya for trunk/SophyaPI
- Timestamp:
- Oct 1, 2000, 11:23:16 PM (25 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nomgadapter.cc
r1207 r1215 142 142 return(NULL); 143 143 } 144 145 /* --Methode-- */ 146 string NObjMgrAdapter::DecodeTypeIdName(string linuxtype) 147 // seulement pour Linux qui ne code pas correctement 148 { 149 #if defined(Linux) || defined(linux) 150 string type(""); 151 const char* str = linuxtype.c_str(); 152 int lstr = (int) strlen(str); 153 if(lstr<=0) return string("Linux Decoding error: lstr<=0"); 154 155 // Le dernier caractere donne le type 156 lstr--; 157 if (str[lstr]=='v') type = "void"; 158 else if(str[lstr]=='b') type = "bool"; 159 else if(str[lstr]=='c') type = "char"; 160 else if(str[lstr]=='s') type = "short"; 161 else if(str[lstr]=='i') type = "int"; 162 else if(str[lstr]=='l') type = "long"; 163 else if(str[lstr]=='x') type = "long long"; 164 else if(str[lstr]=='f') type = "float"; 165 else if(str[lstr]=='d') type = "double"; 166 else if(str[lstr]=='r') type = "long double"; 167 else return string("Linux Decoding error: bad last char"); 168 if(lstr==0) return type; 169 170 // Les 2 caracteres precedents donnent: signed, unsigned, *, & ou const. 171 // Mais si on a un Z, alors c'est un complexe (code ...t7complex1Z...) 172 for(int i=0; i<=2; i++) { 173 lstr--; 174 if (str[lstr]=='U') type = "unsigned " + type; 175 else if(str[lstr]=='S') type = "signed " + type; 176 else if(str[lstr]=='P') type = type + "*"; 177 else if(str[lstr]=='R') type = type + "&"; 178 else if(str[lstr]=='C') type = "const " + type; 179 else if(str[lstr]=='Z') { // Complexe 180 type = "complex<" + type + ">"; 181 for(int j=0;j<=1;j++) { 182 if (str[j]=='P') type = type + "*"; 183 else if(str[j]=='R') type = type + "&"; 184 else if(str[j]=='C') type = "const " + type; 185 else if(str[j]=='t') break; 186 else return string("Linux Decoding error: bad char 1,2 for Z"); 187 } 188 break; 189 } 190 else return string("Linux Decoding error: bad last-1,last-2 char"); 191 if(lstr==0) break; 192 } 193 194 return type; 195 196 #else 197 return linuxtype 198 #endif 199 } -
trunk/SophyaPI/PIext/nomgadapter.h
r1207 r1215 67 67 68 68 protected: 69 string DecodeTypeIdName(string linuxtype); 70 69 71 AnyDataObj* mObj; 70 72 }; -
trunk/SophyaPI/PIext/nomimagadapter.cc
r1214 r1215 49 49 { 50 50 string type = "Image< "; 51 type += typeid(T).name();51 type += DecodeTypeIdName(typeid(T).name()); 52 52 type += " > "; 53 53 return(type); -
trunk/SophyaPI/PIext/nomskymapadapter.cc
r1165 r1215 85 85 if (sg != NULL) type = "SphereHEALPix< "; 86 86 87 type += typeid(T).name();87 type += DecodeTypeIdName(typeid(T).name()); 88 88 type += " > "; 89 89 return(type); -
trunk/SophyaPI/PIext/nomtmatvecadapter.cc
r1207 r1215 53 53 if (v != NULL) type = "TVector< "; 54 54 55 type += typeid(T).name();55 type += DecodeTypeIdName(typeid(T).name()); 56 56 type += " > "; 57 57 return(type);
Note:
See TracChangeset
for help on using the changeset viewer.