# ace::Overflow< _KeyType, _ValueType > Class Template Reference

Class serves as mapping between objects of given type and (some) statistics, which shall be stored in _ValueType. More...

`#include <overflow.h>`

List of all members.

## Public Member Functions
void | add (_KeyType key, _ValueType value)
| Add new "key, value" pair.
_ValueType | get (_KeyType key)
## Static Public Member Functions
static _ValueType | add_to_maximum (_ValueType a, _ValueType b)
## Private Types
typedef std::map< _KeyType, _ValueType > | _overflows_map_t
| Mapping is performed by simple map.
## Private Attributes
_overflows_map_t | _overflows_map
| Mapping container.
## Static Private Attributes
static const _ValueType | _max_value = std::numeric_limits<_ValueType>::max()
| Maximum allowed value for given type (may be safely static).

## Detailed Description

### template<class _KeyType, class _ValueType>
class ace::Overflow< _KeyType, _ValueType >

Class serves as mapping between objects of given type and (some) statistics, which shall be stored in _ValueType.

Although design of this class is quite general, within program it's used just to hold overflowen statistics, so the class name is kept related.

## Member Typedef Documentation

template<class _KeyType, class _ValueType>

typedef std::map<_KeyType, _ValueType> ace::Overflow< _KeyType, _ValueType >::_overflows_map_t`[private]`

Mapping is performed by simple map.

## Member Function Documentation

template<class _KeyType, class _ValueType>

void ace::Overflow< _KeyType, _ValueType >::add | ( | _KeyType | key,
|  | _ValueType | value |
| ) |  |  | `[inline]`

Add new "key, value" pair.

Parameters:

  | key | Key to be added.
  | value | Value to be added.

template<class _KeyType, class _ValueType>

static _ValueType ace::Overflow< _KeyType, _ValueType >::add_to_maximum | ( | _ValueType | a,
|  | _ValueType | b |
| ) |  |  | `[inline, static]`

Parameters:

  | a | First value to add.
  | b | Second value to add.

Returns:
  Sum of a and b or maximum value storable in _ValueType, if a + b would overflow.

template<class _KeyType, class _ValueType>

_ValueType ace::Overflow< _KeyType, _ValueType >::get | ( | _KeyType | key | ) | `[inline]`

Parameters:

  | key | Key (must be already in, no checks are performed).

Returns:
  Value assigned to given key.

## Member Data Documentation

template<class _KeyType, class _ValueType>

const _ValueType ace::Overflow< _KeyType, _ValueType >::_max_value = std::numeric_limits<_ValueType>::max()`[inline, static, private]`

Maximum allowed value for given type (may be safely static).

template<class _KeyType, class _ValueType>

_overflows_map_t ace::Overflow< _KeyType, _ValueType >::_overflows_map`[private]`

Mapping container.

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

- proto/Source/overflow.h