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 HotspotFxNewOrderMessage::Load ( PacketBase& packet )
{
    if (!packet.ReadChar(m_cBuyOrSell))
        return false;
    if (!packet.ReadString(m_strCurrencyPair, 7))
        return false;
    if (!packet.ReadString(m_strOrderID, 15))
        return false;
    if (!packet.ReadString(m_strPrice, 10))
        return false;
    if (!packet.ReadDbl(m_lfAmount, 16))
        return false;
    if (!packet.ReadDbl(m_lfMinQty, 16))
        return false;
    if (!packet.ReadDbl(m_lfLotSize, 16))
        return false;
    return MessageBase::Load(packet);
}
bool Order::Load(PacketBase& packet)
{
    if (!packet.ReadDbl(m_lfAmount, 16))
        return false;
    if (!packet.ReadDbl(m_lfMinQty, 16))
        return false;
    if (!packet.ReadDbl(m_lfLotSize, 16))
        return false;
    if (!packet.ReadString(m_strOrderID, 15))
        return false;
    return true;
}
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;
}