예제 #1
0
ScripMasterDataRequest::ScripMasterDataRequest(const char * buf)
{
  int offset = 0;
  UNSIGNED_INTEGER tmpInt1 = 0, tmpInt2 = 0;
  UNSIGNED_CHARACTER tmpChar = 0;
  UNSIGNED_LONG tmpLong1 = 0, tmpLong2 = 0;
  UNSIGNED_SHORT tmpShort1 = 0, tmpShort2 = 0;
  
  DESERIALIZE_8(tmpChar, setScripMasterDataRequestType(tmpChar), buf, offset);
  DESERIALIZE_32(tmpInt1, tmpInt2, setClientId(tmpInt2), buf, offset);
  DESERIALIZE_64(tmpLong1, tmpLong2, setRecordNumber(tmpLong2), buf, offset);
  DESERIALIZE_64(tmpLong1, tmpLong2, setSecurityId(tmpLong2), buf, offset);
  DESERIALIZE_64(tmpLong1, tmpLong2, setSymbolId(tmpLong2), buf, offset);
  DESERIALIZE_16(tmpShort1, tmpShort2, setExchangeId(tmpShort2), buf, offset);

  setSymbol(strdup(buf + offset));
  offset += SYMBOL_SIZE;
  setSeries(strdup(buf + offset));
  offset += SERIES_SIZE;
  setMarketName(strdup(buf + offset));
  offset += MARKET_NAME_SIZE;
  DESERIALIZE_8(tmpChar, setOptionType(tmpChar), buf, offset);
  DESERIALIZE_8(tmpChar, setOptionMode(tmpChar), buf, offset);
  DESERIALIZE_8(tmpChar, setSecurityType(tmpChar), buf, offset);
  DESERIALIZE_64(tmpLong1, tmpLong2, setStrikePrice(tmpLong2), buf, offset);
  DESERIALIZE_32(tmpInt1, tmpInt2, setExpiryYearMon(tmpInt2), buf, offset);
  DESERIALIZE_32(tmpInt1, tmpInt2, setExpiryDate(tmpInt2), buf, offset);
  DESERIALIZE_32(tmpInt1, tmpInt2, setNumberOfRecords(tmpInt2), buf, offset);
  setSymbolAlias(strdup(buf + offset));
  offset += SYMBOL_ALIAS_SIZE;

}
예제 #2
0
int Option::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = Instrument::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 6)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 6;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< OptionType*>(_v) = optionType(); break;
        case 1: *reinterpret_cast< double*>(_v) = riskfreeRate(); break;
        case 2: *reinterpret_cast< double*>(_v) = spot(); break;
        case 3: *reinterpret_cast< double*>(_v) = strike(); break;
        case 4: *reinterpret_cast< double*>(_v) = timeToMaturity(); break;
        case 5: *reinterpret_cast< double*>(_v) = volatility(); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setOptionType(*reinterpret_cast< OptionType*>(_v)); break;
        case 1: setRiskfreeRate(*reinterpret_cast< double*>(_v)); break;
        case 2: setSpot(*reinterpret_cast< double*>(_v)); break;
        case 3: setStrike(*reinterpret_cast< double*>(_v)); break;
        case 4: setTimeToMaturity(*reinterpret_cast< double*>(_v)); break;
        case 5: setVolatility(*reinterpret_cast< double*>(_v)); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 6;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}