Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
BidirectionalMap< T, U >::Side< SideKey, SideValue > Class Template Reference

Read-only view for one direction of the map. More...

#include <BidirectionalMap.h>

Collaboration diagram for BidirectionalMap< T, U >::Side< SideKey, SideValue >:

Public Member Functions

 Side ()=default
 Default constructor.
const SideValue & at (const SideKey &key) const
 Gets the value associated with a key.
bool contains (const SideKey &key) const
 Checks whether a key exists on this side.
size_t size () const
 Gets the number of mappings on this side.
bool empty () const
 Checks whether this side has no mappings.
std::unordered_map< SideKey, SideValue >::const_iterator begin () const
 Gets an iterator to the first mapping on this side.
std::unordered_map< SideKey, SideValue >::const_iterator end () const
 Gets an iterator past the last mapping on this side.

Private Member Functions

void clear_map_only ()

Private Attributes

std::unordered_map< SideKey, SideValue > map

Detailed Description

template<typename T, typename U>
template<typename SideKey, typename SideValue>
class BidirectionalMap< T, U >::Side< SideKey, SideValue >

Read-only view for one direction of the map.

Template Parameters
SideKeyKey type for this side.
SideValueValue type returned from this side.

Definition at line 27 of file BidirectionalMap.h.

Constructor & Destructor Documentation

◆ Side()

template<typename T, typename U>
template<typename SideKey, typename SideValue>
BidirectionalMap< T, U >::Side< SideKey, SideValue >::Side ( )
default

Default constructor.

Member Function Documentation

◆ at()

template<typename T, typename U>
template<typename SideKey, typename SideValue>
const SideValue & BidirectionalMap< T, U >::Side< SideKey, SideValue >::at ( const SideKey & key) const
inline

Gets the value associated with a key.

Parameters
keyKey to look up.
Returns
Associated value.
Exceptions
std::out_of_rangewhen key does not exist.

Definition at line 45 of file BidirectionalMap.h.

◆ begin()

template<typename T, typename U>
template<typename SideKey, typename SideValue>
std::unordered_map< SideKey, SideValue >::const_iterator BidirectionalMap< T, U >::Side< SideKey, SideValue >::begin ( ) const
inline

Gets an iterator to the first mapping on this side.

Returns
Const iterator to the first mapping.

Definition at line 82 of file BidirectionalMap.h.

◆ clear_map_only()

template<typename T, typename U>
template<typename SideKey, typename SideValue>
void BidirectionalMap< T, U >::Side< SideKey, SideValue >::clear_map_only ( )
inlineprivate

Definition at line 93 of file BidirectionalMap.h.

◆ contains()

template<typename T, typename U>
template<typename SideKey, typename SideValue>
bool BidirectionalMap< T, U >::Side< SideKey, SideValue >::contains ( const SideKey & key) const
inline

Checks whether a key exists on this side.

Parameters
keyKey to look up.
Returns
True when the key is present.

Definition at line 58 of file BidirectionalMap.h.

◆ empty()

template<typename T, typename U>
template<typename SideKey, typename SideValue>
bool BidirectionalMap< T, U >::Side< SideKey, SideValue >::empty ( ) const
inline

Checks whether this side has no mappings.

Returns
True when empty.

Definition at line 74 of file BidirectionalMap.h.

◆ end()

template<typename T, typename U>
template<typename SideKey, typename SideValue>
std::unordered_map< SideKey, SideValue >::const_iterator BidirectionalMap< T, U >::Side< SideKey, SideValue >::end ( ) const
inline

Gets an iterator past the last mapping on this side.

Returns
Const end iterator.

Definition at line 88 of file BidirectionalMap.h.

◆ size()

template<typename T, typename U>
template<typename SideKey, typename SideValue>
size_t BidirectionalMap< T, U >::Side< SideKey, SideValue >::size ( ) const
inline

Gets the number of mappings on this side.

Returns
Mapping count.

Definition at line 66 of file BidirectionalMap.h.

Member Data Documentation

◆ map

template<typename T, typename U>
template<typename SideKey, typename SideValue>
std::unordered_map<SideKey, SideValue> BidirectionalMap< T, U >::Side< SideKey, SideValue >::map
private

Definition at line 91 of file BidirectionalMap.h.


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