OnixS C++ CME Market Data Handler  2.56.0.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
VectorOverArray< ItemType, SizeType > Class Template Reference

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

Public Types

typedef ItemType Item
 
typedef ItemType * Iterator
 
typedef SizeType Index
 
typedef SizeType Size
 

Public Member Functions

 VectorOverArray ()
 Initializes instance with no items.
 
 VectorOverArray (Item *items, Size capacity)
 Initializes instance over given fixed-size array.
 
 ~VectorOverArray ()
 Does nothing.
 
bool empty () const
 Indicates whether instance has no items.
 
Size size () const
 Number of items.
 
Size capacity () const
 Total capacity of container.
 
Iterator begin () const
 Iterator referencing to the first item.
 
Iterator end () const
 Iterator referencing to the item behind the last item.
 
Item & operator[] (Index index) const
 Accesses to item by index.
 
Item & at (Index index) const
 Accesses to item by index checking access bounds. More...
 
Item & extrudingInsert (Index index)
 Inserts new item to given position. More...
 
void eraseAt (Index index)
 Erases item at given position.
 
void resize (Size newSize, const Item &item=Item())
 Resizes container. More...
 
void size (Size newSize)
 Changes size of container without deleting or constructing items (suitable for POD items). More...
 

Protected Member Functions

 VectorOverArray (const VectorOverArray &)
 
VectorOverArrayoperator= (const VectorOverArray &)
 

Protected Attributes

Item * items_
 
Size size_
 
Size capacity_
 

Detailed Description

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

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

Member Function Documentation

Item& at ( Index  index) const
inline

Accesses to item by index checking access bounds.

Item& extrudingInsert ( Index  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.
void resize ( Size  newSize,
const Item &  item = Item() 
)
inline

Resizes container.

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

void size ( Size  newSize)
inline

Changes size of container without deleting or constructing items (suitable for POD items).