Files
externals/linux/include/OnixS/CME/MDH/MessageSupplements.h
T
2017-09-11 10:17:55 -04:00

126 lines
3.4 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.
ONIXS_CMEMDH_LTWT_CLASS
IncrementalRefreshBookCombinedEntry
{
public:
/// Aliases order details for given update.
typedef
IncrementalRefreshBook::OrderIDEntries::Entry
OrderEntry;
/// Aliases price details for given update.
typedef
IncrementalRefreshBook::Entries::Entry
PriceEntry;
/// Initializes instance from order and price components.
IncrementalRefreshBookCombinedEntry(
const OrderEntry& order, const PriceEntry& 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.
OrderId id() const
{
return order_.orderId();
}
/// Order priority.
bool
priority(
OrderPriority& priority) const
{
return order_.orderPriority(priority);
}
/// Price value.
bool
price(
PRICE& price) const
{
return price_.entryPx(price);
}
/// Display quantity.
bool
quantity(
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;
}
private:
OrderEntry order_;
PriceEntry price_;
};
ONIXS_CMEMDH_NAMESPACE_END