Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Teuchos::StringIndexedOrderedValueObjectContainerBase::KeyObjectPair< ObjType > Class Template Reference

A simple aggregate type to bind a key string and and objects value. More...

#include <Teuchos_StringIndexedOrderedValueObjectContainer.hpp>

Public Member Functions

 KeyObjectPair ()
 
 KeyObjectPair (const std::string &key_in, const ObjType &obj_in, bool isActive_in=true)
 
 KeyObjectPair (const KeyObjectPair< ObjType > &kop)
 
KeyObjectPair< ObjType > & operator= (const KeyObjectPair< ObjType > &kop)
 
bool isActive () const
 

Static Public Member Functions

static KeyObjectPair< ObjType > makeInvalid ()
 

Public Attributes

const std::string & first
 
ObjType second
 
std::string key
 

Detailed Description

template<class ObjType>
class Teuchos::StringIndexedOrderedValueObjectContainerBase::KeyObjectPair< ObjType >

A simple aggregate type to bind a key string and and objects value.

This is meant to be a drop-in replacement for std::pair<std::string, ObjType>. That is why the key and the object are called 'first' and 'second'.

Note that there is no invariant on the key and the object value so there is no need to encapsulate them. This is good because we can't since we need to provide 'first' and 'second' as raw data members to match std::pair. However, we don't want to allow users to be able to change the 'first' key string (like you can't with the std::map::value_type returned in the iterator) so we use a const reference for 'first'.

Definition at line 106 of file Teuchos_StringIndexedOrderedValueObjectContainer.hpp.

Constructor & Destructor Documentation

template<class ObjType>
Teuchos::StringIndexedOrderedValueObjectContainerBase::KeyObjectPair< ObjType >::KeyObjectPair ( const std::string &  key_in,
const ObjType &  obj_in,
bool  isActive_in = true 
)
inline
template<class ObjType>
Teuchos::StringIndexedOrderedValueObjectContainerBase::KeyObjectPair< ObjType >::KeyObjectPair ( const KeyObjectPair< ObjType > &  kop)
inline

Member Function Documentation

template<class ObjType>
KeyObjectPair<ObjType>& Teuchos::StringIndexedOrderedValueObjectContainerBase::KeyObjectPair< ObjType >::operator= ( const KeyObjectPair< ObjType > &  kop)
inline
template<class ObjType>
static KeyObjectPair<ObjType> Teuchos::StringIndexedOrderedValueObjectContainerBase::KeyObjectPair< ObjType >::makeInvalid ( )
inlinestatic
template<class ObjType>
bool Teuchos::StringIndexedOrderedValueObjectContainerBase::KeyObjectPair< ObjType >::isActive ( ) const
inline

Member Data Documentation

template<class ObjType>
const std::string& Teuchos::StringIndexedOrderedValueObjectContainerBase::KeyObjectPair< ObjType >::first
template<class ObjType>
ObjType Teuchos::StringIndexedOrderedValueObjectContainerBase::KeyObjectPair< ObjType >::second
template<class ObjType>
std::string Teuchos::StringIndexedOrderedValueObjectContainerBase::KeyObjectPair< ObjType >::key

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