EMAN2
Public Member Functions | Private Attributes
EMAN::ImageSort Class Reference

#include <emutil.h>

Collaboration diagram for EMAN::ImageSort:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ImageSort (int n)
 ~ImageSort ()
void sort ()
void set (int i, float score)
int get_index (int i) const
float get_score (int i) const
int size () const

Private Attributes

ImageScoreimage_scores
int n

Detailed Description

Definition at line 403 of file emutil.h.


Constructor & Destructor Documentation

ImageSort::ImageSort ( int  n)

Definition at line 1279 of file emutil.cpp.

References Assert, image_scores, n, and nn().

{
        Assert(nn > 0);
        n = nn;
        image_scores = new ImageScore[n];
}
ImageSort::~ImageSort ( )

Definition at line 1286 of file emutil.cpp.

References image_scores.

{
        if (image_scores) {
                delete [] image_scores;
                image_scores = NULL;
        }
}

Member Function Documentation

int ImageSort::get_index ( int  i) const

Definition at line 1306 of file emutil.cpp.

References Assert, image_scores, and EMAN::ImageScore::index.

{
        Assert(i >= 0);

        return image_scores[i].index;
}
float ImageSort::get_score ( int  i) const

Definition at line 1314 of file emutil.cpp.

References Assert, image_scores, and EMAN::ImageScore::score.

{
        Assert(i >= 0);

        return image_scores[i].score;
}
void ImageSort::set ( int  i,
float  score 
)

Definition at line 1299 of file emutil.cpp.

References Assert, and image_scores.

{
        Assert(i >= 0);

        image_scores[i] = ImageScore(i, score);
}
int ImageSort::size ( ) const

Definition at line 1322 of file emutil.cpp.

References n.

{
        return n;
}
void ImageSort::sort ( )

Definition at line 1294 of file emutil.cpp.

References image_scores, imgscore_cmp(), and n.

{
        qsort(image_scores, n, sizeof(ImageScore), imgscore_cmp);
}

Member Data Documentation

Definition at line 416 of file emutil.h.

Referenced by get_index(), get_score(), ImageSort(), set(), sort(), and ~ImageSort().

int EMAN::ImageSort::n [private]

Definition at line 417 of file emutil.h.

Referenced by ImageSort(), size(), and sort().


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