OnixS C++ CME MDP Premium Market Data Handler 5.11.1
Users' manual and API documentation
Loading...
Searching...
No Matches
ListSetting< Type, Container > Class Template Reference

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

Public Types

using Item = Type
using Items = Container
using Size = typename Items::size_type
using Iterator = typename Items::const_iterator

Public Member Functions

 ListSetting (const SettingGroup *group=nullptr)
 ListSetting (const ListSetting &other)
template<class InputIterator>
 ListSetting (InputIterator first, InputIterator last)
 operator const Items & () const
bool empty () const
Size size () const
Iterator begin () const
Iterator end () const
const Item & operator[] (Size index) const
template<class Initializer>
void initialize (Initializer initializer)
void push_back (const Item &item)
void clear ()
ListSetting & operator= (const ListSetting &other)
template<class InputIterator>
ListSetting & assign (InputIterator first, InputIterator last)
ListSetting & assignNoControl (const ListSetting &other)

Detailed Description

template<class Type, class Container = std::vector<Type>>
class OnixS::CME::MDH::ListSetting< Type, Container >
Template Parameters
TypeType of each stored item.
ContainerContainer used to store the items. It must provide the std::vector-like types and operations used by each instantiated member.
Note
A list constructed with a group does not own that group. The group must outlive the list. Copy and range construction use SettingGroup::null().

Definition at line 234 of file SettingGroup.h.

Member Typedef Documentation

◆ Item

template<class Type, class Container = std::vector<Type>>
using Item = Type

Type stored in the list.

Definition at line 238 of file SettingGroup.h.

◆ Items

template<class Type, class Container = std::vector<Type>>
using Items = Container

Container used to store list items.

Definition at line 241 of file SettingGroup.h.

◆ Iterator

template<class Type, class Container = std::vector<Type>>
using Iterator = typename Items::const_iterator

Read-only iterator over list items.

Definition at line 247 of file SettingGroup.h.

◆ Size

template<class Type, class Container = std::vector<Type>>
using Size = typename Items::size_type

Type used for list sizes and indices.

Definition at line 244 of file SettingGroup.h.

Constructor & Destructor Documentation

◆ ListSetting() [1/3]

template<class Type, class Container = std::vector<Type>>
ListSetting ( const SettingGroup * group = nullptr)
inlineexplicit

Creates an empty list associated with a setting group.

Parameters
groupGroup that controls mutations, or null for the shared null group.
Exceptions
Anyexception thrown by the container default constructor.
Note
A non-null group must outlive this list.

Definition at line 253 of file SettingGroup.h.

◆ ListSetting() [2/3]

template<class Type, class Container = std::vector<Type>>
ListSetting ( const ListSetting< Type, Container > & other)
inline

Copies another list's items into an unmanaged list.

Parameters
otherList whose items are copied.
Exceptions
Anyexception thrown by the container copy constructor.
Note
The new list uses SettingGroup::null(); it does not copy the source's group association.

Definition at line 262 of file SettingGroup.h.

◆ ListSetting() [3/3]

template<class Type, class Container = std::vector<Type>>
template<class InputIterator>
ListSetting ( InputIterator first,
InputIterator last )
inline

Creates an unmanaged list from an iterator range.

Template Parameters
InputIteratorInput iterator type accepted by the container.
Parameters
firstBeginning of the source range.
lastEnd of the source range.
Exceptions
Anyexception thrown by the container range constructor.
Note
The new list uses SettingGroup::null().

Definition at line 275 of file SettingGroup.h.

Member Function Documentation

◆ assign()

template<class Type, class Container = std::vector<Type>>
template<class InputIterator>
ListSetting & assign ( InputIterator first,
InputIterator last )
inline

Replaces the items with a guarded copy of an iterator range.

Template Parameters
InputIteratorInput iterator type accepted by the container.
Parameters
firstBeginning of the source range.
lastEnd of the source range.
Returns
Reference to this list.
Exceptions
std::runtime_errorIf the list belongs to a handler that is processing market data or being configured from another source.
Anyexception thrown by the change controller or container range-assignment operation.
Note
The source iterators must satisfy the requirements of Container::assign().

