OpenMS
Loading...
Searching...
No Matches
IDSequencedContainer< Value, Key, KeyMember > Class Template Reference

Records kept in the order they were added, unique by the member KeyMember. More...

#include <OpenMS/METADATA/ID/IDDataContainer.h>

Classes

class  ConstOrderedView
 Lookup of records by key. More...
 
struct  nth_index
 
class  OrderedView
 

Public Types

using value_type = Value
 
using key_type = Key
 
using size_type = std::size_t
 
using iterator = typename std::vector< Value >::const_iterator
 
using const_iterator = iterator
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = reverse_iterator
 

Public Member Functions

 IDSequencedContainer ()=default
 
 IDSequencedContainer (std::initializer_list< Value > values)
 
iterator begin () const
 
iterator end () const
 
iterator cbegin () const
 
iterator cend () const
 
reverse_iterator rbegin () const
 
reverse_iterator rend () const
 
const Value & front () const
 
const Value & back () const
 
bool empty () const
 
size_type size () const
 
void clear ()
 
void swap (IDSequencedContainer &other) noexcept
 
std::pair< iterator, bool > push_back (const Value &value)
 Appends value unless a record with its key exists; then that record and false.
 
std::pair< iterator, bool > insert (const Value &value)
 
template<typename... Args>
std::pair< iterator, bool > emplace_back (Args &&... args)
 
template<typename... Args>
std::pair< iterator, bool > emplace (Args &&... args)
 
iterator erase (iterator position)
 
iterator find (const Key &key) const
 
std::pair< iterator, iterator > equal_range (const Key &key) const
 
template<typename Modifier >
bool modify (iterator &position, Modifier &&modifier)
 As IDDataContainer::modify(): a modification that duplicates another record's key erases the record.
 
template<int Index>
OrderedView get ()
 
template<int Index>
ConstOrderedView get () const
 

Private Attributes

std::vector< Value > records_
 

Friends

bool operator== (const IDSequencedContainer &lhs, const IDSequencedContainer &rhs)
 Value equality is available only for equality-comparable record types.
 

Detailed Description

template<typename Value, typename Key, auto KeyMember>
class OpenMS::IdentificationDataInternal::IDSequencedContainer< Value, Key, KeyMember >

Records kept in the order they were added, unique by the member KeyMember.

Used for the processing steps applied to a record: a handful per record, looked up by step. get<1>() gives the lookup view by key that Boost.MultiIndex's second index used to provide.


Class Documentation

◆ OpenMS::IdentificationDataInternal::IDSequencedContainer::nth_index

struct OpenMS::IdentificationDataInternal::IDSequencedContainer::nth_index
template<typename Value, typename Key, auto KeyMember>
template<int Index>
struct OpenMS::IdentificationDataInternal::IDSequencedContainer< Value, Key, KeyMember >::nth_index< Index >
Class Members
typedef OrderedView type

Member Typedef Documentation

◆ const_iterator

template<typename Value , typename Key , auto KeyMember>
using const_iterator = iterator

◆ const_reverse_iterator

template<typename Value , typename Key , auto KeyMember>
using const_reverse_iterator = reverse_iterator

◆ iterator

template<typename Value , typename Key , auto KeyMember>
using iterator = typename std::vector<Value>::const_iterator

◆ key_type

template<typename Value , typename Key , auto KeyMember>
using key_type = Key

◆ reverse_iterator

template<typename Value , typename Key , auto KeyMember>
using reverse_iterator = std::reverse_iterator<iterator>

◆ size_type

template<typename Value , typename Key , auto KeyMember>
using size_type = std::size_t

◆ value_type

template<typename Value , typename Key , auto KeyMember>
using value_type = Value

Constructor & Destructor Documentation

◆ IDSequencedContainer() [1/2]

template<typename Value , typename Key , auto KeyMember>
IDSequencedContainer ( )
default

◆ IDSequencedContainer() [2/2]

template<typename Value , typename Key , auto KeyMember>
IDSequencedContainer ( std::initializer_list< Value >  values)
inline

Member Function Documentation

◆ back()

template<typename Value , typename Key , auto KeyMember>
const Value & back ( ) const
inline

◆ begin()

◆ cbegin()

template<typename Value , typename Key , auto KeyMember>
iterator cbegin ( ) const
inline

◆ cend()

template<typename Value , typename Key , auto KeyMember>
iterator cend ( ) const
inline

◆ clear()

template<typename Value , typename Key , auto KeyMember>
void clear ( )
inline

◆ emplace()

template<typename Value , typename Key , auto KeyMember>
template<typename... Args>
std::pair< iterator, bool > emplace ( Args &&...  args)
inline

◆ emplace_back()

template<typename Value , typename Key , auto KeyMember>
template<typename... Args>
std::pair< iterator, bool > emplace_back ( Args &&...  args)
inline

◆ empty()

template<typename Value , typename Key , auto KeyMember>
bool empty ( ) const
inline

◆ end()

◆ equal_range()

template<typename Value , typename Key , auto KeyMember>
std::pair< iterator, iterator > equal_range ( const Key &  key) const
inline

◆ erase()

template<typename Value , typename Key , auto KeyMember>
iterator erase ( iterator  position)
inline

◆ find()

◆ front()

template<typename Value , typename Key , auto KeyMember>
const Value & front ( ) const
inline

◆ get() [1/2]

template<typename Value , typename Key , auto KeyMember>
template<int Index>
OrderedView get ( )
inline

◆ get() [2/2]

template<typename Value , typename Key , auto KeyMember>
template<int Index>
ConstOrderedView get ( ) const
inline

◆ insert()

template<typename Value , typename Key , auto KeyMember>
std::pair< iterator, bool > insert ( const Value &  value)
inline

◆ modify()

template<typename Value , typename Key , auto KeyMember>
template<typename Modifier >
bool modify ( iterator &  position,
Modifier &&  modifier 
)
inline

◆ push_back()

template<typename Value , typename Key , auto KeyMember>
std::pair< iterator, bool > push_back ( const Value &  value)
inline

◆ rbegin()

template<typename Value , typename Key , auto KeyMember>
reverse_iterator rbegin ( ) const
inline

◆ rend()

template<typename Value , typename Key , auto KeyMember>
reverse_iterator rend ( ) const
inline

◆ size()

template<typename Value , typename Key , auto KeyMember>
size_type size ( ) const
inline

◆ swap()

template<typename Value , typename Key , auto KeyMember>
void swap ( IDSequencedContainer< Value, Key, KeyMember > &  other)
inlinenoexcept

Friends And Related Symbol Documentation

◆ operator==

template<typename Value , typename Key , auto KeyMember>
bool operator== ( const IDSequencedContainer< Value, Key, KeyMember > &  lhs,
const IDSequencedContainer< Value, Key, KeyMember > &  rhs 
)
friend

Value equality is available only for equality-comparable record types.

Member Data Documentation

◆ records_