20 #ifndef GEOS_DATAREPOSITORY_KEYINDEXT_HPP_
21 #define GEOS_DATAREPOSITORY_KEYINDEXT_HPP_
39 typename INDEX_TYPE = int,
40 int INVALID_INDEX = -1 >
64 m_index( INVALID_INDEX )
95 {
return m_key ==
key; }
106 KEY_TYPE
const &
key()
const
122 return m_index==INVALID_INDEX ? false :
true;
136 KEY_TYPE
const m_key;
139 INDEX_TYPE
mutable m_index;
151 template<
typename KEY_TYPE,
typename INDEX_TYPE,
int INVALID_INDEX >
std::ostream & operator<<(std::ostream &os, const KeyIndexT< KEY_TYPE, INDEX_TYPE, INVALID_INDEX > key)
Print the KeyIndex to an output stream.
constexpr static INDEX_TYPE invalid_index
the value of an invalid index
bool isIndexSet() const
Check to see of the index has been set.
KeyIndexT & operator=(KeyIndexT const &)=default
Copy assignment operator.
KeyIndexT & operator=(KeyIndexT &&)=default
Move assignment operator.
KeyIndexT()=delete
Deleted default constructor.
INDEX_TYPE index_type
the type used for the index
void setIndex(INDEX_TYPE const &index) const
Set the index.
KeyIndexT(KeyIndexT const &)=default
Copy constructor.
bool operator==(KEY_TYPE const &key) const
Comparison equals operator.
KEY_TYPE key_type
the type used for the map key
KEY_TYPE const & key() const
Access for the key.
KeyIndexT(KEY_TYPE const &key)
Constructor that sets the key.
KeyIndexT(KeyIndexT &&)=default
Move constructor.
virtual ~KeyIndexT()
Destructor.
INDEX_TYPE const & index() const
Access for the index.
std::string string
String type.