The Battle for Wesnoth  1.15.13+dev
Public Member Functions | Public Attributes | List of all members
gui2::value_type Struct Reference

Value type for the cache. More...

Public Member Functions

 value_type (const surface &surf)

Public Attributes

const surface surf
 The cached image. More...
unsigned age
 The age of the image. More...

Detailed Description

Value type for the cache.

Definition at line 94 of file minimap.cpp.

Constructor & Destructor Documentation

◆ value_type()

gui2::value_type::value_type ( const surface surf)

Definition at line 96 of file minimap.cpp.

Member Data Documentation

◆ age

unsigned gui2::value_type::age

The age of the image.

Every time an image is used its age is increased by one. Once the cache is full 25% of the cache is emptied. This is done by halving the age of the items in the cache and then erase the 25% with the lowest age. If items have the same age their order is unspecified.

Definition at line 111 of file minimap.cpp.

◆ surf

const surface gui2::value_type::surf

The cached image.

Definition at line 101 of file minimap.cpp.

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