Tkrzw
Public Member Functions | Friends | List of all members
tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator Class Referencefinal

Iterator of records. More...

#include <tkrzw_containers.h>

Public Member Functions

 Iterator (const Iterator &rhs)
 Copy constructor. More...
 
 operator ConstIterator () const
 Cast operator to the const iterator. More...
 
Recordoperator* ()
 Gets the reference to the current record. More...
 
const Recordoperator* () const
 Gets the reference to the current record. More...
 
Recordoperator-> ()
 Accesses a member of the current record. More...
 
Recordoperator-> () const
 Accesses a member of the current record. More...
 
Iteratoroperator= (const Iterator &rhs)
 Assignment operator from the self type. More...
 
bool operator== (const Iterator &rhs) const
 Equality operator with the self type. More...
 
bool operator== (const ConstIterator &rhs) const
 Equality operator with the const type. More...
 
bool operator!= (const Iterator &rhs) const
 Non-equality operator with the self type. More...
 
bool operator!= (const ConstIterator &rhs) const
 Non-equality operator with the const type. More...
 
Iteratoroperator++ ()
 Preposting increment operator. More...
 
Iterator operator++ (int)
 Postpositive increment operator. More...
 
Iteratoroperator-- ()
 Preposting decrement operator. More...
 
Iterator operator-- (int)
 Postpositive decrement operator. More...
 

Friends

class LinkedHashMap
 

Detailed Description

template<typename KEYTYPE, typename VALUETYPE, typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
class tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator

Iterator of records.

The iterator is invalidated when the current record is removed.

Constructor & Destructor Documentation

◆ Iterator()

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::Iterator ( const Iterator rhs)

Copy constructor.

Parameters
rhsThe right-hand-side object.

Member Function Documentation

◆ operator ConstIterator()

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator ConstIterator ( ) const

Cast operator to the const iterator.

Returns
The casted const iterator.

◆ operator*() [1/2]

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
Record& tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator* ( )

Gets the reference to the current record.

Returns
The reference to the current record.

◆ operator*() [2/2]

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
const Record& tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator* ( ) const

Gets the reference to the current record.

Returns
The reference to the current record.

◆ operator->() [1/2]

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
Record* tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator-> ( )

Accesses a member of the current record.

Returns
The pointer to the current record.

◆ operator->() [2/2]

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
Record* tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator-> ( ) const

Accesses a member of the current record.

Returns
The pointer to the current record.

◆ operator=()

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
Iterator& tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator= ( const Iterator rhs)

Assignment operator from the self type.

Parameters
rhsThe right-hand-side object.
Returns
The reference to itself.

◆ operator==() [1/2]

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
bool tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator== ( const Iterator rhs) const

Equality operator with the self type.

Parameters
rhsThe right-hand-side object.
Returns
True if the both are equal, or false if not.

◆ operator==() [2/2]

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
bool tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator== ( const ConstIterator rhs) const

Equality operator with the const type.

Parameters
rhsThe right-hand-side object.
Returns
True if the both are equal, or false if not.

◆ operator!=() [1/2]

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
bool tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator!= ( const Iterator rhs) const

Non-equality operator with the self type.

Parameters
rhsThe right-hand-side object.
Returns
False if the both are equal, or true if not.

◆ operator!=() [2/2]

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
bool tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator!= ( const ConstIterator rhs) const

Non-equality operator with the const type.

Parameters
rhsThe right-hand-side object.
Returns
False if the both are equal, or true if not.

◆ operator++() [1/2]

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
Iterator& tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator++ ( )

Preposting increment operator.

Returns
The iterator itself.

◆ operator++() [2/2]

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
Iterator tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator++ ( int  )

Postpositive increment operator.

Returns
An iterator of the old position.

◆ operator--() [1/2]

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
Iterator& tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator-- ( )

Preposting decrement operator.

Returns
The iterator itself.

◆ operator--() [2/2]

template<typename KEYTYPE , typename VALUETYPE , typename HASHTYPE = std::hash<KEYTYPE>, typename EQUALTOTYPE = std::equal_to<KEYTYPE>>
Iterator tkrzw::LinkedHashMap< KEYTYPE, VALUETYPE, HASHTYPE, EQUALTOTYPE >::Iterator::operator-- ( int  )

Postpositive decrement operator.

Returns
An iterator of the old position.