Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Sorting lists of lists... (http://www.velocityreviews.com/forums/t283794-sorting-lists-of-lists.html)

JustSomeGuy 06-17-2004 05:44 PM

Sorting lists of lists...
 
I have a class structure like:

class image : public list<class element> {};

class series : public list<class image>
{
public:
bool operator< (const image & img) const
{
return (image_id < img.image_id);
}
};

class study : public list<class series> {};
class patient : public list<class study> {};
class patients : public list<patient> {};

So sorting the series class is quite simple I just:

series s;
s.sort();

An unprocessed series can contain images from different studies and
different patients.

--------->>>> What I want to do is go through the series list and build
up a a sorted patient list.... (patients please!)

Within each image is a image_id, patient_id, series_id and a study_id.

What is the best way to build up the patient list?

I was thinking of modifying the series operator< and add the patient_id,
study_id series_id, and image_id so that at least that
list is completly sorted.... Then traverse the series list and populate
the patient list... (class patients)

Should I add a operator< to each class?

What do you think?






All times are GMT. The time now is 08:35 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.