Esempio n. 1
0
int ScripMasterDataRequest::serialize(char *buf)
{
  int bytes = 0;
    UNSIGNED_INTEGER tmp = 0;
    UNSIGNED_SHORT tmpShort = 0;
    UNSIGNED_CHARACTER tmpChar = 0;
    UNSIGNED_LONG tmpLong = 0;

    bytes = sizeof(UNSIGNED_SHORT);  // Leave 2 bytes for packet size
    // Put category of command
    SERIALIZE_8(tmpChar, (UNSIGNED_CHARACTER)(CMD::CommandCategory_SEND_SCRIP_MASTER_DATA), buf, bytes);  //Command Category

    // Put fields of this class
    SERIALIZE_8(tmpChar, getScripMasterDataRequestType(), buf, bytes);
    SERIALIZE_32(tmp, getClientId(), buf, bytes);
    SERIALIZE_64(tmpLong, getRecordNumber(), buf, bytes);
    SERIALIZE_64(tmpLong, getSecurityId(), buf, bytes);
    SERIALIZE_64(tmpLong, getSymbolId(), buf, bytes);
    SERIALIZE_16(tmpShort, getExchangeId(), buf, bytes);

    memcpy(buf + bytes, getSymbol(), SYMBOL_SIZE);
    bytes += SYMBOL_SIZE;
    memcpy(buf + bytes, getSeries(), SERIES_SIZE);
    bytes += SERIES_SIZE;
    memcpy(buf + bytes, getMarketName(), SERIES_SIZE);
    bytes += MARKET_NAME_SIZE;
    SERIALIZE_8(tmpChar, getOptionType(), buf, bytes);
    SERIALIZE_8(tmpChar, getOptionMode(), buf, bytes);
    SERIALIZE_8(tmpChar, getSecurityType(), buf, bytes);
    SERIALIZE_64(tmpLong, getStrikePrice(), buf, bytes);
    SERIALIZE_32(tmp, getExpiryYearMon(), buf, bytes);
    SERIALIZE_32(tmp, getExpiryDate(), buf, bytes);
    SERIALIZE_32(tmp, getNumberOfRecords(), buf, bytes);
    memcpy(buf + bytes, getSymbolAlias(), SYMBOL_ALIAS_SIZE);
    bytes += SYMBOL_ALIAS_SIZE;

    UNSIGNED_SHORT dummyBytes = 0;
    // Put size as the first field after deducting 2 bytes reserved for size
    SERIALIZE_16(tmpShort, (UNSIGNED_SHORT)(bytes-sizeof(UNSIGNED_SHORT)), buf, dummyBytes);

    return bytes;
}
Esempio n. 2
0
void ScripMasterDataRequest::dump()
{

  std::cout << "ScripMasterDataRequest dump : " << std::endl;
  std::cout << getScripMasterDataRequestType() << std::endl; 
  std::cout << getClientId() << std::endl; 
  std::cout << getRecordNumber() << std::endl; 
  std::cout << getSecurityId() << std::endl; 
  std::cout << getSymbolId() << std::endl; 
  std::cout << getExchangeId() << std::endl; 
  std::cout << getSymbol() << std::endl; 
  std::cout << getSeries() << std::endl; 
  std::cout << getMarketName() << std::endl; 
  std::cout << getOptionType() << std::endl; 
  std::cout << getOptionMode() << std::endl; 
  std::cout << getSecurityType() << std::endl; 
  std::cout << getStrikePrice() << std::endl; 
  std::cout << getExpiryYearMon() << std::endl; 
  std::cout << getExpiryDate() << std::endl; 
  std::cout << getNumberOfRecords() << std::endl;
  std::cout << getSymbolAlias() << std::endl;
  std::cout << "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n" << std::endl;
    
}
Esempio n. 3
0
bool SubscriptionQos::operator==(const SubscriptionQos& subscriptionQos) const
{
    return getExpiryDate() == subscriptionQos.getExpiryDate() &&
           publicationTtl == subscriptionQos.getPublicationTtl();
}