A list-update policy that moves elements to the front of the list based on the counter algorithm.
This class is likely to slightly change interface when random number generators become part of the C++ standard.
Parameter | Description | Default Value |
Size_Type |
Size type. |
size_t |
Metadata_Reference |
Metadata reference type. |
std::allocator< counter_update_metadata>:: reference |
Type | Definition | Description |
size_type |
Size_Type |
Size type used for counting the number of times each node is accessed until the count is reset to 0 and the node moved to the front of the list. |
Method | Description |
counter_update_policy (size_type max_count = 5) |
Constructor. max_count determines the the number of times each node is accessed until the count is reset to 0 and the node moved to the front of the list. |
void swap (counter_update_policy &r_other) |
Swaps content. |
Method | Description |
inline size_type get_max_count () const |
Returns the max count of each metadata (number of times it is accessed until moved to the front of the list). |
Type | Definition | Description |
metadata_type |
counter_update_metadata |
Metadata on which this functor operates. |
metadata_reference |
Metadata_Reference |
Reference to metadata on which this functor operates. |
Method | Description |
metadata_type operator() () const |
Creates a metadata object. |
bool operator() (metadata_reference r_data) const |
Decides whether a metadata object should be moved to the front of the list. |