olp-cpp-sdk  1.22.0
Public Types | Public Member Functions | Friends | List of all members
olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator Class Reference

A constant iterator of the LruCache object. More...

#include <LruCache.h>

Inheritance diagram for olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator:
Inheritance graph
[legend]
Collaboration diagram for olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator:
Collaboration graph
[legend]

Public Types

typedef std::bidirectional_iterator_tag iterator_category
 A typedef for the iterator category.
 
typedef std::ptrdiff_t difference_type
 A typedef for the difference type.
 
typedef ValueType value_type
 A typedef for the ValueType type.
 
typedef const value_typereference
 A typedef for the ValueType constant reference.
 
typedef const value_typepointer
 A typedef for the ValueType constant pointer.
 

Public Member Functions

 const_iterator ()=default
 Creates a constant iterator object.
 
 const_iterator (const const_iterator &)=default
 Creates a constant iterator object.
 
const_iteratoroperator= (const const_iterator &)=default
 Copies this and the specified iterator to this. More...
 
bool operator== (const const_iterator &other) const
 Checks whether the values of the const_iterator parameter are the same as the values of the other parameter. More...
 
bool operator!= (const const_iterator &other) const
 Checks whether the values of the const_iterator parameter are not the same as the values of the other parameter. More...
 
const_iteratoroperator++ ()
 Iterates to the next LruCache object. More...
 
const_iterator operator++ (int)
 Iterates the specified number of times to the next LruCache object. More...
 
const_iteratoroperator-- ()
 Iterates to the previous LruCache object. More...
 
const_iterator operator-- (int)
 Iterates the specified number of times to the previous LruCache object. More...
 
reference operator* () const
 Gets a reference to this object. More...
 
pointer operator-> () const
 Gets a pointer to this object. More...
 
- Public Member Functions inherited from olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::ValueType
const Key & key () const
 Gets the key of the ValueType object. More...
 
const Value & value () const
 Gets the value of the ValueType object. More...
 

Friends

template<typename , typename , typename , typename , template< typename > class>
class LruCache
 

Additional Inherited Members

- Protected Attributes inherited from olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::ValueType
MapType::const_iterator m_it
 A typename of the map constant iterator.
 

Detailed Description

template<typename Key, typename Value, typename CacheCostFunc = CacheCost<Value>, typename Compare = std::less<Key>, template< typename > class Alloc = std::allocator>
class olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator

A constant iterator of the LruCache object.

Member Function Documentation

◆ operator!=()

template<typename Key , typename Value , typename CacheCostFunc = CacheCost<Value>, typename Compare = std::less<Key>, template< typename > class Alloc = std::allocator>
bool olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator::operator!= ( const const_iterator other) const
inline

Checks whether the values of the const_iterator parameter are not the same as the values of the other parameter.

Parameters
otherThe const_iterator instance.
Returns
True if the values are not the same; false otherwise.

◆ operator*()

template<typename Key , typename Value , typename CacheCostFunc = CacheCost<Value>, typename Compare = std::less<Key>, template< typename > class Alloc = std::allocator>
reference olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator::operator* ( ) const
inline

Gets a reference to this object.

Returns
The reference to this.

◆ operator++() [1/2]

template<typename Key , typename Value , typename CacheCostFunc , typename Compare , template< typename > class Alloc>
LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator & olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator::operator++
inline

Iterates to the next LruCache object.

Returns
A reference to this.

◆ operator++() [2/2]

template<typename Key , typename Value , typename CacheCostFunc , typename Compare , template< typename > class Alloc>
LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator::operator++ ( int  )
inline

Iterates the specified number of times to the next LruCache object.

Returns
A new constant iterator.

◆ operator--() [1/2]

template<typename Key , typename Value , typename CacheCostFunc , typename Compare , template< typename > class Alloc>
LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator & olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator::operator--
inline

Iterates to the previous LruCache object.

Returns
A reference to this.

◆ operator--() [2/2]

template<typename Key , typename Value , typename CacheCostFunc , typename Compare , template< typename > class Alloc>
LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator::operator-- ( int  )
inline

Iterates the specified number of times to the previous LruCache object.

Returns
A new constant iterator.

◆ operator->()

template<typename Key , typename Value , typename CacheCostFunc = CacheCost<Value>, typename Compare = std::less<Key>, template< typename > class Alloc = std::allocator>
pointer olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator::operator-> ( ) const
inline

Gets a pointer to this object.

Returns
The pointer to this.

◆ operator=()

template<typename Key , typename Value , typename CacheCostFunc = CacheCost<Value>, typename Compare = std::less<Key>, template< typename > class Alloc = std::allocator>
const_iterator& olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator::operator= ( const const_iterator )
default

Copies this and the specified iterator to this.

Returns
A refenrence to this object.

◆ operator==()

template<typename Key , typename Value , typename CacheCostFunc , typename Compare , template< typename > class Alloc>
bool olp::utils::LruCache< Key, Value, CacheCostFunc, Compare, Alloc >::const_iterator::operator== ( const const_iterator other) const
inline

Checks whether the values of the const_iterator parameter are the same as the values of the other parameter.

Parameters
otherThe const_iterator instance.
Returns
True if the values are the same; false otherwise.

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