STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Types | List of all members
__gnu_pbds::lu_counter_policy< Max_Count, _Alloc > Class Template Reference

#include <ext/pb_ds/list_update_policy.hpp>

Inheritance diagram for __gnu_pbds::lu_counter_policy< Max_Count, _Alloc >:
__gnu_pbds::detail::lu_counter_policy_base< _Alloc::size_type >

Public Types

enum  { max_count = Max_Count }
 
typedef _Alloc allocator_type
 
typedef allocator_type::size_type size_type
 
typedef
detail::lu_counter_metadata
< size_type
metadata_type
 Metadata on which this functor operates. More...
 
typedef
__rebind_m::other::reference 
metadata_reference
 Reference to metadata on which this functor operates. More...
 

Public Member Functions

metadata_type operator() () const
 Creates a metadata object. More...
 
bool operator() (metadata_reference r_data) const
 

Private Types

typedef
detail::lu_counter_policy_base
< size_type
base_type
 
typedef _Alloc::template
rebind< metadata_type
__rebind_m
 
- Private Types inherited from __gnu_pbds::detail::lu_counter_policy_base< _Alloc::size_type >
typedef _Alloc::size_type size_type
 

Additional Inherited Members

- Private Member Functions inherited from __gnu_pbds::detail::lu_counter_policy_base< _Alloc::size_type >
lu_counter_metadata< size_typeoperator() (size_type max_size) const
 
bool operator() (Metadata_Reference r_data, size_type m_max_count) const
 

Detailed Description

template<std::size_t Max_Count = 5, typename _Alloc = std::allocator<char>>
class __gnu_pbds::lu_counter_policy< Max_Count, _Alloc >

A list-update policy that moves elements to the front of the list based on the counter algorithm.

Member Typedef Documentation

template<std::size_t Max_Count = 5, typename _Alloc = std::allocator<char>>
typedef _Alloc::template rebind<metadata_type> __gnu_pbds::lu_counter_policy< Max_Count, _Alloc >::__rebind_m
private
template<std::size_t Max_Count = 5, typename _Alloc = std::allocator<char>>
typedef _Alloc __gnu_pbds::lu_counter_policy< Max_Count, _Alloc >::allocator_type
template<std::size_t Max_Count = 5, typename _Alloc = std::allocator<char>>
typedef detail::lu_counter_policy_base<size_type> __gnu_pbds::lu_counter_policy< Max_Count, _Alloc >::base_type
private
template<std::size_t Max_Count = 5, typename _Alloc = std::allocator<char>>
typedef __rebind_m::other::reference __gnu_pbds::lu_counter_policy< Max_Count, _Alloc >::metadata_reference

Reference to metadata on which this functor operates.

template<std::size_t Max_Count = 5, typename _Alloc = std::allocator<char>>
typedef detail::lu_counter_metadata<size_type> __gnu_pbds::lu_counter_policy< Max_Count, _Alloc >::metadata_type

Metadata on which this functor operates.

template<std::size_t Max_Count = 5, typename _Alloc = std::allocator<char>>
typedef allocator_type::size_type __gnu_pbds::lu_counter_policy< Max_Count, _Alloc >::size_type

Member Enumeration Documentation

template<std::size_t Max_Count = 5, typename _Alloc = std::allocator<char>>
anonymous enum
Enumerator
max_count 

When some element is accessed this number of times, it will be moved to the front of the list.

100  {
103  max_count = Max_Count
104  };
Definition: list_update_policy.hpp:103

Member Function Documentation

template<std::size_t Max_Count = 5, typename _Alloc = std::allocator<char>>
metadata_type __gnu_pbds::lu_counter_policy< Max_Count, _Alloc >::operator() ( ) const
inline

Creates a metadata object.

120  { return base_type::operator()(max_count); }
Definition: list_update_policy.hpp:103
lu_counter_metadata< size_type > operator()(size_type max_size) const
Definition: lu_counter_metadata.hpp:73
template<std::size_t Max_Count = 5, typename _Alloc = std::allocator<char>>
bool __gnu_pbds::lu_counter_policy< Max_Count, _Alloc >::operator() ( metadata_reference  r_data) const
inline

Decides whether a metadata object should be moved to the front of the list.

126  { return base_type::operator()(r_data, max_count); }
Definition: list_update_policy.hpp:103
lu_counter_metadata< size_type > operator()(size_type max_size) const
Definition: lu_counter_metadata.hpp:73

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