|
#include <table_index.hpp>
|
const_reference | at (size_type n) const |
|
reference | at (size_type n) |
|
reference | back () |
|
const_reference | back () const |
|
iterator | begin () |
|
const_iterator | begin () const |
|
void | clear () |
|
size_type | count (const key_type &x) const |
|
bool | empty () const |
|
iterator | end () |
|
const_iterator | end () const |
|
std::pair< iterator, iterator > | equal_range (const key_type &x) |
|
std::pair< const_iterator, const_iterator > | equal_range (const key_type &x) const |
|
iterator | erase (iterator location) |
|
iterator | erase (iterator first, iterator last) |
|
iterator | find (const key_type &x) |
|
const_iterator | find (const key_type &x) const |
|
reference | front () |
|
const_reference | front () const |
|
index_type & | index () |
|
const index_type & | index () const |
|
iterator | insert (iterator, value_type &) |
|
template<class InputIterator > |
void | insert (iterator position, InputIterator first, InputIterator last) |
|
iterator | lower_bound (const key_type &x) |
|
const_iterator | lower_bound (const key_type &x) const |
|
size_type | max_size () const |
|
reference | operator[] (const key_type &) |
|
const_reference | operator[] (const key_type &) const |
|
void | pop_back () |
|
void | push_back (value_type &) |
|
reverse_iterator | rbegin () |
|
const_reverse_iterator | rbegin () const |
|
reverse_iterator | rend () |
|
const_reverse_iterator | rend () const |
|
size_type | size () const |
|
void | sort () |
|
template<class TransformPrimitive > |
| table_index (TransformPrimitive transform, const key_compare &compare=key_compare()) |
|
| table_index (const transform_type &, const key_compare &=key_compare()) |
|
template<typename InputIterator , typename TransformPrimitive > |
| table_index (InputIterator first, InputIterator last, TransformPrimitive transform, const key_compare &compare=key_compare()) |
|
transform_type | transform () const |
|
void | unique () |
|
iterator | upper_bound (const key_type &x) |
|
const_iterator | upper_bound (const key_type &x) const |
|
template<typename Key, typename T, typename Transform = mem_data_t<T, const Key>, typename Compare = std::less<Key>>
class adobe::table_index< Key, T, Transform, Compare >
- Terminology:
- Row : any class or struct type; an element
- Column : a data or logical member of an element
- Table : any random access container of elements
- Transformation Function : given an element returns 1 or more columns. The result is by const reference so columns must be adjacent
- Key : a value which can be compared against a single member of an element
The table_index does not own the elements it indexes. Therefore the client is required to maintain the elements in the table_index as long as the table_index refers to them.
If the index is not sorted then the result of a lookup by key is undefined.
- Todo:
- (sparent) note here on why not auto sort.
Definition at line 671 of file table_index.hpp.
§ const_iterator
§ const_pointer
§ const_reference
§ const_reverse_iterator
§ difference_type
§ index_type
Container to store the elements of the table.
Definition at line 675 of file table_index.hpp.
§ iterator
§ key_compare
Functor that compares two keys for ordering.
Definition at line 680 of file table_index.hpp.
§ key_type
§ pointer
§ reference
§ reverse_iterator
§ size_type
§ transform_type
§ value_type
§ table_index() [1/3]
- Parameters
-
transform | ConvertibleToFunction to be converted to the transformation function for this index |
compare | key comparison function for this index |
Definition at line 695 of file table_index.hpp.
§ table_index() [2/3]
- Parameters
-
transform | transformation function for this index |
compare | key comparison function for this index |
Definition at line 817 of file table_index.hpp.
§ table_index() [3/3]
§ at() [1/2]
§ at() [2/2]
§ back() [1/2]
- Returns
- The last element in the table.
§ back() [2/2]
- Returns
- The last element in the table.
§ begin() [1/2]
§ begin() [2/2]
§ clear()
§ count()
- Precondition
- table must be sorted.
- Parameters
-
x | key value to count within the index |
- Returns
- Count of the elements with key value
x .
Definition at line 1087 of file table_index.hpp.
§ empty()
§ end() [1/2]
§ end() [2/2]
§ equal_range() [1/2]
- Precondition
- table must be sorted.
- Parameters
-
x | key value to find within the index |
- Returns
- Essentially a combination of the values returned by lower_bound and upper_bound
Definition at line 1137 of file table_index.hpp.
§ equal_range() [2/2]
- Precondition
- table must be sorted.
- Parameters
-
x | key value to find within the index |
- Returns
- Essentially a combination of the values returned by lower_bound and upper_bound
Definition at line 1148 of file table_index.hpp.
§ erase() [1/2]
- Parameters
-
position | iterator to the element to be removed from the index |
- Returns
- An iterator pointing to the next element after the one removed from the index
Definition at line 970 of file table_index.hpp.
§ erase() [2/2]
- Parameters
-
first | Iterator to the first element to be erased from the index |
last | Iterator to one past the last element to be erased from the index |
- Returns
- An iterator pointing to to the next element after the ones removed from the index
Definition at line 979 of file table_index.hpp.
§ find() [1/2]
- Precondition
- table must be sorted.
- Parameters
-
x | key value to find within the index |
- Returns
- Iterator to the element with key value
x , or end() if there is none.
Definition at line 1059 of file table_index.hpp.
§ find() [2/2]
- Precondition
- table must be sorted.
- Parameters
-
x | key value to find within the index |
- Returns
- Iterator to the element with key value
x , or end() if there is none.
Definition at line 1073 of file table_index.hpp.
§ front() [1/2]
- Returns
- The first element in the table.
§ front() [2/2]
- Returns
- The first element in the table.
§ index() [1/2]
- Returns
- All the elements in the index in a
std::vector
Definition at line 1158 of file table_index.hpp.
§ index() [2/2]
- Returns
- All the elements in the index in a
std::vector
Definition at line 1167 of file table_index.hpp.
§ insert() [1/2]
- Parameters
-
position | position at which the new element is to be inserted |
x | The element to insert as the position specified |
- Returns
- An iterator pointing to the new element.
- Postcondition
x must exist as long as this table's reference to it exists.
Definition at line 941 of file table_index.hpp.
§ insert() [2/2]
void insert |
( |
iterator |
position, |
|
|
InputIterator |
first, |
|
|
InputIterator |
last |
|
) |
| |
- Parameters
-
position | position at which the new elements are to be inserted |
first | Iterator to the first new element to be inserted |
last | Iterator to one past the last new element to be inserted |
- Postcondition
- The elements found in
(first, last] must exist as long as this table's references to them exist.
Definition at line 955 of file table_index.hpp.
§ lower_bound() [1/2]
- Precondition
- table must be sorted.
- Parameters
-
x | key value to find within the index |
- Returns
- The first position where the element transformed to
x could be inserted without violating the ordering of the table.
Definition at line 1096 of file table_index.hpp.
§ lower_bound() [2/2]
- Precondition
- table must be sorted.
- Parameters
-
x | key value to find within the index |
- Returns
- The first position where the element transformed to
x could be inserted without violating the ordering of the table.
Definition at line 1106 of file table_index.hpp.
§ max_size()
§ operator[]() [1/2]
- Precondition
- table must be sorted.
- Parameters
-
key | key value to find in the table index. |
- Returns
- One or more adjacent values whose keys match
key .
Definition at line 1031 of file table_index.hpp.
§ operator[]() [2/2]
- Precondition
- table must be sorted.
- Parameters
-
key | key value to find in the table index. |
- Returns
- One or more adjacent values whose keys match
key .
Definition at line 1045 of file table_index.hpp.
§ pop_back()
Eliminates the last element from the table.
Definition at line 932 of file table_index.hpp.
§ push_back()
- Parameters
-
x | The element to insert at the end of the table |
- Postcondition
x must exist as long as this table's reference to it exists.
Definition at line 924 of file table_index.hpp.
§ rbegin() [1/2]
§ rbegin() [2/2]
§ rend() [1/2]
§ rend() [2/2]
§ size()
§ sort()
Sorts all the elements in the table based on their transformed values as compared with the key_compare function object.
Definition at line 995 of file table_index.hpp.
§ transform()
§ unique()
§ upper_bound() [1/2]
- Precondition
- table must be sorted.
- Parameters
-
x | key value to find within the index |
- Returns
- The last position where the element transformed to
x could be inserted without violating the ordering of the table.
Definition at line 1116 of file table_index.hpp.
§ upper_bound() [2/2]
- Precondition
- table must be sorted.
- Parameters
-
x | key value to find within the index |
- Returns
- The last position where the element transformed to
x could be inserted without violating the ordering of the table.
Definition at line 1126 of file table_index.hpp.
§ swap() [1/2]
Swaps the contents of two table_indexes.
- Parameters
-
§ swap [2/2]
|