![]() |
aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
|
The internal class for storing (ordered) sequences of objects. More...
#include <agrum/base/core/sequence.h>
Public Types | |
| using | value_type = Key |
| Types for STL compliance. | |
| using | reference = Key& |
| Types for STL compliance. | |
| using | const_reference = const Key& |
| Types for STL compliance. | |
| using | pointer = Key* |
| Types for STL compliance. | |
| using | const_pointer = const Key* |
| Types for STL compliance. | |
| using | size_type = std::size_t |
| Types for STL compliance. | |
| using | difference_type = std::ptrdiff_t |
| Types for STL compliance. | |
| using | iterator = SequenceIterator< Key > |
| Types for STL compliance. | |
| using | const_iterator = SequenceIterator< Key > |
| Types for STL compliance. | |
| using | iterator_safe = SequenceIteratorSafe< Key > |
| Types for STL compliance. | |
| using | const_iterator_safe = SequenceIteratorSafe< Key > |
| Types for STL compliance. | |
Public Member Functions | |
Destructor | |
| ~SequenceImplementation () noexcept | |
| Class destructor. | |
Iterators | |
| iterator_safe | beginSafe () const |
| Returns a safe begin iterator. | |
| iterator_safe | rbeginSafe () const |
| Returns a safe rbegin iterator. | |
| const iterator_safe & | endSafe () const noexcept |
| Returns the safe end iterator. | |
| const iterator_safe & | rendSafe () const noexcept |
| Returns the safe rend iterator. | |
| iterator | begin () const |
| Returns an unsafe begin iterator. | |
| iterator | rbegin () const |
| Returns an unsafe rbegin iterator. | |
| const iterator & | end () const noexcept |
| Returns the unsafe end iterator. | |
| const iterator & | rend () const noexcept |
| Returns the unsafe rend iterator. | |
Operators | |
| SequenceImplementation< Key, Gen > & | operator<< (const Key &k) |
| Insert k at the end of the sequence (synonym for insert). | |
| SequenceImplementation< Key, Gen > & | operator<< (Key &&k) |
| Insert k at the end of the sequence (synonym for insert). | |
| SequenceImplementation< Key, Gen > & | operator>> (const Key &k) |
| Remove k in the sequence (synonym for erase). | |
| const Key & | operator[] (Idx i) const |
| Returns the element at position i (synonym for atPos). | |
| bool | operator== (const SequenceImplementation< Key, Gen > &k) const |
| Returns true if the content of k equals that of *this. | |
| bool | operator!= (const SequenceImplementation< Key, Gen > &k) const |
| Returns true if the content of k is different from that of *this. | |
Accessors / Modifiers | |
| void | clear () |
| Clear the sequence. | |
| Size | size () const noexcept |
| Returns the size of the sequence. | |
| bool | empty () const noexcept |
| Return true if empty. | |
| bool | exists (const Key &k) const |
| Check the existence of k in the sequence. | |
| optional_ref< const Idx > | tryPos (const Key &k) const |
| Returns a pointer to the position of k in the sequence, or nullptr if k is not found. | |
| void | insert (const Key &k) |
| Insert an element at the end of the sequence. | |
| void | insert (Key &&k) |
| Move an element at the end of the sequence. | |
| template<typename... Args> | |
| void | emplace (Args &&... args) |
| Emplace a new element in the sequence. | |
| void | erase (const Key &k) |
| Remove an element from the sequence. | |
| void | erase (const iterator_safe &k) |
| Remove from the sequence the element pointed to by the iterator. | |
| const Key & | atPos (Idx i) const |
| Returns the object at the pos i. | |
| Idx | pos (const Key &key) const |
| Returns the position of the object passed in argument (if it exists). | |
| void | setAtPos (Idx i, const Key &newKey) |
| Change the value. | |
| void | setAtPos (Idx i, Key &&newKey) |
| Change the value. | |
| void | swap (Idx i, Idx j) |
| Swap index. | |
| const Key & | front () const |
| Returns the first element of the element. | |
| const Key & | back () const |
| Returns the last element of the sequence. | |
| std::string | toString () const |
| Displays the content of the sequence. | |
| void | resize (Size new_size) |
| Modifies the size of the internal structures of the sequence. | |
Private Member Functions | |
| void | _update_end_ () noexcept |
| A method to update the end iterator after changes in the sequence. | |
| void | _copy_ (const SequenceImplementation< Key, Gen > &aSeq) |
| Clears the current sequence and fill it with copies the element of aSeq. | |
| void | _insert_ (HashTableBucket< Key, Idx > &&bucket) |
| Insert an element at the end of the sequence. | |
Constructors | |
| SequenceImplementation (Size size_param=HashTableConst::default_size) | |
| Default constructor. | |
| SequenceImplementation (std::initializer_list< Key > list) | |
| Initializer list constructor. | |
| SequenceImplementation (const SequenceImplementation< Key, Gen > &aSeq) | |
| Copy constructor. | |
| SequenceImplementation (SequenceImplementation< Key, Gen > &&aSeq) | |
| Move constructor. | |
Private Operators | |
| SequenceImplementation< Key, Gen > & | operator= (const SequenceImplementation< Key, Gen > &aSeq) |
| Copy operator. | |
| SequenceImplementation< Key, Gen > & | operator= (SequenceImplementation< Key, Gen > &&aSeq) |
| Move operator. | |
Private Attributes | |
| HashTable< Key, Idx > | _h_ |
| Keep track of the position of the element in v (for fast retrieval). | |
| std::vector< Key * > | _v_ |
| The set of the elements stored into the sequence. | |
| SequenceIteratorSafe< Key > | _end_safe_ |
| Stores the end iterator for fast access. | |
| SequenceIteratorSafe< Key > | _rend_safe_ |
| Stores the rend iterator for fast access. | |
Friends | |
| class | SequenceIteratorSafe< Key > |
| Friends to speed up access. | |
| class | Sequence< Key > |
| Friends to speed up access. | |
The internal class for storing (ordered) sequences of objects.
A SequenceImplementation<Key,bool Gen> is a specialized version of of a Sequence<Key>. It shall not be used by itself but rather through the Sequence class. A SequenceImplementation is quite similar to a vector<Key> in that it stores an ordered set of elements. The main difference between these two data structures lies in the fact that, given a key, it is possible to retrieve from a SequenceImplementation the index in the vector where the key lies in O(1). As a result, it is not possible to insert a given element twice in the sequence, that is, all the Keys must be different.
When the Boolean template parameter gen is false, SequenceImplementation implements a very generic sequence. This allows having Sequences containing elements of virtually any class or type. When the Boolean gen is equal to true, the SequenceImplementation shall contain only scalar types (integers, floats, pointers, etc). As such, knowning that the element is a scalar enables to optimize the code of the sequences. Determining whether gen should be set to true or false is not left to the developper but is determined by the compiler itself at compile time.
| Key | The elements type stored in the sequence. |
| Gen | Used for meta-programation. |
Definition at line 109 of file sequence.h.
| using gum::SequenceImplementation< Key, Gen >::const_iterator = SequenceIterator< Key > |
Types for STL compliance.
Definition at line 127 of file sequence.h.
| using gum::SequenceImplementation< Key, Gen >::const_iterator_safe = SequenceIteratorSafe< Key > |
Types for STL compliance.
Definition at line 129 of file sequence.h.
| using gum::SequenceImplementation< Key, Gen >::const_pointer = const Key* |
Types for STL compliance.
Definition at line 123 of file sequence.h.
| using gum::SequenceImplementation< Key, Gen >::const_reference = const Key& |
Types for STL compliance.
Definition at line 121 of file sequence.h.
| using gum::SequenceImplementation< Key, Gen >::difference_type = std::ptrdiff_t |
Types for STL compliance.
Definition at line 125 of file sequence.h.
| using gum::SequenceImplementation< Key, Gen >::iterator = SequenceIterator< Key > |
Types for STL compliance.
Definition at line 126 of file sequence.h.
| using gum::SequenceImplementation< Key, Gen >::iterator_safe = SequenceIteratorSafe< Key > |
Types for STL compliance.
Definition at line 128 of file sequence.h.
| using gum::SequenceImplementation< Key, Gen >::pointer = Key* |
Types for STL compliance.
Definition at line 122 of file sequence.h.
| using gum::SequenceImplementation< Key, Gen >::reference = Key& |
Types for STL compliance.
Definition at line 120 of file sequence.h.
| using gum::SequenceImplementation< Key, Gen >::size_type = std::size_t |
Types for STL compliance.
Definition at line 124 of file sequence.h.
| using gum::SequenceImplementation< Key, Gen >::value_type = Key |
Types for STL compliance.
Definition at line 119 of file sequence.h.
|
private |
Default constructor.
| size_param | The intial size of the gum::SequenceImplementation. |
Definition at line 286 of file sequence_tpl.h.
Referenced by SequenceImplementation(), SequenceImplementation(), ~SequenceImplementation(), _copy_(), gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), operator!=(), operator=(), operator=(), operator==(), and operator>>().
|
private |
Initializer list constructor.
| list | The initializer list. |
Definition at line 295 of file sequence_tpl.h.
References SequenceImplementation(), _end_safe_, _rend_safe_, and insert().
|
private |
Copy constructor.
| aSeq | The sequence the elements of which will be copied. |
Definition at line 306 of file sequence_tpl.h.
References SequenceImplementation(), _copy_(), _end_safe_, and _rend_safe_.
|
private |
Move constructor.
| aSeq | The gum::SequenceImplementation to move/ |
Definition at line 315 of file sequence_tpl.h.
|
noexcept |
Class destructor.
Definition at line 325 of file sequence_tpl.h.
References SequenceImplementation().
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
|
private |
Clears the current sequence and fill it with copies the element of aSeq.
| aSeq | The gum::SequenceImplementation to copy. |
Definition at line 273 of file sequence_tpl.h.
References SequenceImplementation(), _h_, _update_end_(), _v_, clear(), and size().
Referenced by SequenceImplementation(), and gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
|
private |
Insert an element at the end of the sequence.
| bucket | The bucket holing the store to insert. |
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
|
privatenoexcept |
A method to update the end iterator after changes in the sequence.
Definition at line 259 of file sequence_tpl.h.
References _end_safe_.
Referenced by _copy_(), gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), clear(), erase(), insert(), gum::SequenceImplementation< const gum::DiscreteVariable *, std::is_scalar< const gum::DiscreteVariable * >::value >::operator!=(), and gum::SequenceImplementation< const gum::DiscreteVariable *, std::is_scalar< const gum::DiscreteVariable * >::value >::operator>>().
| const Key & gum::SequenceImplementation< Key >::atPos | ( | Idx | i | ) | const |
Returns the object at the pos i.
| i | The position of the element to return. |
| NotFound | Raised if the element does not exist. |
Definition at line 469 of file sequence_tpl.h.
References _h_, and GUM_ERROR.
Referenced by gum::prm::StructuredInference< GUM_SCALAR >::_addEdgesInReducedGraph_(), gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadReference_(), gum::Instantiation::_reorder_(), gum::prm::GSpan< GUM_SCALAR >::_subgraph_mining_(), back(), front(), operator[](), and swap().
| const Key & gum::SequenceImplementation< Key >::back | ( | ) | const |
Returns the last element of the sequence.
| NotFound | Raised if the sequence is empty. |
Definition at line 532 of file sequence_tpl.h.
References atPos(), and size().
Referenced by gum::prm::PRMFactory< GUM_SCALAR >::_buildSlotChain_(), gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), and gum::prm::PRMClass< GUM_SCALAR >::_overloadReference_().
| SequenceIterator< Key > gum::SequenceImplementation< Key >::begin | ( | ) | const |
Returns an unsafe begin iterator.
Definition at line 610 of file sequence_tpl.h.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), and gum::MultiDimFunctionGraphManager< GUM_ELEMENT, TerminalNodePolicy >::clean().
| SequenceIteratorSafe< Key > gum::SequenceImplementation< Key >::beginSafe | ( | ) | const |
Returns a safe begin iterator.
Definition at line 584 of file sequence_tpl.h.
References SequenceIteratorSafe< Key >.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| void gum::SequenceImplementation< Key >::clear | ( | ) |
Clear the sequence.
Definition at line 265 of file sequence_tpl.h.
References _h_, _update_end_(), and _v_.
Referenced by _copy_(), and gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| void gum::SequenceImplementation< Key >::emplace | ( | Args &&... | args | ) |
Emplace a new element in the sequence.
The emplace is a method that allows to construct directly an element of type Key by passing to its constructor all the arguments it needs.
| Args | The arguments types passed to the constructor. |
| args | The arguments passed to the constructor. |
| DuplicateElement | Raised if the sequence contains already k. |
Definition at line 398 of file sequence_tpl.h.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
|
noexcept |
Return true if empty.
Definition at line 65 of file sequence_tpl.h.
References _h_.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
|
noexcept |
Returns the unsafe end iterator.
Definition at line 616 of file sequence_tpl.h.
References _end_safe_.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), and gum::MultiDimFunctionGraphManager< GUM_ELEMENT, TerminalNodePolicy >::clean().
|
noexcept |
Returns the safe end iterator.
Definition at line 590 of file sequence_tpl.h.
References _end_safe_, and SequenceIteratorSafe< Key >.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| void gum::SequenceImplementation< Key >::erase | ( | const iterator_safe & | k | ) |
Remove from the sequence the element pointed to by the iterator.
If the element cannot be found, the function does nothing. In particular, it throws no exception. Complexity \(o(n)\) (need to change the position of at most the n elements)
| k | The iterator poiting to the element to remove. |
Definition at line 444 of file sequence_tpl.h.
References _h_, _update_end_(), _v_, pos(), and size().
| void gum::SequenceImplementation< Key, Gen >::erase | ( | const Key & | k | ) |
Remove an element from the sequence.
If the element cannot be found, the function does nothing. In particular, it throws no exception. Complexity \(o(n)\) (need to change the position of at most the n elements).
| k | The element to remove. |
Definition at line 426 of file sequence_tpl.h.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadReference_(), and operator>>().
| bool gum::SequenceImplementation< Key >::exists | ( | const Key & | k | ) | const |
Check the existence of k in the sequence.
The complexity is \(o(1)\).
| k | The key to check for existence. |
Definition at line 357 of file sequence_tpl.h.
References _h_.
Referenced by gum::prm::SVE< GUM_SCALAR >::_initElimOrder_(), gum::prm::SVED< GUM_SCALAR >::_initElimOrder_(), gum::prm::gspan::DFSTree< GUM_SCALAR >::_initialiaze_root_(), gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), gum::prm::GSpan< GUM_SCALAR >::_subgraph_mining_(), gum::prm::PRMFactory< GUM_SCALAR >::addAttribute(), gum::prm::gspan::SearchStrategy< GUM_SCALAR >::computeCost_(), and gum::Sequence< Key >::diffSet().
| const Key & gum::SequenceImplementation< Key >::front | ( | ) | const |
Returns the first element of the element.
| NotFound | Raised if the sequence is empty. |
Definition at line 526 of file sequence_tpl.h.
References atPos().
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| void gum::SequenceImplementation< Key, Gen >::insert | ( | const Key & | k | ) |
Insert an element at the end of the sequence.
The complexity is \(o(1)\).
| k | The element to insert. |
| DuplicateElement | Raised if the sequence contains already k. |
Definition at line 369 of file sequence_tpl.h.
Referenced by SequenceImplementation(), gum::prm::PRMFactory< GUM_SCALAR >::_buildSlotChain_(), gum::prm::SVE< GUM_SCALAR >::_initElimOrder_(), gum::prm::SVED< GUM_SCALAR >::_initElimOrder_(), gum::prm::gspan::DFSTree< GUM_SCALAR >::_initialiaze_root_(), gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadReference_(), gum::prm::gspan::SearchStrategy< GUM_SCALAR >::computeCost_(), and gum::prm::gspan::DFSTree< GUM_SCALAR >::growPattern().
| void gum::SequenceImplementation< Key, Gen >::insert | ( | Key && | k | ) |
Move an element at the end of the sequence.
The complexity is \(o(1)\).
| k | The element to insert. |
| DuplicateElement | Raised if the sequence contains already k. |
Definition at line 383 of file sequence_tpl.h.
References _h_, _update_end_(), and _v_.
| bool gum::SequenceImplementation< Key >::operator!= | ( | const SequenceImplementation< Key, Gen > & | k | ) | const |
Returns true if the content of k is different from that of *this.
Note that two sequences are equal if and only if they contain the same variables (using Key::operator==) in the same order.
| k | The other gum::SequenceImplementation. |
Returns true if both gum::SequenceImplementation are not equal.
Definition at line 570 of file sequence_tpl.h.
References SequenceImplementation(), and gum::operator==().
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| SequenceImplementation< Key, Gen > & gum::SequenceImplementation< Key, Gen >::operator<< | ( | const Key & | k | ) |
Insert k at the end of the sequence (synonym for insert).
| k | The key we wish to insert in the sequence. |
| DuplicateElement | Raised if the sequence contains already k. |
Definition at line 398 of file sequence_tpl.h.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| SequenceImplementation< Key, Gen > & gum::SequenceImplementation< Key, Gen >::operator<< | ( | Key && | k | ) |
Insert k at the end of the sequence (synonym for insert).
| k | The key we wish to insert in the sequence. |
| DuplicateElement | Raised if the sequence contains already k. |
Definition at line 398 of file sequence_tpl.h.
|
private |
Copy operator.
| aSeq | The sequence to copy. |
Definition at line 331 of file sequence_tpl.h.
References SequenceImplementation().
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), gum::Sequence< Key >::operator=(), and gum::Sequence< Key >::operator=().
|
private |
Move operator.
| aSeq | The sequence to move. |
Definition at line 344 of file sequence_tpl.h.
References SequenceImplementation(), _h_, and _v_.
| bool gum::SequenceImplementation< Key >::operator== | ( | const SequenceImplementation< Key, Gen > & | k | ) | const |
Returns true if the content of k equals that of *this.
Note that two sequences are equal if and only if they contain the same Keys (using Key::operator==) in the same order.
| k | The other gum::SequenceImplementation. |
Returns true if both gum::SequenceImplementation are equal.
Definition at line 557 of file sequence_tpl.h.
References SequenceImplementation(), _v_, and size().
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| SequenceImplementation< Key, true > & gum::SequenceImplementation< Key >::operator>> | ( | const Key & | k | ) |
Remove k in the sequence (synonym for erase).
If the element cannot be found, the function does nothing. In particular, it throws no exception.
| k | The key we wish to remove. |
Definition at line 462 of file sequence_tpl.h.
References SequenceImplementation(), and erase().
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| const Key & gum::SequenceImplementation< Key >::operator[] | ( | Idx | i | ) | const |
Returns the element at position i (synonym for atPos).
| i | The position of the element to return. |
| OutOfBounds | Raised if the element does not exist. |
Definition at line 479 of file sequence_tpl.h.
References atPos().
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| Idx gum::SequenceImplementation< Key >::pos | ( | const Key & | key | ) | const |
Returns the position of the object passed in argument (if it exists).
| key | The element for which the positon is returned. |
| NotFound | Raised if the element does not exist. |
Definition at line 485 of file sequence_tpl.h.
References _h_.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), gum::prm::GSpan< GUM_SCALAR >::_subgraph_mining_(), gum::MultiDimArray< GUM_ELEMENT >::erase(), gum::MultiDimWithOffset< GUM_ELEMENT >::erase(), erase(), and erase().
| SequenceIterator< Key > gum::SequenceImplementation< Key >::rbegin | ( | ) | const |
Returns an unsafe rbegin iterator.
Definition at line 622 of file sequence_tpl.h.
References size().
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| SequenceIteratorSafe< Key > gum::SequenceImplementation< Key >::rbeginSafe | ( | ) | const |
Returns a safe rbegin iterator.
Definition at line 596 of file sequence_tpl.h.
References SequenceIteratorSafe< Key >, and size().
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
|
noexcept |
Returns the unsafe rend iterator.
Definition at line 630 of file sequence_tpl.h.
References _rend_safe_.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
|
noexcept |
Returns the safe rend iterator.
Definition at line 604 of file sequence_tpl.h.
References _rend_safe_, and SequenceIteratorSafe< Key >.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| void gum::SequenceImplementation< Key >::resize | ( | Size | new_size | ) |
Modifies the size of the internal structures of the sequence.
This function is provided for optimization issues. When you know you will have to insert elements into the sequence, it may be faster to use this function prior to the additions because it will change once and for all the sizes of all the internal containers. Note that if you provide a size that is smaller than the number of elements of the sequence, the function will not modify anything.
| new_size | The internal structure new size. |
Definition at line 636 of file sequence_tpl.h.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| void gum::SequenceImplementation< Key, Gen >::setAtPos | ( | Idx | i, |
| const Key & | newKey ) |
Change the value.
| i | The element's position. |
| newKey | The element's new value. |
| NotFound | Raised if the element does not exist. |
| DuplicateElement | Raised if newKey alreay exists. |
Definition at line 491 of file sequence_tpl.h.
References _h_, and GUM_ERROR.
Referenced by gum::prm::PRMClass< GUM_SCALAR >::_inheritClass_(), and gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| void gum::SequenceImplementation< Key, Gen >::setAtPos | ( | Idx | i, |
| Key && | newKey ) |
Change the value.
| i | The element's position. |
| newKey | The element's new value. |
| NotFound | Raised if the element does not exist. |
| DuplicateElement | Raised if newKey alreay exists. |
Definition at line 501 of file sequence_tpl.h.
|
noexcept |
Returns the size of the sequence.
Definition at line 59 of file sequence_tpl.h.
References _h_.
Referenced by gum::prm::StructuredInference< GUM_SCALAR >::_addEdgesInReducedGraph_(), gum::prm::PRMFactory< GUM_SCALAR >::_buildSlotChain_(), _copy_(), gum::Instantiation::_init_(), gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadReference_(), gum::Instantiation::_reorder_(), back(), gum::MultiDimArray< GUM_ELEMENT >::erase(), gum::MultiDimWithOffset< GUM_ELEMENT >::erase(), erase(), operator==(), rbegin(), and rbeginSafe().
| void gum::SequenceImplementation< Key >::swap | ( | Idx | i, |
| Idx | j ) |
Swap index.
| i | The index of the first elt to swap. |
| j | The index of the other elt to swap. |
Definition at line 511 of file sequence_tpl.h.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
| std::string gum::SequenceImplementation< Key >::toString | ( | ) | const |
Displays the content of the sequence.
Definition at line 538 of file sequence_tpl.h.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_(), gum::operator<<(), gum::operator<<(), and gum::operator<<().
| optional_ref< const Idx > gum::SequenceImplementation< Key >::tryPos | ( | const Key & | k | ) | const |
Returns a pointer to the position of k in the sequence, or nullptr if k is not found.
This avoids the double lookup of exists() + pos().
| k | The key to search for. |
Definition at line 363 of file sequence_tpl.h.
References _h_.
Referenced by gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::_insert_().
Friends to speed up access.
Definition at line 1372 of file sequence.h.
|
friend |
Friends to speed up access.
Definition at line 1372 of file sequence.h.
Referenced by beginSafe(), endSafe(), rbeginSafe(), and rendSafe().
|
private |
Stores the end iterator for fast access.
Definition at line 509 of file sequence.h.
Referenced by SequenceImplementation(), SequenceImplementation(), _update_end_(), end(), and endSafe().
|
private |
Keep track of the position of the element in v (for fast retrieval).
Definition at line 499 of file sequence.h.
Referenced by _copy_(), atPos(), clear(), emplace(), empty(), erase(), erase(), exists(), insert(), operator=(), pos(), resize(), setAtPos(), setAtPos(), size(), swap(), toString(), and tryPos().
|
private |
Stores the rend iterator for fast access.
Definition at line 512 of file sequence.h.
Referenced by SequenceImplementation(), SequenceImplementation(), rend(), and rendSafe().
|
private |
The set of the elements stored into the sequence.
Definition at line 502 of file sequence.h.
Referenced by _copy_(), clear(), emplace(), erase(), insert(), operator=(), operator==(), resize(), setAtPos(), and toString().