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();
151 if (bids_.size() >
depth)
154 if (offers_.size() >
depth)
155 offers_.resize(
depth);
275 class TargetPriceLevel,
276 class SourcePriceLevel,
293 static_cast<Depth
>(-1))
302 target.depth(maxDepth);
325 class PriceLevelType,
382 new Byte [bookSize]);
395 delete []
reinterpret_cast<Byte*
>(book);
409 reinterpret_cast<Entry*
>
411 reinterpret_cast<Byte*
>(block) +
417 entries + 2 * maxDepth);
434 while (first != last)
435 new (first++) Entry();
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Serves as a factory for book of given type.
static size_t calcSize(Depth maxDepth)
MbpBook< DirectPriceLevel, MbpBookDepth > Book
static Book * inplaceConstruct(Depth maxDepth, void *block)
static Book * construct(Depth maxDepth)
static void destruct(Book *book)
Destructs previously constructed book.
const Entries & offers() const
List of ascending offer prices.
VectorOverArray< Entry, Depth > Entries
void reset(BookState::Enum bookState)
void state(BookState::Enum state)
Updates state of book.
Depth depth() const
Returns the maximal number of price levels.
const Entries & bids() const
List of descending bid prices.
Entries::ConstIterator EntryIterator
MbpBook(Depth capacity, Entry *bids, Entry *offers)
void depth(Depth depth)
Updates the maximal number of price levels.
BookState::Enum state() const
Indicates current state of book.
const Item * ConstIterator
void copy(MbpBook< TargetPriceLevel, Depth > &target, const MbpBook< SourcePriceLevel, Depth > &source, Depth maxDepth=static_cast< Depth >(-1))
ONIXS_CONFLATEDUDP_EXPORTED void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
void throwMbpBookRedepthFailure(Depth newDepth, Depth maxDepth)
Raises exception on book re-depth failure.
UInt8 Byte
Alias for Byte.
Tag class for accessing bids in templates.
Tag class for accessing offers in templates.