tesseract
4.0.0-beta.1-59-g2cc4
sortflts.h
Go to the documentation of this file.
1
/**********************************************************************
2
* File: sortflts.h (Formerly sfloats.h)
3
* Description: Code to maintain a sorted list of floats.
4
* Author: Ray Smith
5
* Created: Mon Oct 4 16:15:40 BST 1993
6
*
7
* (C) Copyright 1993, Hewlett-Packard Ltd.
8
** Licensed under the Apache License, Version 2.0 (the "License");
9
** you may not use this file except in compliance with the License.
10
** You may obtain a copy of the License at
11
** http://www.apache.org/licenses/LICENSE-2.0
12
** Unless required by applicable law or agreed to in writing, software
13
** distributed under the License is distributed on an "AS IS" BASIS,
14
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
** See the License for the specific language governing permissions and
16
** limitations under the License.
17
*
18
**********************************************************************/
19
20
#ifndef SORTFLTS_H
21
#define SORTFLTS_H
22
23
#include "
elst.h
"
24
25
class
SORTED_FLOAT
:
public
ELIST_LINK
26
{
27
friend
class
SORTED_FLOATS
;
28
29
public
:
30
SORTED_FLOAT
() {
31
}
//empty constructor
32
SORTED_FLOAT
(
//create one
33
float
value,
//value of entry
34
int32_t key) {
//reference
35
entry = value;
36
address = key;
37
}
38
private
:
39
float
entry;
//value of float
40
int32_t address;
//key
41
};
42
43
ELISTIZEH
(
SORTED_FLOAT
)
44
class
SORTED_FLOATS
45
{
46
public
:
48
SORTED_FLOATS
() {
49
it.set_to_list (&list);
50
}
56
void
add
(
float
value,
57
int32_t key);
62
void
remove
(int32_t key);
67
float
operator[]
(int32_t index);
68
69
private
:
70
SORTED_FLOAT_LIST list;
//list of floats
71
SORTED_FLOAT_IT it;
//iterator built-in
72
};
73
#endif
SORTED_FLOAT
Definition:
sortflts.h:25
SORTED_FLOAT::SORTED_FLOAT
SORTED_FLOAT(float value, int32_t key)
Definition:
sortflts.h:32
ELIST_LINK
Definition:
elst.h:84
SORTED_FLOATS::add
void add(float value, int32_t key)
Definition:
sortflts.cpp:28
elst.h
ELISTIZEH
#define ELISTIZEH(CLASSNAME)
Definition:
elst.h:948
SORTED_FLOATS
Definition:
sortflts.h:44
SORTED_FLOATS::operator[]
float operator[](int32_t index)
Definition:
sortflts.cpp:73
SORTED_FLOATS::SORTED_FLOATS
SORTED_FLOATS()
Definition:
sortflts.h:48
SORTED_FLOAT::SORTED_FLOAT
SORTED_FLOAT()
Definition:
sortflts.h:30
textord
sortflts.h
Generated on Wed Mar 28 2018 20:00:38 for tesseract by
1.8.13