Files
2019-02-11 17:36:12 +00:00

116 lines
4.3 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 <string>
#include <vector>
#include <OnixS/ICE/iMpact/MarketData/ABI.h>
#include <OnixS/ICE/iMpact/MarketData/Types.h>
#include <OnixS/ICE/iMpact/MarketData/Enumerations.h>
namespace OnixS { namespace ICE { namespace iMpact { namespace MarketData {
/// Returns string representation.
ONIXS_ICE_IMPACT_MD_API std::string enumToString(SecurityType::Enum);
/// Defines known depth of order book.
struct ONIXS_ICE_IMPACT_MD_API BookDepth
{
/// \copydoc BookDepth
enum Enum
{
FOD ///< Full Order Depth.
, TOP5PL ///< Top 5 Price Level.
, TOP10PL ///< Top 10 Price Level.
, TOB ///< Top Of Book (Options Only).
};
/// Deserializes constant from string representation.
static Enum deserialize(const char*);
/// Returns string representation.
static const char* toString(Enum);
};
/// Defines known market sub-type constants.
struct ONIXS_ICE_IMPACT_MD_API MarketSubType
{
/// \copydoc MarketSubType
enum Enum
{
NonImplied ///< The enhanced implication technology is disabled.
, FullImplied ///< The enhanced implication technology is activated.
};
/// Deserializes constant from string representation.
static Enum deserialize(const char*);
/// Returns string representation.
static const char* toString(Enum);
};
/// Returns string representation.
ONIXS_ICE_IMPACT_MD_API std::string enumToString(BookDepth::Enum);
/// Defines which books should be maintained for given market type id.
struct ONIXS_ICE_IMPACT_MD_API MarketSubscription
{
/// Id of market type for which books should be maintained.
MarketType marketType;
/// Specifies type of market functionality.
///
/// @note As a result of the increased messaging over the full implied channels,
/// you may experience additional latency as compared to the non-full implied channels.
///
/// By default all subscription is for non-implied channels.
MarketSubType::Enum marketSubType;
/// Specifies type of securities received in product definition response.
SecurityType::Enum securityType;
/// Specifies book depth.
BookDepth::Enum bookDepth;
/// Specifies a list of market ID's for which Handler calls callbacks.
/// \note If the list is empty, calls will be made for all ID's.
MarketIds marketIds;
/// Initializes subscription attributes for given market type id, security type and book depth.
MarketSubscription(
MarketType marketType = static_cast<MarketType>(-1)
, MarketSubType::Enum marketSubType = MarketSubType::NonImplied
, SecurityType::Enum securityType = SecurityType::Futures
, BookDepth::Enum bookDepth = BookDepth::TOP5PL
);
/// Returns string representation.
std::string toString() const;
};
/// Allow output to C++ I/) streams.
ONIXS_ICE_IMPACT_MD_API std::ostream& operator<<(std::ostream&, const MarketSubscription&);
/// Collection of market subscriptions.
typedef std::vector<MarketSubscription> MarketSubscriptions;
}}}} // namespace MarketData, iMpact, ICE, OnixS