|
Aleph-w 3.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> | |
| C< Data * > | values_ptr () const |
| Return a container of pointers to the elements of range set of container. | |
| 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> | |
| C< std::pair< Key, Data * > > | items_ptr () const |
| Return a container with the entire mapping where the range could be modified. | |
| 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 |
Common methods to mapping containers.
|
inlineprivate |
Definition at line 1592 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 >::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 1681 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>.
| bad_alloc | if there is no enough memory |
Definition at line 1700 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 1613 of file ah-dry.H.
References MapSequencesMethods< Container, Key, Data >::const_me().
|
inline |
|
inline |
|
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 "value" and those of domain "values".
| bad_alloc | if there is no enough memory |
Definition at line 1637 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.
Often the elements of range are called "value" and those of domain "values". This method returns a container with pointers to those elements. In this way, the value could be modified.
| bad_alloc | if there is no enough memory |
Definition at line 1663 of file ah-dry.H.
References MapSequencesMethods< Container, Key, Data >::const_me().