AutoValueMap< K, T, C, A, Deallocator > Class Template Reference

Provides pointer management for maps with dynamic values. More...

List of all members.

Public Member Functions

 AutoValueMap ()
 Constructor.
void DeleteClear ()
 Clear the contents of the map and delete them.
ParentIterator DeleteErase (ParentIterator in_toErase)
 Erase an element from the map, and delete its associated value.
AutoPtr< T, Deallocator > ReleaseOwnership (ParentIterator in_toRelease)
 Release ownership of the value associated with the given iterator, and return it.
AutoPtr< T, Deallocator > ReleaseOwnership (const K &in_key)
 Release ownership of the value associated with the given key, and return it.
ParentIterator TakeOwnership (const K &in_key, T *in_value)
 Add a mapping to this map.
ParentIterator TakeOwnership (const K &in_key, AutoPtr< T, Deallocator > in_value)
 Add a mapping to this map.
 ~AutoValueMap ()
 Destructor.

Detailed Description

template<class K, class T, class C = std::less<K>, class A = std::allocator<std::pair<const K, T*> >, typename Deallocator = AutoPtr_DefaultDeallocator<T>>
class Simba::Support::AutoValueMap< K, T, C, A, Deallocator >

Provides pointer management for maps with dynamic values.

Wraps the owned pointers to guarantee their automatic deletion when the map goes out of scope.

This map should only be used with value pointer types, and will automatically delete the contained pointers when the map goes out of scope.

Protect against using NULL contained pointers with asserts to catch programmer errors, but depend on callers using the new operator to throw exceptions on failure at runtime.

Here are some guidelines for using the AutoValueMap.


Constructor & Destructor Documentation

AutoValueMap (  )  [inline, explicit]

Constructor.

~AutoValueMap (  )  [inline]

Destructor.


Member Function Documentation

void DeleteClear (  )  [inline]

Clear the contents of the map and delete them.

ParentIterator DeleteErase ( ParentIterator  in_toErase  )  [inline]

Erase an element from the map, and delete its associated value.

AutoPtr<T, Deallocator> ReleaseOwnership ( ParentIterator  in_toRelease  )  [inline]

Release ownership of the value associated with the given iterator, and return it.

Parameters:
in_toRelease The iterator associated with the map entry holding the value to be released.
Returns:
The object which was released. A NULL AutoPtr if in_toRelease == this->end().
AutoPtr<T, Deallocator> ReleaseOwnership ( const K &  in_key  )  [inline]

Release ownership of the value associated with the given key, and return it.

Parameters:
in_key The key associated with the value to release ownership of.
Returns:
The object which was released. A NULL AutoPtr if there was no such mapping.
ParentIterator TakeOwnership ( const K &  in_key,
T *  in_value 
) [inline]

Add a mapping to this map.

Parameters:
in_key The key to use.
in_value The value to use. (OWN)
Returns:
An iterator to the newly-added mapping.
ParentIterator TakeOwnership ( const K &  in_key,
AutoPtr< T, Deallocator >  in_value 
) [inline]

Add a mapping to this map.

Parameters:
in_key The key to use.
in_value The value to use.
Returns:
An iterator to the newly-added mapping.

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

Generated on Wed May 17 14:21:18 2017 for SimbaEngine 10.1.3.1011 by simba