The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Private Types | Private Attributes | List of all members
image::modification_queue Class Reference

A modified priority queue used to order image modifications. More...

#include <image_modifications.hpp>

Public Member Functions

 modification_queue ()
 
bool empty () const
 
void push (modification *mod)
 Adds mod to the queue (unless mod is nullptr). More...
 
void pop ()
 Removes the top element from the queue. More...
 
std::size_t size () const
 Returns the number of elements in the queue. More...
 
modificationtop () const
 Returns the top element in the queue . More...
 

Private Types

typedef std::map< int, std::vector< std::shared_ptr< modification > >, std::greater< int > > map_type
 Map from a mod's priority() to the mods having that priority. More...
 

Private Attributes

map_type priorities_
 Map from a mod's priority() to the mods having that priority. More...
 

Detailed Description

A modified priority queue used to order image modifications.

The priorities for this queue are to order modifications by priority(), then by the order they are added to the queue.

Definition at line 34 of file image_modifications.hpp.

Member Typedef Documentation

◆ map_type

typedef std::map<int, std::vector<std::shared_ptr<modification> >, std::greater<int> > image::modification_queue::map_type
private

Map from a mod's priority() to the mods having that priority.

Definition at line 53 of file image_modifications.hpp.

Constructor & Destructor Documentation

◆ modification_queue()

image::modification_queue::modification_queue ( )
inline

Definition at line 40 of file image_modifications.hpp.

Member Function Documentation

◆ empty()

bool image::modification_queue::empty ( ) const
inline

Definition at line 45 of file image_modifications.hpp.

References pop(), priorities_, push(), size(), and top().

Referenced by image::load_image_sub_file().

◆ pop()

void image::modification_queue::pop ( )

Removes the top element from the queue.

Definition at line 46 of file image_modifications.cpp.

References priorities_.

Referenced by BOOST_AUTO_TEST_CASE(), empty(), and image::load_image_sub_file().

◆ push()

void image::modification_queue::push ( modification mod)

Adds mod to the queue (unless mod is nullptr).

Definition at line 37 of file image_modifications.cpp.

References priorities_, and image::modification::priority().

Referenced by BOOST_AUTO_TEST_CASE(), image::modification::decode(), and empty().

◆ size()

std::size_t image::modification_queue::size ( ) const

Returns the number of elements in the queue.

Definition at line 60 of file image_modifications.cpp.

References priorities_.

Referenced by BOOST_AUTO_TEST_CASE(), and empty().

◆ top()

modification * image::modification_queue::top ( ) const

Returns the top element in the queue .

Definition at line 71 of file image_modifications.cpp.

References ERR_DP, utils::parenthetical_split(), priorities_, and utils::split().

Referenced by BOOST_AUTO_TEST_CASE(), empty(), and image::load_image_sub_file().

Member Data Documentation

◆ priorities_

map_type image::modification_queue::priorities_
private

Map from a mod's priority() to the mods having that priority.

Definition at line 55 of file image_modifications.hpp.

Referenced by empty(), pop(), push(), size(), and top().


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