Definition at line 395 of file SettingGroup.h.

◆ assignNoControl()

template<class Type, class Container = std::vector<Type>>
ListSetting & assignNoControl ( const ListSetting< Type, Container > & other)
inline

Replaces the items without consulting the change controller.

Parameters
otherList whose items are copied.
Returns
Reference to this list.
Exceptions
Anyexception thrown by container copy assignment.
Note
Intended for updates already protected by an outer managed change. Ordinary callers should use operator= instead.

Definition at line 408 of file SettingGroup.h.

◆ begin()

template<class Type, class Container = std::vector<Type>>
Iterator begin ( ) const
inline

Obtains an iterator to the first item.

Returns
Beginning of the stored range, equal to end() when empty.

Definition at line 310 of file SettingGroup.h.

◆ clear()

template<class Type, class Container = std::vector<Type>>
void clear ( )
inline

Removes all items through the associated change controller.

Exceptions
std::runtime_errorIf the list belongs to a handler that is processing market data or being configured from another source.
Anyexception thrown by the change controller or container clear operation.
Note
Invalidates iterators and references to stored items according to the container's invalidation rules.

Definition at line 366 of file SettingGroup.h.

◆ empty()

template<class Type, class Container = std::vector<Type>>
bool empty ( ) const
inline

Checks whether the list contains no items.

Returns
true when the list is empty; otherwise false.

Definition at line 294 of file SettingGroup.h.

◆ end()

template<class Type, class Container = std::vector<Type>>
Iterator end ( ) const
inline

Obtains an iterator past the final item.

Returns
End of the stored range.

Definition at line 318 of file SettingGroup.h.

◆ initialize()

template<class Type, class Container = std::vector<Type>>
template<class Initializer>
void initialize ( Initializer initializer)
inline

Replaces the list contents through a guarded initializer callback.

Template Parameters
InitializerType of the callable used by the initialization routine.
Parameters
initializerCallable passed by value to populate the cleared underlying container.
Exceptions
std::runtime_errorIf the list belongs to a handler that is processing market data or being configured from another source.
Anyexception thrown by the change controller, initializer copies, initializer invocation, or the container clear operation.
Note
The current contents are cleared before the initializer is invoked. If the initializer throws, the list remains empty or partially initialized.

Definition at line 343 of file SettingGroup.h.

◆ operator const Items &()

template<class Type, class Container = std::vector<Type>>
operator const Items & ( ) const
inline

Provides read-only access to the underlying container.

Returns
Reference to the container owned by this list.
Note
The reference remains valid until this list is destroyed. References and iterators to individual items follow the container's invalidation rules.

Definition at line 286 of file SettingGroup.h.

◆ operator=()

template<class Type, class Container = std::vector<Type>>
ListSetting & operator= ( const ListSetting< Type, Container > & other)
inline

Replaces the items with a guarded copy of another list.

Parameters
otherList whose items are copied.
Returns
Reference to this list.
Exceptions
std::runtime_errorIf the list belongs to a handler that is processing market data or being configured from another source.
Anyexception thrown by the change controller or container copy assignment.
Note
The destination retains its existing group association.

Definition at line 378 of file SettingGroup.h.

◆ operator[]()

template<class Type, class Container = std::vector<Type>>
const Item & operator[] ( Size index) const
inline

Accesses an item without bounds checking.

Parameters
indexZero-based index of the item to access.
Returns
Read-only reference to the selected item.
Note
index must be less than size().

Definition at line 328 of file SettingGroup.h.

◆ push_back()

template<class Type, class Container = std::vector<Type>>
void push_back ( const Item & item)
inline

Appends a copy of an item through the associated change controller.

Parameters
itemItem to append.
Exceptions
std::runtime_errorIf the list belongs to a handler that is processing market data or being configured from another source.
Anyexception thrown by the change controller or container insertion operation.

Definition at line 353 of file SettingGroup.h.

◆ size()

template<class Type, class Container = std::vector<Type>>
Size size ( ) const
inline

Obtains the number of items in the list.

Returns
Current number of items.

Definition at line 302 of file SettingGroup.h.