140 lines
3.8 KiB
C++
Executable File
140 lines
3.8 KiB
C++
Executable File
// 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/MDP3/BookBase.h"
|
|
#include "OnixS/CME/MDP3/BookSnapshot.h"
|
|
#include "OnixS/CME/MDP3/DirectPriceLevel.h"
|
|
|
|
namespace OnixS
|
|
{
|
|
namespace CME
|
|
{
|
|
namespace MDP3
|
|
{
|
|
#if defined (_MSC_VER)
|
|
|
|
template
|
|
class
|
|
ONIXS_CME_MDP3_API
|
|
ArrayRef
|
|
<
|
|
DirectPriceLevel,
|
|
MarketDepth
|
|
>;
|
|
|
|
template
|
|
class
|
|
ONIXS_CME_MDP3_API
|
|
VectorOverArray
|
|
<
|
|
DirectPriceLevel,
|
|
MarketDepth
|
|
>;
|
|
|
|
template
|
|
class
|
|
ONIXS_CME_MDP3_API
|
|
BookBase<DirectPriceLevel>;
|
|
|
|
#endif
|
|
|
|
typedef
|
|
BookBase<DirectPriceLevel>
|
|
DirectBookBase;
|
|
|
|
/// Direct order book.
|
|
class
|
|
ONIXS_CME_MDP3_API
|
|
DirectBook
|
|
: public DirectBookBase
|
|
{
|
|
public:
|
|
/// Disposes allocated resources.
|
|
~DirectBook()
|
|
{
|
|
}
|
|
|
|
/// Returns brief information on given book.
|
|
std::string
|
|
brief() const
|
|
{
|
|
std::string str;
|
|
|
|
brief(str);
|
|
|
|
return str;
|
|
}
|
|
|
|
/// Brief information on given book.
|
|
void brief(std::string&) const;
|
|
|
|
/// String presentation of the book.
|
|
std::string
|
|
toString() const
|
|
{
|
|
std::string str;
|
|
|
|
toString(str);
|
|
|
|
return str;
|
|
}
|
|
|
|
/// String presentation of the book.
|
|
void toString(std::string&) const;
|
|
|
|
/// Constructs book of given capacity.
|
|
static DirectBook* construct(MarketDepth maxDepth);
|
|
|
|
/// Disposes previously constructed instance.
|
|
void operator delete(void* block);
|
|
|
|
protected:
|
|
/// Initializes instance as base does.
|
|
DirectBook(
|
|
SecurityId id,
|
|
MarketDepth depth,
|
|
const EditablePriceLevelsRef& bids,
|
|
const EditablePriceLevelsRef& asks)
|
|
: DirectBookBase(id, depth, bids, asks)
|
|
{
|
|
}
|
|
};
|
|
|
|
#if defined (_MSC_VER)
|
|
|
|
template
|
|
class
|
|
ONIXS_CME_MDP3_API
|
|
std::auto_ptr<DirectBook>;
|
|
|
|
template
|
|
class
|
|
ONIXS_CME_MDP3_API
|
|
BookSnapshot<DirectBook>;
|
|
|
|
#endif
|
|
|
|
typedef
|
|
BookSnapshot<DirectBook>
|
|
DirectBookSnapshot;
|
|
}
|
|
}
|
|
}
|