Container for storing objects indexed by types. More...
#include <PHAL_TypeKeyMap.hpp>
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. |
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.
typedef Teuchos::Array<Teuchos::any> PHAL::TypeKeyMap< TypeMap >::container |
Typedef of container used.
Definition at line 67 of file PHAL_TypeKeyMap.hpp.
typedef container::iterator PHAL::TypeKeyMap< TypeMap >::iterator |
Typedef for iterator.
Definition at line 70 of file PHAL_TypeKeyMap.hpp.
typedef container::const_iterator PHAL::TypeKeyMap< TypeMap >::const_iterator |
Typedef for const_iterator.
Definition at line 73 of file PHAL_TypeKeyMap.hpp.
PHAL::TypeKeyMap< TypeMap >::TypeKeyMap | ( | ) | [inline] |
Default constructor.
Definition at line 76 of file PHAL_TypeKeyMap.hpp.
PHAL::TypeKeyMap< TypeMap >::~TypeKeyMap | ( | ) | [inline] |
Destructor.
Definition at line 79 of file PHAL_TypeKeyMap.hpp.
GetObjectRefType<T>::type PHAL::TypeKeyMap< TypeMap >::getValue | ( | ) | [inline] |
Get object indexed by T.
Definition at line 83 of file PHAL_TypeKeyMap.hpp.
GetObjectConstRefType<T>::type PHAL::TypeKeyMap< TypeMap >::getValue | ( | ) | const [inline] |
Get object indexed by T.
Definition at line 91 of file PHAL_TypeKeyMap.hpp.
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.
iterator PHAL::TypeKeyMap< TypeMap >::begin | ( | ) | [inline] |
Return an iterator that points to the first object.
Definition at line 105 of file PHAL_TypeKeyMap.hpp.
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.
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.
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.
container PHAL::TypeKeyMap< TypeMap >::objects [private] |
Stores array objects of each type.
Definition at line 119 of file PHAL_TypeKeyMap.hpp.