OnixS C++ CME MDP Premium Market Data Handler 5.10.3
Users' manual and API documentation
Loading...
Searching...
No Matches
TinySet< Key > Class Template Reference

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

Public Types

typedef Key Item
typedef std::vector< ItemItems
typedef Items::const_iterator ConstIterator

Public Member Functions

 TinySet ()
 TinySet (size_t capacity)
 TinySet (const TinySet &other)
 ~TinySet ()
bool empty () const
size_t size () const
void reserve (size_t capacity)
ConstIterator begin () const
ConstIterator end () const
ConstIterator find (const Item &item) const
bool insert (const Item &item)
bool erase (const Item &item)
void clear ()
void swap (TinySet &other)
TinySetoperator= (const TinySet &other)

Detailed Description

template<class Key>
class OnixS::CME::MDH::TinySet< Key >

Class implementing set optimized for storing small number of items.

Definition at line 35 of file TinySet.h.

Member Typedef Documentation

◆ ConstIterator

template<class Key>
typedef Items::const_iterator ConstIterator

Aliases iterator over set items.

Definition at line 45 of file TinySet.h.

◆ Item

template<class Key>
typedef Key Item

Aliases set item type.

Definition at line 39 of file TinySet.h.

◆ Items

template<class Key>
typedef std::vector<Item> Items

Aliases internal representation.

Definition at line 42 of file TinySet.h.

Constructor & Destructor Documentation

◆ TinySet() [1/3]

template<class Key>
TinySet ( )
inline

Initializes the empty set.

Definition at line 48 of file TinySet.h.

◆ TinySet() [2/3]

template<class Key>
TinySet ( size_t capacity)
inlineexplicit

Initializes the empty set and configures the internal storage to be enough capacious to store the given number of items.

Definition at line 53 of file TinySet.h.

◆ TinySet() [3/3]

template<class Key>
TinySet ( const TinySet< Key > & other)
inline

Initializes the set as a copy of the other one.

Definition at line 59 of file TinySet.h.

◆ ~TinySet()

template<class Key>
~TinySet ( )
inline

Cleans everything up.

Definition at line 65 of file TinySet.h.

Member Function Documentation

◆ begin()

template<class Key>
ConstIterator begin ( ) const
inline

Provides iterating facilities.

Definition at line 87 of file TinySet.h.

◆ clear()

template<class Key>
void clear ( )
inline

Brings the set to the blank state.

Definition at line 138 of file TinySet.h.

◆ empty()

template<class Key>
bool empty ( ) const
inline

Indicates whether the set is empty.

Definition at line 68 of file TinySet.h.

◆ end()

template<class Key>
ConstIterator end ( ) const
inline

Provides iterating facilities.

Definition at line 93 of file TinySet.h.

◆ erase()

template<class Key>
bool erase ( const Item & item)
inline

Removes the given item from the set.

Returned value indicates whether the item was actually removed.

Definition at line 125 of file TinySet.h.

◆ find()

template<class Key>
ConstIterator find ( const Item & item) const
inline

Tells whether the set contains given item.

Definition at line 99 of file TinySet.h.

◆ insert()

template<class Key>
bool insert ( const Item & item)
inline

Inserts the given item into the set.

Returned value indicates whether the item was inserted (true) or the set already contained the given item (false).

Definition at line 109 of file TinySet.h.

◆ operator=()

template<class Key>
TinySet & operator= ( const TinySet< Key > & other)
inline

Re-initializes the instance as a copy of the other one.

Definition at line 151 of file TinySet.h.

◆ reserve()

template<class Key>
void reserve ( size_t capacity)
inline

Makes the internal storage capacious enough to store the given number of items.

Definition at line 81 of file TinySet.h.

◆ size()

template<class Key>
size_t size ( ) const
inline

Returns the number of items in the set.

Definition at line 74 of file TinySet.h.

◆ swap()

template<class Key>
void swap ( TinySet< Key > & other)
inline

Swaps content with the other instance.

Definition at line 144 of file TinySet.h.