A modified priority queue used to order image modifications. More...
#include <image_modifications.hpp>
Public Member Functions | |
bool | empty () const |
void | push (std::unique_ptr< modification > &&mod) |
Adds mod to the queue. 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... | |
const modification & | top () const |
Returns a const reference to the top element in the queue. More... | |
Private Attributes | |
std::map< int, std::vector< std::unique_ptr< modification > >, std::greater< int > > | priorities_ |
Map from a mod's priority() to the mods having that priority. More... | |
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.
Invariant for this class:
At the beginning and end of each member function call, there are no empty vectors in priorities_.
Definition at line 43 of file image_modifications.hpp.
|
inline |
Definition at line 46 of file image_modifications.hpp.
References priorities_.
Referenced by image::load_image_sub_file().
void image::modification_queue::pop | ( | ) |
Removes the top element from the queue.
Definition at line 45 of file image_modifications.cpp.
References priorities_.
Referenced by BOOST_AUTO_TEST_CASE(), and image::load_image_sub_file().
void image::modification_queue::push | ( | std::unique_ptr< modification > && | mod | ) |
Adds mod to the queue.
Definition at line 40 of file image_modifications.cpp.
References priorities_.
Referenced by BOOST_AUTO_TEST_CASE(), and image::modification::decode().
std::size_t image::modification_queue::size | ( | ) | const |
Returns the number of elements in the queue.
Definition at line 59 of file image_modifications.cpp.
References priorities_.
Referenced by BOOST_AUTO_TEST_CASE().
const modification & image::modification_queue::top | ( | ) | const |
Returns a const reference to the top element in the queue.
Definition at line 69 of file image_modifications.cpp.
References priorities_.
Referenced by BOOST_AUTO_TEST_CASE(), and image::load_image_sub_file().
|
private |