19 #ifndef GEOSX_DATAREPOSITORY_KEYINDEXT_HPP_ 20 #define GEOSX_DATAREPOSITORY_KEYINDEXT_HPP_ 38 typename INDEX_TYPE = int,
39 int INVALID_INDEX = -1 >
63 m_index( INVALID_INDEX )
94 {
return m_key == key; }
105 KEY_TYPE
const &
Key()
const 121 return m_index==INVALID_INDEX ? false :
true;
135 KEY_TYPE
const m_key;
138 INDEX_TYPE
mutable m_index;
150 template<
typename KEY_TYPE,
typename INDEX_TYPE,
int INVALID_INDEX >
151 std::ostream & operator<<( std::ostream & os, const KeyIndexT< KEY_TYPE, INDEX_TYPE, INVALID_INDEX > key )
bool operator==(KEY_TYPE const &key) const
Comparison equals operator.
void setIndex(INDEX_TYPE const &index) const
Set the index.
KeyIndexT(KEY_TYPE const &key)
Constructor that sets the key.
KeyIndexT & operator=(KeyIndexT const &)=default
Copy assignment operator.
virtual ~KeyIndexT()
Destructor.
KEY_TYPE key_type
the type used for the map key
static constexpr INDEX_TYPE invalid_index
the value of an invalid index
KEY_TYPE const & Key() const
Access for the key.
INDEX_TYPE index_type
the type used for the index
KeyIndexT()=delete
Deleted default constructor.
std::string string
String type.
INDEX_TYPE const & Index() const
Access for the index.
bool isIndexSet() const
Check to see of the index has been set.