|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Common methods to mapping containers. More...
#include <ah-dry.H>
Public Member Functions | |
| template<template< typename > class C = Aleph::DynList> | |
| C< Key > | keys () const |
| Return the domain set of container. | |
| template<template< typename > class C = Aleph::DynList> | |
| C< Data > | values () const |
| Return the range set of container. | |
| template<template< typename > class C = Aleph::DynList> requires Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer<Container, C<Data>>::type, std::pair<Key, Data>> | |
| C< Data * > | values_ptr () |
| Return a container of pointers to the elements of range set of container. | |
| template<template< typename > class C = Aleph::DynList> | |
| C< const Data * > | values_ptr () const |
| Constant overload of values_ptr(). | |
| template<template< typename > class C = Aleph::DynList> | |
| C< std::pair< Key, Data > > | items () const |
| Return a container with the entire mapping. | |
| template<template< typename > class C = Aleph::DynList> requires Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer<Container, C<Data>>::type, std::pair<Key, Data>> | |
| C< std::pair< Key, Data * > > | items_ptr () |
| Return a container with the entire mapping where the range could be modified. | |
| template<template< typename > class C = Aleph::DynList> | |
| C< std::pair< Key, const Data * > > | items_ptr () const |
| Constant overload of items_ptr(). | |
| Data & | operator() (const Key &key) |
Return the image or element mapped to key. | |
| const Data & | operator() (const Key &key) const |
Return the image or element mapped to key. | |
Private Member Functions | |
| const Container * | const_me () const noexcept |
| Container * | me () noexcept |
Common methods to mapping containers.
For containers whose items are std::pair<Key, Data>.
|
inlineprivatenoexcept |
Definition at line 3191 of file ah-dry.H.
Referenced by MapSequencesMethods< Container, Key, Data >::items(), MapSequencesMethods< Container, Key, Data >::items_ptr(), MapSequencesMethods< Container, Key, Data >::keys(), MapSequencesMethods< Container, Key, Data >::operator()(), MapSequencesMethods< Container, Key, Data >::values(), and MapSequencesMethods< Container, Key, Data >::values_ptr().
|
inline |
Return a container with the entire mapping.
items() returns a container copy of an entire mapping. Each element of returned mapping is a pair <key, value>.
| bad_alloc | if there is no enough memory |
Definition at line 3305 of file ah-dry.H.
References MapSequencesMethods< Container, Key, Data >::const_me().
|
inline |
Return a container with the entire mapping where the range could be modified.
items_ptr() returns a container copy of an entire mapping. Each element of returned mapping is a pair <key, pointer to value>. It needs a container whose modifiable traversal hands out modifiable references.
| bad_alloc | if there is no enough memory |
Definition at line 3330 of file ah-dry.H.
References MapSequencesMethods< Container, Key, Data >::me().
|
inline |
Constant overload of items_ptr().
| bad_alloc | if there is no enough memory |
Definition at line 3347 of file ah-dry.H.
References MapSequencesMethods< Container, Key, Data >::const_me().
|
inline |
Return the domain set of container.
This is a template method whose unique parameter is the type of container where the domain set will be stored. By default, this type is DynList.
Often the elements of domain are called "keys" and those of codomain or range "values".
| bad_alloc | if there is no enough memory |
Definition at line 3216 of file ah-dry.H.
References MapSequencesMethods< Container, Key, Data >::const_me().
|
inlineprivatenoexcept |
Definition at line 3196 of file ah-dry.H.
Referenced by MapSequencesMethods< Container, Key, Data >::items_ptr(), MapSequencesMethods< Container, Key, Data >::operator()(), and MapSequencesMethods< Container, Key, Data >::values_ptr().
|
inline |
Return the image or element mapped to key.
| [in] | key | key to look up. |
| domain_error | if key is not present in the mapping |
Definition at line 3363 of file ah-dry.H.
References MapSequencesMethods< Container, Key, Data >::me().
|
inline |
Return the image or element mapped to key.
| [in] | key | key to look up. |
| domain_error | if key is not present in the mapping. |
Definition at line 3378 of file ah-dry.H.
References MapSequencesMethods< Container, Key, Data >::const_me().
|
inline |
Return the range set of container.
This is a template method whose unique parameter is the type of container where the range set will be stored. By default this type is DynList.
Often the elements of range are called "values" and those of domain "keys".
| bad_alloc | if there is no enough memory |
Definition at line 3240 of file ah-dry.H.
References MapSequencesMethods< Container, Key, Data >::const_me().
|
inline |
Return a container of pointers to the elements of range set of container.
This is a template method whose unique parameter is the type of container where the pointers set will be stored. By default this type is DynList.
This method returns a container with pointers to the values, so that they can be modified; it needs a container whose modifiable traversal hands out modifiable references.
| bad_alloc | if there is no enough memory |
Definition at line 3268 of file ah-dry.H.
References MapSequencesMethods< Container, Key, Data >::me().
|
inline |
Constant overload of values_ptr().
| bad_alloc | if there is no enough memory |
Definition at line 3285 of file ah-dry.H.
References MapSequencesMethods< Container, Key, Data >::const_me().