Classes | Public Types | Public Member Functions | Private Attributes

PHAL::TypeKeyMap< TypeMap > Class Template Reference

Container for storing objects indexed by types. More...

#include <PHAL_TypeKeyMap.hpp>

List of all members.

Classes

struct  GetObjectConstRefType
 Meta-function for getting the object const-reference type indexed by T. More...
struct  GetObjectRefType
 Meta-function for getting the object reference type indexed by T. More...
struct  GetObjectTypeAndPos
 Meta-function for getting the object type indexed by T. More...

Public Types

typedef Teuchos::Array
< Teuchos::any > 
container
 Typedef of container used.
typedef container::iterator iterator
 Typedef for iterator.
typedef container::const_iterator const_iterator
 Typedef for const_iterator.

Public Member Functions

 TypeKeyMap ()
 Default constructor.
 ~TypeKeyMap ()
 Destructor.
template<typename T >
GetObjectRefType< T >::type getValue ()
 Get object indexed by T.
template<typename T >
GetObjectConstRefType< T >::type getValue () const
 Get object indexed by T.
template<typename T >
void setValue (typename GetObjectConstRefType< T >::type x)
 Set object indexed by T.
iterator begin ()
 Return an iterator that points to the first object.
const_iterator begin () const
 Return an iterator that points to the first object.
iterator end ()
 Return an iterator that points one past the last object.
const_iterator end () const
 Return an iterator that points one past the last object.

Private Attributes

container objects
 Stores array objects of each type.

Detailed Description

template<typename TypeMap>
class PHAL::TypeKeyMap< TypeMap >

Container for storing objects indexed by types.

This class provides a generic container class for storing objects indexed by a type. It's single template parameter should be an mpl::map mapping the type index to the type of the object, which can then be retrieved from the container.

Teuchos::any is used to store the objects, and thus they should have value semantics.

Definition at line 34 of file PHAL_TypeKeyMap.hpp.


Member Typedef Documentation

template<typename TypeMap>
typedef Teuchos::Array<Teuchos::any> PHAL::TypeKeyMap< TypeMap >::container

Typedef of container used.

Definition at line 67 of file PHAL_TypeKeyMap.hpp.

template<typename TypeMap>
typedef container::iterator PHAL::TypeKeyMap< TypeMap >::iterator

Typedef for iterator.

Definition at line 70 of file PHAL_TypeKeyMap.hpp.

template<typename TypeMap>
typedef container::const_iterator PHAL::TypeKeyMap< TypeMap >::const_iterator

Typedef for const_iterator.

Definition at line 73 of file PHAL_TypeKeyMap.hpp.


Constructor & Destructor Documentation

template<typename TypeMap>
PHAL::TypeKeyMap< TypeMap >::TypeKeyMap (  )  [inline]

Default constructor.

Definition at line 76 of file PHAL_TypeKeyMap.hpp.

template<typename TypeMap>
PHAL::TypeKeyMap< TypeMap >::~TypeKeyMap (  )  [inline]

Destructor.

Definition at line 79 of file PHAL_TypeKeyMap.hpp.


Member Function Documentation

template<typename TypeMap>
template<typename T >
GetObjectRefType<T>::type PHAL::TypeKeyMap< TypeMap >::getValue (  )  [inline]

Get object indexed by T.

Definition at line 83 of file PHAL_TypeKeyMap.hpp.

template<typename TypeMap>
template<typename T >
GetObjectConstRefType<T>::type PHAL::TypeKeyMap< TypeMap >::getValue (  )  const [inline]

Get object indexed by T.

Definition at line 91 of file PHAL_TypeKeyMap.hpp.

template<typename TypeMap>
template<typename T >
void PHAL::TypeKeyMap< TypeMap >::setValue ( typename GetObjectConstRefType< T >::type  x  )  [inline]

Set object indexed by T.

Definition at line 99 of file PHAL_TypeKeyMap.hpp.

template<typename TypeMap>
iterator PHAL::TypeKeyMap< TypeMap >::begin (  )  [inline]

Return an iterator that points to the first object.

Definition at line 105 of file PHAL_TypeKeyMap.hpp.

template<typename TypeMap>
const_iterator PHAL::TypeKeyMap< TypeMap >::begin (  )  const [inline]

Return an iterator that points to the first object.

Definition at line 108 of file PHAL_TypeKeyMap.hpp.

template<typename TypeMap>
iterator PHAL::TypeKeyMap< TypeMap >::end (  )  [inline]

Return an iterator that points one past the last object.

Definition at line 111 of file PHAL_TypeKeyMap.hpp.

template<typename TypeMap>
const_iterator PHAL::TypeKeyMap< TypeMap >::end (  )  const [inline]

Return an iterator that points one past the last object.

Definition at line 114 of file PHAL_TypeKeyMap.hpp.


Member Data Documentation

template<typename TypeMap>
container PHAL::TypeKeyMap< TypeMap >::objects [private]

Stores array objects of each type.

Definition at line 119 of file PHAL_TypeKeyMap.hpp.


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