42 Depth newDepth, Depth maxDepth)
47 "Cannot re-depth order book " 48 "due to lack of capacity [newDepth=";
50 toStr(error, newDepth);
52 error +=
",maxDepth=";
54 toStr(error, maxDepth);
58 throw std::runtime_error(error);
136 return bids_.capacity();
144 if (depth > capacity())
151 if (bids_.size() > depth)
154 if (offers_.size() > depth)
155 offers_.resize(depth);
279 class TargetPriceLevel,
280 class SourcePriceLevel,
287 Depth maxDepth = static_cast<Depth>(-1))
289 if (maxDepth > source.
depth())
290 maxDepth = source.
depth();
292 target.
depth(maxDepth);
310 class PriceLevelType,
367 new Byte [bookSize]);
380 delete []
reinterpret_cast<Byte*
>(book);
394 reinterpret_cast<Entry*
> 396 reinterpret_cast<Byte*
>(block) +
402 entries + 2 * maxDepth);
419 while (first != last)
420 new (first++)
Entry();
void depth(Depth depth)
Updates the maximal number of price levels.
UInt8 Byte
Alias for Byte.
static size_t calcSize(Depth maxDepth)
void reset(BookState::Enum bookState)
Tag class for accessing bids in templates.
BookState::Enum state() const
Indicates current state of book.
static Book * inplaceConstruct(Depth maxDepth, void *block)
Constructs book on a given memory block.
static Book * construct(Depth maxDepth)
EntryType Entry
Indicates price level data type.
Entries::ConstIterator EntryIterator
Iterator over bids and offers.
MbpBook< PriceLevelType, DepthType > Book
Type of book constructed by given factory.
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Depth depth() const
Returns the maximal number of price levels.
const Entries & bids() const
List of descending bid prices.
void state(BookState::Enum state)
Updates state of book.
MbpBook(Depth capacity, Entry *bids, Entry *offers)
void copy(MbpBook< TargetPriceLevel, Depth > &target, const MbpBook< SourcePriceLevel, Depth > &source, Depth maxDepth=static_cast< Depth >(-1))
static void destruct(Book *book)
Destructs previously constructed book.
Book::Entry Entry
Book entry type.
DepthType Depth
Aliases book dimension type.
Entries & bids()
List of descending bid prices.
Entries & offers()
List of ascending offer prices.
VectorOverArray< Entry, Depth > Entries
Collection of price levels allowing modifications.
const Item * ConstIterator
Aliases constant iterator type.
void throwMbpBookRedepthFailure(Depth newDepth, Depth maxDepth)
Raises exception on book re-depth failure.
Book::Depth Depth
Book depth type.
const Entries & offers() const
List of ascending offer prices.
Serves as a factory for book of given type.
Tag class for accessing offers in templates.
ONIXS_CMEMDH_EXPORTED void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
#define ONIXS_CMEMDH_NAMESPACE_END