bool CurrencyPair::Load(PacketBase& packet) { m_lstBids.clear(); m_lstOffers.clear(); if (!packet.ReadString(m_strCurrencyPair, 7)) return false; int nBidsCount; if (!packet.ReadInt(nBidsCount, 4)) return false; while (--nBidsCount >= 0) { BidOrOffer bid; if (!bid.Load(packet)) return false; m_lstBids.push_back(bid); } int nOffersCount; if (!packet.ReadInt(nOffersCount, 4)) return false; while (--nOffersCount >= 0) { BidOrOffer offer; if (!offer.Load(packet)) return false; m_lstOffers.push_back(offer); } return true; }
bool HotspotFxMarketSnapshotMessage::Load(PacketBase& packet) { m_lstCurrencyPairs.clear(); if (!packet.ReadInt(m_nMessageLength, 6)) return false; int nCurrencyPairCount; if (!packet.ReadInt(nCurrencyPairCount, 4)) return false; while (--nCurrencyPairCount >= 0) { hotspotfx::CurrencyPair currencyPair; if (!currencyPair.Load(packet)) return false; m_lstCurrencyPairs.push_back(currencyPair); } return MessageBase::Load(packet); }
bool BidOrOffer::Load(PacketBase& packet) { m_lstOrders.clear(); if (!packet.ReadString(m_strBidPrice, 10)) return false; int nOrderCount; if (!packet.ReadInt(nOrderCount, 4)) return false; while (--nOrderCount >= 0) { Order order; if (!order.Load(packet)) return false; m_lstOrders.push_back(order); } return true; }