]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/priorities.hh
release: 1.0.1
[lilypond.git] / flower / include / priorities.hh
1 /*
2   priorities.hh -- declare Priorities
3
4   source file of the Flower Library
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef PRIORITIES_HH
11 #define PRIORITIES_HH
12
13 #include "array.hh"
14
15 /**
16   A sorted (uni)set. Should connect with PQueue
17  */
18 template<class K>
19 struct Priorities :    Array<K>
20 {
21     void insert (K k) 
22     {
23         int i=0;
24         for (; i < size(); i++) {
25             if (elem (i) == k)
26                 return;
27             if (elem (i) > k)
28                 break;
29         }
30         Array<K>::insert (k, i);
31     }
32 };
33 #endif // PRIORITIES_HH
34
35