Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

util::Map< key, value > Class Template Reference

#include <Map.h>

Inheritance diagram for util::Map< key, value >:

util::Object util::Hashtable< key, value > List of all members.

Detailed Description

template<class key, class value>
class util::Map< key, value >

Map is an interface for data structures that hold name-value pairs.


Public Methods

virtual const value * get (const key &obj) const
 Get the value associated with key from the map.

virtual value * get (const key &obj)=0
 Get the value associated with key from the map.

const value * operator[] (const key &obj) const
 Get a pointer to a stored object.

value * operator[] (const key &obj)
 Get a pointer to a stored object.

virtual void put (const key &obj, const value &val)=0
 Put a value into the map.


Member Function Documentation

template<class key, class value>
virtual value* util::Map< key, value >::get const key &    obj [pure virtual]
 

Get the value associated with key from the map.

Parameters:
obj  the association key
Returns:
a pointer to the stored object or NULL if it was not found

Implemented in util::Hashtable< key, value >, util::Hashtable< int, SignalHandler * >, util::Hashtable< std::string, Serializer * >, and util::Hashtable< std::string, std::string >.

template<class key, class value>
virtual const value* util::Map< key, value >::get const key &    obj const [inline, virtual]
 

Get the value associated with key from the map.

The default implementation calls the non-const version and returns the result as a const pointer.

Parameters:
obj  the association key
Returns:
a pointer to the stored object or NULL if it was not found

template<class key, class value>
value* util::Map< key, value >::operator[] const key &    obj [inline]
 

Get a pointer to a stored object.

Calls get(obj).

Parameters:
obj  the key object that references the wanted object
Returns:
a pointer to the value or NULL if it was not found

template<class key, class value>
const value* util::Map< key, value >::operator[] const key &    obj const [inline]
 

Get a pointer to a stored object.

Calls get(obj).

Parameters:
obj  the key object that references the wanted object
Returns:
a pointer to the value or NULL if it was not found

template<class key, class value>
virtual void util::Map< key, value >::put const key &    obj,
const value &    val
[pure virtual]
 

Put a value into the map.

Parameters:
obj  the key object
val  a value associated with the key

Implemented in util::Hashtable< key, value >, util::Hashtable< int, SignalHandler * >, util::Hashtable< std::string, Serializer * >, and util::Hashtable< std::string, std::string >.


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.