125 typedef std::vector<PriceLevel>
Array;
164 size_t depth()
const;
207 void*
operator new (
size_t bookSize);
211 void operator delete (
void* book);
246 return bids().empty() &&
asks().empty();
Decimal type for better precision.
PriceLevels PriceLevelsType
virtual bool bestAsk(Decimal &price, Quantity &quantity) const =0
Returns best implied ask.
std::string toString() const
String presentation of the book.
virtual ~OrderBook()
Destruction interface.
OrderBook * snapshot() const
Creates immutable snapshot of the book.
std::string toFormattedString() const
Returns formatted presentation of the book.
virtual UInt32 lastMsgSeqNumProcessed() const =0
Sequence number of the last processed message.
bool empty() const
Indicates whether book has no bids & asks.
size_t depth() const
Returns the maximum book depth.
void toFormattedString(std::string &) const
Appends Formatted presentation of the book.
void toString(std::string &) const
String presentation of the book.
virtual const PriceLevels & asks() const =0
Returns a set of descending bid prices for the given security.
virtual bool bestBid(Decimal &price, Quantity &quantity) const =0
Returns best implied bid.
SecurityId securityId() const
void toShortString(std::string &) const
Appends brief book info to the string.
std::string toShortString() const
Returns brief book info.
OrderBook(SecurityId securityId, size_t bookDepth)
virtual const PriceLevels & bids() const =0
Returns a set of ascending ask prices for the given security.
virtual UInt64 mdEntryTime() const =0
For bids and offers the official time of book entry, for trades official time of execution (all in na...
UInt64 Quantity
Alias for Quantity type.
PriceLevelCollections::Array PriceLevels
Sequence of price levels.
std::ostream & operator<<(std::ostream &os, const Message &message)
bool operator==(const FieldValueRef &ref, const std::string &str)
bool isValid(const PriceLevel &level)
Int64 SecurityId
Alias for Security Id type.
PriceLevelCollections::ArrayEntry PriceLevelsEntry
Iterator to access price levels with write permissions.
PriceLevelCollections::ArrayConstEntry PriceLevelsConstEntry
Iterator over read-only collection of price levels.
void checkSanity(const OrderBook &book)
checks whether the given book is properly built
Miscellaneous traits for PriceLevel class.
Array::iterator ArrayEntry
Mutable entry iterator.
std::vector< PriceLevel > Array
Sequential collection of price levels.
Array::const_iterator ArrayConstEntry
Iterator for read-only access.
Encapsulates price level concept.
std::string toString() const
Returns string representation of the instance.
PriceLevel(Decimal price, Quantity quantity, Quantity numberOfOrders)
Initializes the instances according to specified attributes.
PriceLevel()
Default initialization.
Decimal price() const
Price value.
Quantity numberOfOrders() const
Total number of orders of given price.
Quantity quantity() const
Quantify for the given price.
void toString(std::string &) const
Appends representation of the instance to the string.