30#ifndef __ADS_DirectTable
31 #define __ADS_DirectTable
94 [[nodiscard]] std::optional< V >
lookup(
long k )
const;
107 [[nodiscard]] std::size_t
size(
void )
const;
121 static std::size_t
size(
const auto & o ) {
return( o.f_A.size() ); }
123 static bool occupied(
const auto & o , std::size_t i ) {
124 return( o.f_A[ i ].has_value() );
127 static auto read(
const auto & o , std::size_t i ) {
167 [[nodiscard]] std::size_t H(
long k )
const;
170 [[nodiscard]]
bool inRange(
long k )
const;
173 [[nodiscard]]
bool counted(
void )
const;
176 std::vector< std::optional< V > > f_A;
177 std::size_t f_size = 0;
189#include "ADS/dictionary/impl/DirectTable.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The iterators that the containers of the library have in common, beyond the book: they give a contain...
long Key
the type of the keys
Definition DirectTable.h:67
const_iterator iterator
the iterator on the items
Definition DirectTable.h:149
void insert(long k, const V &v)
associates to , writing it in
long key_type
the type of the keys
Definition DirectTable.h:135
std::optional< V > lookup(long k) const
the value of , the place , or nothing
const_iterator cbegin(void) const
the constant iterator on the first item
Definition DirectTable.h:160
std::pair< long, V > value_type
the type of the items, for the standard library
Definition DirectTable.h:133
const_iterator begin(void) const
the iterator on the first item
Definition DirectTable.h:152
std::size_t size_type
the type of the sizes
Definition DirectTable.h:139
void remove(long k)
removes , if it is there, emptying
SlotIterator< DirectTable, Places > const_iterator
the iterator on the items, constant
Definition DirectTable.h:147
PairRef< long, const V & > reference
a reference to an item
Definition DirectTable.h:143
std::size_t capacity(void) const
the size of the vector
DirectTable(long a, long b)
the empty table of the keys in
V mapped_type
the type of the values
Definition DirectTable.h:137
std::ptrdiff_t difference_type
the type of the distances between two iterators
Definition DirectTable.h:141
PairRef< long, const V & > const_reference
a constant reference to an item
Definition DirectTable.h:145
const_iterator cend(void) const
the constant iterator past the last item
Definition DirectTable.h:162
const_iterator end(void) const
the iterator past the last item
Definition DirectTable.h:156
std::size_t size(void) const
the number of keys
V Value
the type of the values
Definition DirectTable.h:68
a bidirectional iterator on the occupied places of the table O, by the policy P with the static funct...
Definition Iterators.h:691
std::conditional_t< detail::plainPair< A, B, VA, VB >, std::pair< A, B >, detail::PairProxy< A, B, VA, VB > > PairRef
the pair that an iterator reads by value, in general two references into the container,...
Definition Iterators.h:648
the places of the table, for SlotIterator
Definition DirectTable.h:119
static std::size_t size(const auto &o)
the number of places
Definition DirectTable.h:121
static bool occupied(const auto &o, std::size_t i)
whether the place holds a key
Definition DirectTable.h:123
static auto read(const auto &o, std::size_t i)
the pair of the place , its key computed as
Definition DirectTable.h:127