Files

134 lines
3.1 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 <OnixS/CME/MDH/NetFeedAttributes.h>
#include <OnixS/CME/MDH/NetFeedConnection.h>
#include <OnixS/CME/MDH/Time.h>
ONIXS_CMEMDH_NAMESPACE_BEGIN
/// Base attributes of market data feed.
ONIXS_CMEMDH_LTWT_CLASS NetFeed
{
TimeSpan receiveTimeout_;
NetFeedConnection connection_;
NetFeedType::Enum type_;
NetFeedRole::Enum role_;
std::string id_;
NetFeed(const NetFeed&);
NetFeed& operator =(const NetFeed&);
protected:
/// Class serves as basement for implementations.
NetFeed()
{
}
/// Class serves as basement for implementations.
~NetFeed()
{
}
public:
/// Identifier associated with feed.
const std::string& id() const
{
return id_;
}
/// Assigns identifier.
void
id(
const std::string& id)
{
id_ = id;
}
/// Type of service (incremental, instrument, etc).
NetFeedType::Enum type() const
{
return type_;
}
/// Assigns feed service type.
void type(NetFeedType::Enum type)
{
type_ = type;
}
/// Role in a service (primary, secondary).
NetFeedRole::Enum role() const
{
return role_;
}
/// Assigns feed service role.
void role(NetFeedRole::Enum role)
{
role_ = role;
}
/// Connection attributes (overload for modifications).
NetFeedConnection& connection()
{
return connection_;
}
/// Connection attributes (read-only access).
const
NetFeedConnection&
connection() const
{
return connection_;
}
/// Maximal time interval between two packets transmitted.
const
TimeSpan&
receiveTimeout() const
{
return receiveTimeout_;
}
/// Updates time interval between two packets transmitted.
void
receiveTimeout(
UInt32 timeInterval)
{
receiveTimeout_ =
TimeSpan(
0,
0,
timeInterval,
0);
}
};
ONIXS_CMEMDH_NAMESPACE_END