deps/PicklingTools170Release/M2k/opalpython/m2opalpython.cc
string OBJToNumPyCode (const OpalValue& ov)
{
  Vector v = UnOpalize(ov, Vector);
  switch (v.type()) {
  case M2_BYTE: return "i1";
  case M2_UBYTE: return "u1";
  case M2_INTEGER: return "i2";
  case M2_UINTEGER: return "u2";
  case M2_LONG: return "i4";
  case M2_ULONG: return "u4";
  case M2_XLONG: return "i8";
  case M2_UXLONG: return "u8";
  case M2_FLOAT: return "f4";
  case M2_DOUBLE: return "f8";
  case M2_CX_FLOAT: return "c8";
  case M2_CX_DOUBLE: return "c16";
  case M2_BIT: return "b1";

  case M2_TIME: return "u8";
  case M2_DURATION: return "f8";

  case M2_UNDEFINED: return "f8"; 

  default: {
    string ty=Stringize(v.type()); throw MidasException("Cannot handle arrays of "+ty);
  }
  }
}
// Helper: convert Val type codes into NumPy type strings
convert Val type codes into NumPy type strings
convert Val type codes into NumPy type strings
string OBJToNumPyCode (const OpalValue& ov)
{
  Vector v = UnOpalize(ov, Vector);
  switch (v.type()) {
  case M2_BYTE: return "i1";
  case M2_UBYTE: return "u1";
  case M2_INTEGER: return "i2";
  case M2_UINTEGER: return "u2";
  case M2_LONG: return "i4";
  case M2_ULONG: return "u4";
  case M2_XLONG: return "i8";
  case M2_UXLONG: return "u8";
  case M2_FLOAT: return "f4";
  case M2_DOUBLE: return "f8";
  case M2_CX_FLOAT: return "c8";
  case M2_CX_DOUBLE: return "c16";
  case M2_BIT: return "b1";
  case M2_TIME: return "u8";
  case M2_DURATION: return "f8";
  case M2_UNDEFINED: return "f8"; 
  default: {
    string ty=Stringize(v.type()); throw MidasException("Cannot handle arrays of "+ty);
  }
  }
}
string OBJToNumPyCode ( const OpalValue & ov ) { Vector v = UnOpalize ( ov , Vector ) ; switch ( v . type ( ) ) { case M2_BYTE : return " " ; case M2_UBYTE : return " " ; case M2_INTEGER : return " " ; case M2_UINTEGER : return " " ; case M2_LONG : return " " ; case M2_ULONG : return " " ; case M2_XLONG : return " " ; case M2_UXLONG : return " " ; case M2_FLOAT : return " " ; case M2_DOUBLE : return " " ; case M2_CX_FLOAT : return " " ; case M2_CX_DOUBLE : return " " ; case M2_BIT : return " " ; case M2_TIME : return " " ; case M2_DURATION : return " " ; case M2_UNDEFINED : return " " ; default : { string ty = Stringize ( v . type ( ) ) ; throw MidasException ( " " + ty ) ; } } }
Helper: convert Val type codes into NumPy type strings
Helper : convert Val type codes into NumPy type strings