User Manual, Developers Guide and API Documentation

wns::container::UntypedRegistry< KEY, SORTINGPOLICY > Class Template Reference

Stores references to instances of any type with a KEY. More...

#include <container/UntypedRegistry.hpp>

Collaboration diagram for wns::container::UntypedRegistry< KEY, SORTINGPOLICY >:

Collaboration graph
[legend]

List of all members.

Public Types

typedef ChamaeleonBase::BadCast BadCast
typedef
InstanceContainer::DuplicateKeyValue 
DuplicateKeyValue
typedef InstanceContainer::KeyList KeyList
typedef KEY KeyType
typedef
InstanceContainer::UnknownKeyValue 
UnknownKeyValue

Public Member Functions

virtual void clear ()
 Clears the container.
virtual bool empty () const throw ()
 True if size of Registry is 0.
virtual void erase (const KEY &key) throw (UnknownKeyValue)
 remove the instance registered under the given name,
template<typename T>
find (const KEY &key) const throw (UnknownKeyValue, BadCast)
 return an instance of type T according to the name it has been registerd with
template<typename ELEMENT>
void insert (const KEY &key, ELEMENT element) throw (DuplicateKeyValue)
 add an instance with a unique name
virtual KeyList keys () const throw ()
virtual bool knows (const KEY &key) const
 Is an instance with this name known?
virtual size_t size () const throw ()
 Return the size of the registry.
 UntypedRegistry ()
 Empty registry.
template<typename ELEMENT>
void update (const KeyType &key, ELEMENT element) throw (UnknownKeyValue)
 Update the element found by key.
virtual ~UntypedRegistry ()
 All entries in the registry will be erased.

Private Types

typedef
wns::container::Registry< KEY,
ChamaeleonBase
*, wns::container::registry::DeleteOnErase,
SORTINGPOLICY > 
InstanceContainer

Private Member Functions

 UntypedRegistry (const UntypedRegistry &)

Private Attributes

InstanceContainer instances_


Detailed Description

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
class wns::container::UntypedRegistry< KEY, SORTINGPOLICY >

Author:
Marc Schinnenburg <marc@schinnenburg.net>

Definition at line 43 of file UntypedRegistry.hpp.


Member Typedef Documentation

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
typedef ChamaeleonBase::BadCast wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::BadCast

Definition at line 56 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
typedef InstanceContainer::DuplicateKeyValue wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::DuplicateKeyValue

Definition at line 54 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
typedef wns::container::Registry<KEY, ChamaeleonBase*, wns::container::registry::DeleteOnErase, SORTINGPOLICY> wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::InstanceContainer [private]

Definition at line 50 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
typedef InstanceContainer::KeyList wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::KeyList

Definition at line 55 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
typedef KEY wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::KeyType

Definition at line 52 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
typedef InstanceContainer::UnknownKeyValue wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::UnknownKeyValue

Definition at line 53 of file UntypedRegistry.hpp.


Constructor & Destructor Documentation

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::UntypedRegistry (  )  [inline]

Definition at line 61 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
virtual wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::~UntypedRegistry (  )  [inline, virtual]

Definition at line 70 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::UntypedRegistry ( const UntypedRegistry< KEY, SORTINGPOLICY > &   )  [private]


Member Function Documentation

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
virtual void wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::clear (  )  [inline, virtual]

Definition at line 156 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
virtual bool wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::empty (  )  const throw () [inline, virtual]

Definition at line 165 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
virtual void wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::erase ( const KEY &  key  )  throw (UnknownKeyValue) [inline, virtual]

Definition at line 145 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
template<typename T>
T wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::find ( const KEY &  key  )  const throw (UnknownKeyValue, BadCast) [inline]

Definition at line 106 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
template<typename ELEMENT>
void wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::insert ( const KEY &  key,
ELEMENT  element 
) throw (DuplicateKeyValue) [inline]

Definition at line 79 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
virtual KeyList wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::keys (  )  const throw () [inline, virtual]

Definition at line 182 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
virtual bool wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::knows ( const KEY &  key  )  const [inline, virtual]

Definition at line 95 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
virtual size_t wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::size (  )  const throw () [inline, virtual]

Definition at line 175 of file UntypedRegistry.hpp.

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
template<typename ELEMENT>
void wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::update ( const KeyType key,
ELEMENT  element 
) throw (UnknownKeyValue) [inline]

Precondition:
An element with this key MUST NOT have been registered before
Exceptions:
UnkownKeyValue Thrown if element to key is not found
Todo:
Marc Schinnenburg: If the need arises we can also offer a method "updateTypeSafe", which alows updating only, if the type to be updated is the same.

Definition at line 129 of file UntypedRegistry.hpp.


Member Data Documentation

template<typename KEY, typename SORTINGPOLICY = std::less<KEY>>
InstanceContainer wns::container::UntypedRegistry< KEY, SORTINGPOLICY >::instances_ [private]

Definition at line 192 of file UntypedRegistry.hpp.


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

Generated on Sat May 26 03:32:52 2012 for openWNS by  doxygen 1.5.5