OnixS C++ CME MDP Premium Market Data Handler 5.10.2
Users' manual and API documentation
Loading...
Searching...
No Matches
VectorOverArray< ItemType, SizeType > Class Template Reference

#include <OnixS/CME/MDH/VectorOverArray.h>

Public Types

typedef ItemType Item
typedef SizeType Size
typedef const ItemConstIterator
typedef ItemIterator

Public Member Functions

 VectorOverArray ()
 VectorOverArray (Item *items, Size capacity)
 ~VectorOverArray ()
bool empty () const
Size size () const
Size capacity () const
Iterator begin ()
ConstIterator begin () const
Iterator end ()
ConstIterator end () const
Itemfront ()
const Itemfront () const
Itemoperator[] (Size index)
const Itemoperator[] (Size index) const
Itemat (Size index)
const Itemat (Size index) const
IteminsertExtrude (Size index)
void erase (Size index)
void resize (Size newSize, const Item &item=Item())

Detailed Description

template<typename ItemType, typename SizeType>
class OnixS::CME::MDH::VectorOverArray< ItemType, SizeType >

Implements vector-like container over built-in array of fixed size being referenced.

Definition at line 37 of file VectorOverArray.h.

Member Typedef Documentation

◆ ConstIterator

template<typename ItemType, typename SizeType>
typedef const Item* ConstIterator

Aliases constant iterator type.

Definition at line 47 of file VectorOverArray.h.

◆ Item

template<typename ItemType, typename SizeType>
typedef ItemType Item

Aliases container item type.

Definition at line 41 of file VectorOverArray.h.

◆ Iterator

template<typename ItemType, typename SizeType>
typedef Item* Iterator

Aliases mutable iterator type.

Definition at line 50 of file VectorOverArray.h.

◆ Size

template<typename ItemType, typename SizeType>
typedef SizeType Size

Aliases dimension type.

Definition at line 44 of file VectorOverArray.h.

Constructor & Destructor Documentation

◆ VectorOverArray() [1/2]

template<typename ItemType, typename SizeType>
VectorOverArray ( )
inline

Initializes instance with no items.

Definition at line 53 of file VectorOverArray.h.

◆ VectorOverArray() [2/2]

template<typename ItemType, typename SizeType>
VectorOverArray ( Item * items,
Size capacity )
inline

Initializes instance over given fixed-size array.

Definition at line 61 of file VectorOverArray.h.

◆ ~VectorOverArray()

template<typename ItemType, typename SizeType>
~VectorOverArray ( )
inline

Cleans everything up.

Definition at line 69 of file VectorOverArray.h.

Member Function Documentation

◆ at() [1/2]

template<typename ItemType, typename SizeType>
Item & at ( Size index)
inline

Accesses to item by index checking access bounds.

Definition at line 150 of file VectorOverArray.h.

◆ at() [2/2]

template<typename ItemType, typename SizeType>
const Item & at ( Size index) const
inline

Accesses to item by index checking access bounds.

Definition at line 160 of file VectorOverArray.h.

◆ begin() [1/2]

template<typename ItemType, typename SizeType>
Iterator begin ( )
inline

Iterator referencing to the first item.

Definition at line 93 of file VectorOverArray.h.

◆ begin() [2/2]

template<typename ItemType, typename SizeType>
ConstIterator begin ( ) const
inline

Iterator referencing to the first item.

Definition at line 99 of file VectorOverArray.h.

◆ capacity()

template<typename ItemType, typename SizeType>
Size capacity ( ) const
inline

Total capacity of container.

Definition at line 87 of file VectorOverArray.h.

◆ empty()

template<typename ItemType, typename SizeType>
bool empty ( ) const
inline

Indicates whether instance has no items.

Definition at line 75 of file VectorOverArray.h.

◆ end() [1/2]

template<typename ItemType, typename SizeType>
Iterator end ( )
inline

Iterator referencing to the item behind the last item.

Definition at line 105 of file VectorOverArray.h.

◆ end() [2/2]

template<typename ItemType, typename SizeType>
ConstIterator end ( ) const
inline

Iterator referencing to the item behind the last item.

Definition at line 111 of file VectorOverArray.h.

◆ erase()

template<typename ItemType, typename SizeType>
void erase ( Size index)
inline

Erases item at given position.

Definition at line 195 of file VectorOverArray.h.

◆ front() [1/2]

template<typename ItemType, typename SizeType>
Item & front ( )
inline

Provides access to the front item if available.

Definition at line 117 of file VectorOverArray.h.

◆ front() [2/2]

template<typename ItemType, typename SizeType>
const Item & front ( ) const
inline

Provides access to the front item if available.

Definition at line 125 of file VectorOverArray.h.

◆ insertExtrude()

template<typename ItemType, typename SizeType>
Item & insertExtrude ( Size index)
inline

Inserts new item to given position. Items under higher indices are moved back. Last item is extruded thus keeping size of or container constant.

Returns
Reference to an item at requested position for further update.

Definition at line 175 of file VectorOverArray.h.

◆ operator[]() [1/2]

template<typename ItemType, typename SizeType>
Item & operator[] ( Size index)
inline

Accesses to item by index.

Definition at line 133 of file VectorOverArray.h.

◆ operator[]() [2/2]

template<typename ItemType, typename SizeType>
const Item & operator[] ( Size index) const
inline

Accesses to item by index.

Definition at line 141 of file VectorOverArray.h.

◆ resize()

template<typename ItemType, typename SizeType>
void resize ( Size newSize,
const Item & item = Item() )
inline

Resizes container.

If vector is enlarged, new items constructed as copies of given instance.

Definition at line 221 of file VectorOverArray.h.

◆ size()

template<typename ItemType, typename SizeType>
Size size ( ) const
inline

Number of items.

Definition at line 81 of file VectorOverArray.h.