Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Vector< T, NumType >::Proxy Class Reference

The entry of a key, as v[k] gives it: reads and assigns it. More...

#include <al-vector.H>

Collaboration diagram for Aleph::Vector< T, NumType >::Proxy:
[legend]

Public Member Functions

 Proxy (Vector &v, const T &k)
 The entry of k in v.
 
 Proxy (const Proxy &)=default
 Another proxy of the same entry.
 
Proxy & operator= (const Proxy &proxy)
 Assign the value of the entry of proxy, zero included.
 
Proxy & operator= (const NumType &item)
 Assign item; a value within epsilon of zero removes the entry.
 
 operator NumType () const noexcept
 The value of the entry: 0 if it has none.
 

Private Attributes

Vector * v_ptr = nullptr
 
T key
 

Detailed Description

template<typename T, typename NumType>
class Aleph::Vector< T, NumType >::Proxy

The entry of a key, as v[k] gives it: reads and assigns it.

It keeps its own copy of the key and finds the entry each time it is read or assigned, so that it outlives a temporary key, and an insertion that moves the entries, as when the table grows. A value within epsilon of zero removes the entry, as set_entry() does.

Definition at line 794 of file al-vector.H.

Constructor & Destructor Documentation

◆ Proxy() [1/2]

template<typename T , typename NumType >
Aleph::Vector< T, NumType >::Proxy::Proxy ( Vector &  v,
const T &  k 
)
inline

The entry of k in v.

Definition at line 801 of file al-vector.H.

◆ Proxy() [2/2]

template<typename T , typename NumType >
Aleph::Vector< T, NumType >::Proxy::Proxy ( const Proxy &  )
default

Another proxy of the same entry.

Member Function Documentation

◆ operator NumType()

template<typename T , typename NumType >
Aleph::Vector< T, NumType >::Proxy::operator NumType ( ) const
inlinenoexcept

The value of the entry: 0 if it has none.

Definition at line 834 of file al-vector.H.

◆ operator=() [1/2]

◆ operator=() [2/2]

template<typename T , typename NumType >
Proxy & Aleph::Vector< T, NumType >::Proxy::operator= ( const Proxy &  proxy)
inline

Assign the value of the entry of proxy, zero included.

Definition at line 811 of file al-vector.H.

References Aleph::Vector< T, NumType >::Proxy::key, Aleph::Vector< T, NumType >::set_entry(), Aleph::Vector< T, NumType >::Proxy::v_ptr, and value.

Member Data Documentation

◆ key

template<typename T , typename NumType >
T Aleph::Vector< T, NumType >::Proxy::key
private

◆ v_ptr

template<typename T , typename NumType >
Vector* Aleph::Vector< T, NumType >::Proxy::v_ptr = nullptr
private

The documentation for this class was generated from the following file: