casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
casa::MapWithDefault< K, V > Class Template Reference

MapWithDefault adds a default value to the std::map class. This default value is used by the [] operator when the key is not already known. More...

#include <MapWithDefault.h>

Inheritance diagram for casa::MapWithDefault< K, V >:

Public Member Functions

 MapWithDefault (const V &defaultValue)
 creates a std::map with the associated specified defaultt value More...
 
 MapWithDefault (const MapWithDefault< K, V > &other)
 creates a map with default from another one; use copy semantics. More...
 
 ~MapWithDefault ()
 Removes a map with default. More...
 
MapWithDefault< K, V > & operator= (const MapWithDefault< K, V > &other)
 Assigns this map with default to another one; copy semantics. More...
 
V & operator[] (const K &key)
 this is the specialization which uses the default value as necessary. More...
 

Private Attributes

defaultVal
 

Detailed Description

template<class K, class V>
class casa::MapWithDefault< K, V >

MapWithDefault adds a default value to the std::map class. This default value is used by the [] operator when the key is not already known.

<visibility=export>

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

Definition at line 54 of file MapWithDefault.h.

Constructor & Destructor Documentation

template<class K, class V>
casa::MapWithDefault< K, V >::MapWithDefault ( const V &  defaultValue)
inline

creates a std::map with the associated specified defaultt value

Definition at line 58 of file MapWithDefault.h.

template<class K, class V>
casa::MapWithDefault< K, V >::MapWithDefault ( const MapWithDefault< K, V > &  other)
inline

creates a map with default from another one; use copy semantics.

Definition at line 61 of file MapWithDefault.h.

template<class K, class V>
casa::MapWithDefault< K, V >::~MapWithDefault ( )
inline

Removes a map with default.

Definition at line 64 of file MapWithDefault.h.

Member Function Documentation

template<class K, class V>
MapWithDefault< K, V > & casa::MapWithDefault< K, V >::operator= ( const MapWithDefault< K, V > &  other)
inline

Assigns this map with default to another one; copy semantics.

Definition at line 78 of file MapWithDefault.h.

References casacore::operator=().

template<class K, class V >
V & casa::MapWithDefault< K, V >::operator[] ( const K &  key)
inline

this is the specialization which uses the default value as necessary.

If the map from the key to a value is not defined a mapping will be defined from the key to the default value.

Definition at line 87 of file MapWithDefault.h.

Member Data Documentation

template<class K, class V>
V casa::MapWithDefault< K, V >::defaultVal
private

Definition at line 75 of file MapWithDefault.h.


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