コード例 #1
0
  public final Message XXdecodeNewOrderSingle() {
    ClientNewOrderSingleImpl msg = _newOrderSingleFactory.get();
    int tag = getTag();

    int start;
    int valLen;

    while (tag != 0) {
      switch (tag) {
        case 1:
          start = _idx;
          valLen = getValLength();
          msg.setAccount(start, valLen);
          break;
        case 11:
          start = _idx;
          valLen = getValLength();
          msg.setClOrdId(start, valLen);
          break;
        case 15:
          start = _idx;
          valLen = getValLength();
          msg.setCurrency(Currency.getVal(_fixMsg, start, valLen));
          break;
        case 21:
          msg.setHandlInst(HandlInst.getVal(_fixMsg[_idx++]));
          break;
        case 22:
          msg.setSecurityIDSource(SecurityIDSource.getVal(_fixMsg[_idx++]));
          break;
        case 38:
          msg.setOrderQty(getIntVal());
          break;
        case 40:
          msg.setOrdType(OrdType.getVal(_fixMsg[_idx++]));
          break;
        case 44:
          msg.setPrice(getDoubleVal());
          break;
        case 48:
          start = _idx;
          valLen = getValLength();
          msg.setSecurityId(start, valLen);
          break;
        case 49:
          decodeSenderCompID();
          break;
        case 50:
          decodeSenderSubID();
          break;
        case 52:
          msg.setSendingTime(getMSFromStartDayUTC());
          break;
        case 54:
          msg.setSide(Side.getVal(_fixMsg[_idx++]));
          break;
        case 55:
          start = _idx;
          valLen = getValLength();
          msg.setSymbol(start, valLen);
          break;
        case 56:
          decodeTargetCompID();
          break;
        case 57:
          decodeTargetSubID();
          break;
        case 58:
          start = _idx;
          valLen = getValLength();
          msg.setText(start, valLen);
          break;
        case 59:
          msg.setTimeInForce(TimeInForce.getVal(_fixMsg[_idx++]));
          break;
        case 60:
          msg.setTransactTime(getMSFromStartDayUTC());
          break;
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        case 9:
        case 10:
        case 12:
        case 13:
        case 14:
        case 16:
        case 17:
        case 18:
        case 19:
        case 20:
        case 23:
        case 24:
        case 25:
        case 26:
        case 27:
        case 28:
        case 29:
        case 30:
        case 31:
        case 32:
        case 33:
        case 34:
        case 35:
        case 36:
        case 37:
        case 39:
        case 41:
        case 42:
        case 43:
        case 45:
        case 46:
        case 47:
        case 51:
        case 53:
          getValLength();
          break;
        default:
          switch (tag) {
            case 100:
              start = _idx;
              valLen = getValLength();
              msg.setExDest(start, valLen);
              break;
            case 528:
              msg.setOrderCapacity(OrderCapacity.getVal(_fixMsg[_idx++]));
              break;
            case 207:
              start = _idx;
              valLen = getValLength();
              msg.setSecurityExchange(start, valLen);
              break;
            case 211:
              getValLength();
              throwDecodeException("Tag 211 not supported in NewOrderSingle");
              break;
          }
          break;
      }
      _idx++; /* past delimiter */
      tag = getTag();
    }

    if (_idx > SizeType.VIEW_NOS_BUFFER.getSize()) {
      throw new RuntimeDecodingException(
          "NewOrderSingleMessage too big " + _idx + ", max=" + SizeType.VIEW_NOS_BUFFER.getSize());
    }
    msg.setViewBuf(_fixMsg, _offset, _idx);

    // TODO instrument enrichment & ccy major/minor changes

    return msg;
  }
コード例 #2
0
  // decode methods
  public Message decodeNewOrderSingle() {
    // TODO get from pool
    ClientNewOrderSingleImpl msg = _newOrderSingleFactory.get();
    int tag = getTag();

    int start;
    int valLen;

    while (tag != 0) {
      switch (tag) {
        case 0:
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        case 9:
        case 10:
        case 12:
        case 13:
        case 14:
        case 16:
        case 17:
        case 18:
        case 19:
        case 20:
          // forced table switch from  0 to 60
          start = _idx;
          valLen = getValLength();
          break;
        case 1:
          start = _idx;
          valLen = getValLength();
          msg.setAccount(start, valLen);
          break;
        case 11:
          start = _idx;
          valLen = getValLength();
          msg.setClOrdId(start, valLen);
          break;
        case 15:
          start = _idx;
          valLen = getValLength();
          msg.setCurrency(Currency.getVal(_fixMsg, start, valLen));
          break;
        case 21:
          msg.setHandlInst(HandlInst.getVal(_fixMsg[_idx++]));
          break;
        case 22:
          msg.setSecurityIDSource(SecurityIDSource.getVal(_fixMsg[_idx++]));
          break;
        case 38:
          msg.setOrderQty(getIntVal());
          break;
        case 40:
          msg.setOrdType(OrdType.getVal(_fixMsg[_idx++]));
          break;
        case 44:
          msg.setPrice(getDoubleVal());
          break;
        case 48:
          start = _idx;
          valLen = getValLength();
          msg.setSecurityId(start, valLen);
          break;
        case 49:
          decodeSenderCompID();
          break;
        case 52:
          msg.setSendingTime(getMSFromStartDayUTC());
          break;
        case 54:
          msg.setSide(Side.getVal(_fixMsg[_idx++]));
          break;
        case 55:
          start = _idx;
          valLen = getValLength();
          msg.setSymbol(start, valLen);
          break;
        case 56:
          decodeTargetCompID();
          break;
        case 58:
          start = _idx;
          valLen = getValLength();
          msg.setText(start, valLen);
          break;
        case 59:
          msg.setTimeInForce(TimeInForce.getVal(_fixMsg[_idx++]));
          break;
        case 60:
          msg.setTransactTime(getMSFromStartDayUTC());
          break;
        default: //  SKIP
          switch (tag) {
            case 100: // exDest
              start = _idx;
              valLen = getValLength();
              msg.setExDest(start, valLen);
              break;
            case 207: // securityExchange
              start = _idx;
              valLen = getValLength();
              msg.setSecurityExchange(start, valLen);
              break;
            case 528:
              msg.setOrderCapacity(OrderCapacity.getVal(_fixMsg[_idx++]));
              break;
            default:
              start = _idx;
              valLen = getValLength();
              break;
          }
      }

      _idx++; // past delimiter

      tag = getTag();
    }

    if (_idx > SizeType.VIEW_NOS_BUFFER.getSize()) {

      throw new RuntimeDecodingException(
          "NewOrderSingle Message too big " + _idx + ", max=" + SizeType.VIEW_NOS_BUFFER.getSize());
    }

    msg.setViewBuf(_fixMsg, _offset, _idx);

    // TODO instrument enrichment & ccy major/minor changes

    return msg;
  }