![]() |
fix8
version 1.4.0
Open Source C++ FIX Framework
|
#include <traits.hpp>
Public Types | |
using | iterator = FieldTrait * |
using | const_iterator = const FieldTrait * |
using | result = std::pair< iterator, bool > |
Public Member Functions | |
presorted_set (const_iterator arr_start, const size_t sz, const FieldTrait_Hash_Array *ftha) | |
presorted_set (const_iterator arr_start, const size_t sz, const size_t reserve=FIX8_RESERVE_PERCENT) | |
presorted_set (const presorted_set &from) | |
presorted_set (const size_t sz=0, const size_t reserve=FIX8_RESERVE_PERCENT) | |
~presorted_set () | |
dtor More... | |
iterator | find (const FieldTrait what, bool &answer) |
iterator | find (const unsigned short key, bool &answer) |
const_iterator | find (const unsigned short key) const |
const_iterator | find (const FieldTrait what) const |
iterator | find (const unsigned short key) |
iterator | find (const FieldTrait what) |
const_iterator | at (const size_t idx) const |
result | insert (const_iterator what) |
void | insert (const_iterator what_begin, const_iterator what_end) |
void | clear () |
size_t | size () const |
bool | empty () const |
size_t | rsize () const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
Static Public Member Functions | |
static size_t | calc_reserve (size_t sz, size_t res) |
static size_t | distance (const_iterator what_begin, const_iterator what_end) |
Private Types | |
using | internal_result = std::pair< iterator, iterator > |
using | const_internal_result = std::pair< const_iterator, const_iterator > |
Private Attributes | |
size_t | _reserve |
size_t | _sz |
size_t | _rsz |
FieldTrait * | _arr |
const FieldTrait_Hash_Array * | _ftha |
Specialisation of Presorted set using hash array lookup Search complexity is O(1), ctor complexity approaches O(1), no insert
Definition at line 218 of file traits.hpp.
|
private |
Definition at line 244 of file traits.hpp.
using FIX8::presorted_set< unsigned short, FieldTrait, FieldTrait::Compare >::const_iterator = const FieldTrait* |
Definition at line 222 of file traits.hpp.
|
private |
Definition at line 243 of file traits.hpp.
using FIX8::presorted_set< unsigned short, FieldTrait, FieldTrait::Compare >::iterator = FieldTrait* |
Definition at line 221 of file traits.hpp.
using FIX8::presorted_set< unsigned short, FieldTrait, FieldTrait::Compare >::result = std::pair<iterator, bool> |
Definition at line 223 of file traits.hpp.
|
inline |
ctor - initialise from static sorted set. Used by Message encoder/decoder.
arr_start | pointer to start of static array to copy elements from |
sz | number of elements in set to copy |
ftha | pointer to field hash array |
Definition at line 251 of file traits.hpp.
|
inline |
ctor - initialise an empty set; defer memory allocation;
arr_start | pointer to start of static array to copy elements from |
sz | number of elements to initially allocate |
reserve | percentage of sz to keep in reserve |
Definition at line 259 of file traits.hpp.
|
inline |
copy ctor
from | presorted_set object to copy |
Definition at line 265 of file traits.hpp.
References FIX8::presorted_set< K, T, Comp >::_arr.
|
inlineexplicit |
ctor - initialise an empty set; defer memory allocation;
sz | number of elements to initially allocate |
reserve | percentage of sz to keep in reserve |
Definition at line 272 of file traits.hpp.
|
inline |
dtor
Definition at line 276 of file traits.hpp.
References FIX8::presorted_set< K, T, Comp >::_arr.
|
inline |
Get the element at index location
idx | of the pair to retrieve |
Definition at line 344 of file traits.hpp.
References FIX8::presorted_set< K, T, Comp >::end().
Referenced by FIX8::ConsoleMenu::SelectField().
|
inline |
Get a pointer to the first element
Definition at line 418 of file traits.hpp.
References FIX8::presorted_set< K, T, Comp >::_arr.
Referenced by FIX8::FieldTraits::clear_flag(), FIX8::FieldTraits::find_missing(), generate_group_traits(), FIX8::operator<<(), and FIX8::ConsoleMenu::SelectField().
|
inline |
Get a const pointer to the first element
Definition at line 426 of file traits.hpp.
References FIX8::presorted_set< K, T, Comp >::_arr.
|
inlinestatic |
Calculate the amount of space to reserve in set
sz | number of elements currently in set; if 0 retun reserve elements as size to reserve |
res | percentage of sz to keep in reserve |
Definition at line 229 of file traits.hpp.
|
inline |
|
inlinestatic |
Find the distance between two iterators
what_begin | start iterator |
what_end | end iterator (must be >= to what_begin |
Definition at line 388 of file traits.hpp.
|
inline |
|
inline |
Get a pointer to the last element + 1
Definition at line 422 of file traits.hpp.
References FIX8::presorted_set< K, T, Comp >::_sz.
Referenced by FIX8::MessageBase::add_field(), FIX8::FieldTraits::clear(), FIX8::FieldTraits::clear_flag(), FIX8::MessageBase::copy_legal(), FIX8::ConsoleMenu::EditMsg(), FIX8::FieldTraits::find_missing(), generate_group_traits(), FIX8::FieldTraits::get(), FIX8::FieldTraits::getComp(), FIX8::FieldTraits::getPos(), FIX8::FieldTraits::getval(), FIX8::FieldTraits::has(), FIX8::operator<<(), FIX8::ConsoleMenu::SelectField(), and FIX8::FieldTraits::set().
|
inline |
Get a const pointer to the last element + 1
Definition at line 430 of file traits.hpp.
References FIX8::presorted_set< K, T, Comp >::_sz.
|
inline |
Find an element with the given value
what | element to find |
answer | true if element is found |
Definition at line 282 of file traits.hpp.
References FIX8::FieldTrait_Hash_Array::_arr, FIX8::FieldTrait::_fnum, and FIX8::FieldTrait_Hash_Array::_sz.
Referenced by FIX8::FieldTraits::clear(), FIX8::FieldTraits::get(), FIX8::FieldTraits::getComp(), FIX8::FieldTraits::getPos(), FIX8::FieldTraits::getval(), FIX8::FieldTraits::has(), and FIX8::FieldTraits::set().
|
inline |
Find an element with the given key
key | to find |
answer | true if element is found |
Definition at line 295 of file traits.hpp.
References find().
Referenced by find().
|
inline |
Find an element with the given key (const version)
key | to find |
Definition at line 300 of file traits.hpp.
References FIX8::FieldTrait_Hash_Array::_arr, FIX8::FieldTrait_Hash_Array::_sz, and FIX8::presorted_set< K, T, Comp >::end().
|
inline |
Find an element with the given value (const version)
what | element to find |
Definition at line 312 of file traits.hpp.
References FIX8::FieldTrait_Hash_Array::_arr, FIX8::FieldTrait::_fnum, FIX8::FieldTrait_Hash_Array::_sz, and FIX8::presorted_set< K, T, Comp >::end().
|
inline |
Find an element with the given key
key | to find |
Definition at line 323 of file traits.hpp.
References FIX8::FieldTrait_Hash_Array::_arr, FIX8::FieldTrait_Hash_Array::_sz, and FIX8::presorted_set< K, T, Comp >::end().
|
inline |
Find an element with the given value
what | value to find |
Definition at line 335 of file traits.hpp.
References FIX8::presorted_set< K, T, Comp >::end().
|
inline |
Insert an element into the set
what | pointer to element to insert |
Definition at line 349 of file traits.hpp.
References FIX8::presorted_set< K, T, Comp >::_arr, FIX8::presorted_set< K, T, Comp >::_rsz, FIX8::presorted_set< K, T, Comp >::_sz, FIX8::presorted_set< K, T, Comp >::calc_reserve(), FIX8::presorted_set< K, T, Comp >::end(), and FIX8::presorted_set< K, T, Comp >::find().
Referenced by FIX8::FieldTraits::add().
|
inline |
Insert a range of elements into the set
what_begin | pointer to 1st element to insert |
what_end | pointer to nth element + 1 to insert |
Definition at line 394 of file traits.hpp.
References FIX8::presorted_set< K, T, Comp >::insert().
|
inline |
Obtain the number of elements that can be inserted before reallocating
Definition at line 414 of file traits.hpp.
References FIX8::presorted_set< K, T, Comp >::_rsz.
|
inline |
Obtain the number of elements in the set
Definition at line 406 of file traits.hpp.
References FIX8::presorted_set< K, T, Comp >::_sz.
Referenced by generate_group_bodies(), generate_group_traits(), FIX8::ConsoleMenu::SelectField(), and FIX8::FieldTraits::size().
|
private |
Definition at line 240 of file traits.hpp.
|
private |
Definition at line 241 of file traits.hpp.
|
private |
Definition at line 238 of file traits.hpp.
|
private |
Definition at line 239 of file traits.hpp.
|
private |
Definition at line 239 of file traits.hpp.