File: lru.h

package info (click to toggle)
craft 3.5-10
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,000 kB
  • ctags: 1,602
  • sloc: cpp: 3,794; makefile: 2,319; ansic: 857; sh: 385
file content (45 lines) | stat: -rw-r--r-- 1,160 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef lru_h
#define lru_h

/*======================================================================*/
/*= CHANGES AND UPDATES                                                =*/
/*======================================================================*/
/*= date   person file       subject                                   =*/
/*=--------------------------------------------------------------------=*/
/*=                                                                    =*/
/*= 031193 hua    lru.h      created                                   =*/
/*=                                                                    =*/
/*======================================================================*/

#define no_lru_remove -1
#define nil_ptr       -1

#include "bool.h"

class lru
  {public :

   int  *pred;
   int  *suc;
   int  size;
   
   int  cand;
   int  fresh;
   int  free;


        lru    (int size);
        ~lru   ();

   void dump      ();
   void clear     ();
   void remove    (int  id);
   void access    (int  id);
   int  add       (bool &with_remove);
   int  candidate (bool &with_remove);
   int  freshest  (int  no);

 };

#endif