118 return (items_ + size_);
125 return (items_ + size_);
151 assert(index < size_);
153 return items_[index];
161 assert(index < size_);
163 return items_[index];
173 return items_[index];
175 throw std::out_of_range
177 "Index outside of range."
188 return items_[index];
190 throw std::out_of_range
192 "Index outside of range."
206 assert(index < size_);
208 Item*
const toBeUpdated = items_ + index;
210 Item* target = items_ + size_ - 1;
211 Item* source = target - 1;
213 while (target != toBeUpdated)
217 new (target--)
Item(*source--);
228 assert(index < size_);
231 Item*
const toBeErased = items_ + index;
233 Item* target = toBeErased;
234 Item* source = toBeErased + 1;
236 while (source != theEnd)
240 new (target++)
Item(*source++);
257 assert(newSize <= capacity_);
261 while (size_ != newSize)
262 new (items_ + size_++)
Item(item);
266 while (size_ != newSize)
267 (items_ + --size_)->~
Item();
275 const Size capacity_;
293 TargetSize targetSize,
294 SourceSize sourceSize)
299 "Cannot copy items because number "
300 "of source items exceeds target capacity "
303 toStr(error, sourceSize);
305 error +=
",targetCapacity=";
307 toStr(error, targetSize);
311 throw std::runtime_error(error);
327 <TargetItem, TargetSize>&
331 <SourceItem, TargetSize>&
333 SourceSize itemCount =
334 static_cast<SourceSize
>(-1))
352 target.resize(itemCount);
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
void erase(Size index)
Erases item at given position.
Iterator begin()
Iterator referencing to the first item.
const Item & operator[](Size index) const
Accesses to item by index.
void resize(Size newSize, const Item &item=Item())
Item & operator[](Size index)
Accesses to item by index.
const Item * ConstIterator
bool empty() const
Indicates whether instance has no items.
ConstIterator end() const
Iterator referencing to the item behind the last item.
VectorOverArray(Item *items, Size capacity)
Initializes instance over given fixed-size array.
Item & insertExtrude(Size index)
const Item & front() const
Provides access to the front item if available.
Iterator end()
Iterator referencing to the item behind the last item.
Size size() const
Number of items.
ConstIterator begin() const
Iterator referencing to the first item.
~VectorOverArray()
Cleans everything up.
Item & front()
Provides access to the front item if available.
const Item & at(Size index) const
VectorOverArray()
Initializes instance with no items.
void throwVectorCopyOverflow(TargetSize targetSize, SourceSize sourceSize)
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.