Changeset 1215 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Oct 1, 2000, 11:23:16 PM (25 years ago)
Author:
ercodmgr
Message:

intro corrections typeid(T).name() pour Linux cmv 1/10/00

Location:
trunk/SophyaPI/PIext
Files:
5 edited

Legend:

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

    r1207 r1215  
    142142return(NULL);
    143143}
     144
     145/* --Methode-- */
     146string 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
     194return type;
     195
     196#else
     197return linuxtype
     198#endif
     199}
  • trunk/SophyaPI/PIext/nomgadapter.h

    r1207 r1215  
    6767
    6868protected:
     69  string DecodeTypeIdName(string linuxtype);
     70
    6971  AnyDataObj* mObj;
    7072};
  • trunk/SophyaPI/PIext/nomimagadapter.cc

    r1214 r1215  
    4949{
    5050string type = "Image< ";
    51 type +=  typeid(T).name();
     51type +=  DecodeTypeIdName(typeid(T).name());
    5252type +=  " > ";
    5353return(type);
  • trunk/SophyaPI/PIext/nomskymapadapter.cc

    r1165 r1215  
    8585if (sg != NULL) type = "SphereHEALPix< ";
    8686
    87 type +=  typeid(T).name();
     87type +=  DecodeTypeIdName(typeid(T).name());
    8888type +=  " > ";
    8989return(type);
  • trunk/SophyaPI/PIext/nomtmatvecadapter.cc

    r1207 r1215  
    5353if (v != NULL) type = "TVector< ";
    5454
    55 type +=  typeid(T).name();
     55type +=  DecodeTypeIdName(typeid(T).name());
    5656type +=  " > ";
    5757return(type);
Note: See TracChangeset for help on using the changeset viewer.