150 lines
3.7 KiB
C++
150 lines
3.7 KiB
C++
// Copyright Onix Solutions Limited [OnixS]. All rights reserved.
|
|
//
|
|
// This software owned by Onix Solutions Limited [OnixS] and is
|
|
// protected by copyright law and international copyright treaties.
|
|
//
|
|
// Access to and use of the software is governed by the terms of the applicable
|
|
// OnixS Software Services Agreement (the Agreement) and Customer end user license
|
|
// agreements granting a non-assignable, non-transferable and non-exclusive license
|
|
// to use the software for it's own data processing purposes under the terms defined
|
|
// in the Agreement.
|
|
//
|
|
// Except as otherwise granted within the terms of the Agreement, copying or
|
|
// reproduction of any part of this source code or associated reference material
|
|
// to any other location for further reproduction or redistribution, and any
|
|
// amendments to this copyright notice, are expressly prohibited.
|
|
//
|
|
// Any reproduction or redistribution for sale or hiring of the Software not in
|
|
// accordance with the terms of the Agreement is a violation of copyright law.
|
|
//
|
|
|
|
#pragma once
|
|
|
|
#include <OnixS/CME/MDH/Order.h>
|
|
#include <OnixS/CME/MDH/Messages.h>
|
|
#include <OnixS/CME/MDH/Security.h>
|
|
|
|
ONIXS_CMEMDH_NAMESPACE_BEGIN
|
|
|
|
/// Data for MBO book atomic update gathered
|
|
/// from IncrementalRefreshBook message containing
|
|
/// atomic updates for all types of books.
|
|
template
|
|
<
|
|
class Order,
|
|
class Price
|
|
>
|
|
class
|
|
IncrementalRefreshBookCombinedEntry
|
|
{
|
|
Order order_;
|
|
Price price_;
|
|
|
|
public:
|
|
/// Initializes instance from order and price components.
|
|
IncrementalRefreshBookCombinedEntry(
|
|
const Order& order, const Price& price)
|
|
: order_(order), price_(price)
|
|
{
|
|
}
|
|
|
|
/// Initializes as copy of the other one.
|
|
IncrementalRefreshBookCombinedEntry(
|
|
const IncrementalRefreshBookCombinedEntry& other)
|
|
: order_(other.order_), price_(other.price_)
|
|
{
|
|
}
|
|
|
|
/// Security id whose MBO book is to be updated.
|
|
SecurityId securityId() const
|
|
{
|
|
return price_.securityId();
|
|
}
|
|
|
|
/// Type of market data entry.
|
|
EntryTypeBook::Enum
|
|
entryType() const
|
|
{
|
|
return price_.entryType();
|
|
}
|
|
|
|
/// Indicates action of atomic book update.
|
|
OrderUpdateAction::Enum
|
|
updateAction() const
|
|
{
|
|
return order_.orderUpdateAction();
|
|
}
|
|
|
|
/// Order identifier.
|
|
bool
|
|
orderId(
|
|
OrderId& id) const
|
|
{
|
|
id = order_.orderId();
|
|
|
|
return true;
|
|
}
|
|
|
|
/// Order priority.
|
|
bool
|
|
orderPriority(
|
|
OrderPriority& priority) const
|
|
{
|
|
return order_.orderPriority(priority);
|
|
}
|
|
|
|
/// Price value.
|
|
bool
|
|
entryPx(
|
|
Decimal& price) const
|
|
{
|
|
return price_.entryPx(price);
|
|
}
|
|
|
|
/// Display quantity.
|
|
bool
|
|
displayQty(
|
|
DisplayQuantity& quantity) const
|
|
{
|
|
return order_.displayQty(quantity);
|
|
}
|
|
|
|
/// Re-initializes as copy of the other instance.
|
|
IncrementalRefreshBookCombinedEntry&
|
|
operator =(
|
|
const
|
|
IncrementalRefreshBookCombinedEntry& other)
|
|
{
|
|
order_ = other.order_;
|
|
price_ = other.price_;
|
|
|
|
return *this;
|
|
}
|
|
};
|
|
|
|
//
|
|
|
|
/// Data for MBO book atomic update gathered
|
|
/// from IncrementalRefreshBook46 message containing
|
|
/// atomic updates for all types of books.
|
|
typedef
|
|
IncrementalRefreshBookCombinedEntry
|
|
<
|
|
IncrementalRefreshBook46::OrderIDEntry,
|
|
IncrementalRefreshBook46::Entry
|
|
>
|
|
IncrementalRefreshBook46CombinedEntry;
|
|
|
|
/// Data for MBO book atomic update gathered
|
|
/// from IncrementalRefreshBook32 message containing
|
|
/// atomic updates for all types of books.
|
|
typedef
|
|
IncrementalRefreshBookCombinedEntry
|
|
<
|
|
IncrementalRefreshBook32::OrderIDEntry,
|
|
IncrementalRefreshBook32::Entry
|
|
>
|
|
IncrementalRefreshBook32CombinedEntry;
|
|
|
|
ONIXS_CMEMDH_NAMESPACE_END
|