GUI::map_ptr< key_type, element_type > Class Template Reference

Map class for store pointers elements, the map take ownership of the pointer. More...

#include <map_ptr.h>

List of all members.

Public Member Functions

 map_ptr ()
 Map constructor.
 ~map_ptr ()
 Map destructor, destroy all contained pointers.
iterator begin ()
 Return the iterator to the first element.
iterator end ()
 Return the iterator to the end of the elements.
iterator find (key_type key)
 Search an element by key.
void insert (key_type key, std::auto_ptr< element_type > element)
 Insert a new item in the map.
size_type erase (key_type key)
 Erase an item in the map.
element_type * operator[] (key_type key)
 Return a pointer to the element with specified key.


Detailed Description

template<class key_type, class element_type>
class GUI::map_ptr< key_type, element_type >

Map class for store pointers elements, the map take ownership of the pointer.

Parameters:
key_type type of the key
element_type type of element, the map contains pointers to this type


Member Function Documentation

template<class key_type, class element_type>
iterator GUI::map_ptr< key_type, element_type >::begin (  )  [inline]

Return the iterator to the first element.

Returns:
the iterator to the first element

template<class key_type, class element_type>
iterator GUI::map_ptr< key_type, element_type >::end (  )  [inline]

Return the iterator to the end of the elements.

Returns:
the iterator to the end of the elements

template<class key_type, class element_type>
size_type GUI::map_ptr< key_type, element_type >::erase ( key_type  key  )  [inline]

Erase an item in the map.

Parameters:
key key of the element to remove

template<class key_type, class element_type>
iterator GUI::map_ptr< key_type, element_type >::find ( key_type  key  )  [inline]

Search an element by key.

Parameters:
key key of the element to search
Returns:
the iterator to the element found

template<class key_type, class element_type>
void GUI::map_ptr< key_type, element_type >::insert ( key_type  key,
std::auto_ptr< element_type >  element 
) [inline]

Insert a new item in the map.

Parameters:
key key of the element
element element to insert

template<class key_type, class element_type>
element_type* GUI::map_ptr< key_type, element_type >::operator[] ( key_type  key  )  [inline]

Return a pointer to the element with specified key.

Parameters:
key key of the element
Returns:
the element for the specified key


The documentation for this class was generated from the following file:
Generated on Wed Nov 15 22:21:10 2006 for Win32 by  doxygen 1.4.7