forked from venkatarun95/genericCC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
whiskertree.hh
48 lines (32 loc) · 1.13 KB
/
whiskertree.hh
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
46
47
48
#ifndef WHISKERTREE_HH
#define WHISKERTREE_HH
#include <array>
#include "whisker.hh"
#include "memoryrange.hh"
#include "dna.pb.h"
class WhiskerTree {
private:
MemoryRange _domain;
std::vector< WhiskerTree > _children;
std::vector< Whisker > _leaf;
const Whisker * whisker( const Memory & _memory ) const;
public:
WhiskerTree();
WhiskerTree( const Whisker & whisker, const bool bisect );
const Whisker & use_whisker( const Memory & _memory, const bool track ) const;
void use_window( const unsigned int win ) const;
bool replace( const Whisker & w );
bool replace( const Whisker & src, const WhiskerTree & dst );
const Whisker * most_used( const unsigned int max_generation ) const;
void reset_counts( void );
void promote( const unsigned int generation );
void reset_generation( void );
std::string str( void ) const;
std::string str( const unsigned int total ) const;
unsigned int total_whisker_queries( void ) const;
unsigned int num_children( void ) const;
bool is_leaf( void ) const;
RemyBuffers::WhiskerTree DNA( void ) const;
WhiskerTree( const RemyBuffers::WhiskerTree & dna );
};
#endif