All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
26 {
27  friend class SORTED_FLOATS;
28 
29  public:
31  } //empty constructor
32  SORTED_FLOAT( //create one
33  float value, //value of entry
34  inT32 key) { //reference
35  entry = value;
36  address = key;
37  }
38  private:
39  float entry; //value of float
40  inT32 address; //key
41 };
42 
45 {
46  public:
49  it.set_to_list (&list);
50  }
56  void add(float value,
57  inT32 key);
62  void remove(inT32 key);
67  float operator[] (inT32 index);
68 
69  private:
70  SORTED_FLOAT_LIST list; //list of floats
71  SORTED_FLOAT_IT it; //iterator built-in
72 };
73 #endif
float operator[](inT32 index)
Definition: sortflts.cpp:73
#define ELISTIZEH(CLASSNAME)
Definition: elst.h:981
void add(float value, inT32 key)
Definition: sortflts.cpp:28
SORTED_FLOAT()
Definition: sortflts.h:30
SORTED_FLOAT(float value, inT32 key)
Definition: sortflts.h:32
int inT32
Definition: host.h:102