Esempio n. 1
0
void SubscriptionQos::setValidity(const std::int64_t& validity)
{
    if (validity == -1) {
        setExpiryDate(SubscriptionQos::NO_EXPIRY_DATE());
    } else {
        std::int64_t now = std::chrono::duration_cast<std::chrono::milliseconds>(
                                   std::chrono::system_clock::now().time_since_epoch()).count();
        setExpiryDate(now + validity);
    }
}
Esempio n. 2
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;

}