textord/sortflts.h

Go to the documentation of this file.
00001 
00020 #ifndef           SORTFLTS_H
00021 #define           SORTFLTS_H
00022 
00023 #include          "elst.h"
00024 #include          "notdll.h"
00025 #include          "notdll.h"
00026 
00031 class SORTED_FLOAT:public ELIST_LINK
00032 {
00033   friend class SORTED_FLOATS;
00034 
00035   public:
00036     SORTED_FLOAT() { 
00037     }                            //empty constructor
00038     SORTED_FLOAT(              //create one
00039                  float value,  //value of entry
00040                  INT32 key) {  //reference
00041       entry = value;
00042       address = key;
00043     }
00044   private:
00045     float entry;                 //value of float
00046     INT32 address;               //key
00047 };
00048 
00049 ELISTIZEH (SORTED_FLOAT)
00054 class SORTED_FLOATS
00055 {
00056   public:
00057     SORTED_FLOATS() {  //empty constructor
00058       it.set_to_list (&list);
00059     }
00060     void add(              //add sample
00061              float value,  //sample float
00062              INT32 key);   //retrieval key
00063     void remove(             //delete sample
00064                 INT32 key);  //key to delete
00065     float operator[] (           //index to list
00066       INT32 index);              //item to get
00067 
00068   private:
00069     SORTED_FLOAT_LIST list;      //list of floats
00070     SORTED_FLOAT_IT it;          //iterator built-in
00071 };
00072 #endif

Generated on Wed Feb 28 19:49:12 2007 for Tesseract by  doxygen 1.5.1