Hi,
I want to set up a priority queue for my class DeformationCandidate and sets the priority based on the value of the density variable. I am having a rough time determining the syntax for the queue and am not sure how I need to overload the ==, <, > operators.
DeformationCandidate.h:
Code:
class DeformationCandidate
{
public:
DeformationCandidate();
~DeformationCandidate(){};
//The row number of the candidate point
int row;
//The column number of the candidate point
int column;
//The tissue density of the candidate point
int density;
private:
};
DeformationCandidate.cpp:
Code:
# include "DeformationCandidate.h"
DeformationCandidate::DeformationCandidate()
{
//Initialize variable values
row = -1;
column = -1;
density = -1;
}
First, how do I declare the queue? Is it:
Code:
std::priority_queue<DeformationCandidate> _deformationQueue;
Second, what do I need to do for the operators?
I'm having a hard time finding a good resource for priority queues, so please let me know if you have any recommended resources.
Thanks!
JackR