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 ()
 
template<typename U , typename = std::enable_if_t<std::is_convertible_v<U, ObjType>>>
 KeyObjectPair (const std::string &key_in, U &&obj_in, bool isActive_in=true)
 
 KeyObjectPair (const KeyObjectPair &kop)
 Copy-constructor. More...
 
 KeyObjectPair (KeyObjectPair &&kop)
 Move-constructor. More...
 
KeyObjectPairoperator= (const KeyObjectPair &kop)
 Copy-assignment operator. More...
 
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 73 of file Teuchos_StringIndexedOrderedValueObjectContainer.hpp.

Constructor & Destructor Documentation

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

Copy-constructor.

Definition at line 88 of file Teuchos_StringIndexedOrderedValueObjectContainer.hpp.

template<class ObjType>
Teuchos::StringIndexedOrderedValueObjectContainerBase::KeyObjectPair< ObjType >::KeyObjectPair ( KeyObjectPair< ObjType > &&  kop)
inline

Move-constructor.

Definition at line 91 of file Teuchos_StringIndexedOrderedValueObjectContainer.hpp.

Member Function Documentation

template<class ObjType>
KeyObjectPair& Teuchos::StringIndexedOrderedValueObjectContainerBase::KeyObjectPair< ObjType >::operator= ( const KeyObjectPair< ObjType > &  kop)
inline

Copy-assignment operator.

Definition at line 94 of file Teuchos_StringIndexedOrderedValueObjectContainer.hpp.

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: