ARB
Classes | Macros | Typedefs | Enumerations | Functions | Variables
probe_tree.h File Reference
#include <bits/wordsize.h>
#include <static_assert.h>
#include "probe.h"
Include dependency graph for probe_tree.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pt_global
 
struct  POS_TREE1
 
struct  POS_TREE2
 
struct  PT_short_chain_header
 
struct  PT_long_chain_header
 
class  AbsLoc
 
class  DataLoc
 
class  ReadableDataLoc
 
class  ChainIteratorStage1
 
struct  ChainIteratorStage1::_U::_S
 
struct  ChainIteratorStage1::_U::_L
 
class  ChainIteratorStage2
 

Macros

#define PT_CHAIN_NTERM   250
 
#define PT_SHORT_SIZE   0xffff
 
#define PT_INIT_CHAIN_SIZE   20
 
#define IS_SINGLE_BRANCH_NODE   0x40
 
#define LONG_SONS   0x80
 
#define PT1_BASE_SIZE   sizeof(POS_TREE1)
 
#define PT1_EMPTY_LEAF_SIZE   (PT1_BASE_SIZE+6)
 
#define PT1_LEAF_SIZE(leaf)   (PT1_BASE_SIZE+6+2*PT_GLOBAL.count_bits[3][(leaf)->flags])
 
#define PT1_CHAIN_SHORT_HEAD_SIZE   (PT1_BASE_SIZE+2+sizeof(PT_PNTR))
 
#define PT1_CHAIN_LONG_HEAD_SIZE   (PT1_CHAIN_SHORT_HEAD_SIZE+2)
 
#define PT1_EMPTY_NODE_SIZE   PT1_BASE_SIZE
 
#define PT1_MIN_CHAIN_ENTRY_SIZE   (sizeof(PT_PNTR)+3*sizeof(char))
 
#define PT1_MAX_CHAIN_ENTRY_SIZE   (sizeof(PT_PNTR)+3*(sizeof(int)+1))
 
#define PT1_NODE_WITHSONS_SIZE(sons)   (PT1_EMPTY_NODE_SIZE+sizeof(PT_PNTR)*(sons))
 
#define PT_NODE_SON_COUNT(node)   (PT_GLOBAL.count_bits[PT_BASES][node->flags])
 
#define PT1_NODE_SIZE(node)   PT1_NODE_WITHSONS_SIZE(PT_NODE_SON_COUNT(node))
 
#define FLAG_TYPE_BITS   2
 
#define FLAG_FREE_BITS   (8-FLAG_TYPE_BITS)
 
#define FLAG_FREE_BITS_MASK   ((1<<FLAG_TYPE_BITS)-1)
 
#define FLAG_TYPE_BITS_MASK   (0xFF^FLAG_FREE_BITS_MASK)
 
#define SHORT_CHAIN_HEADER_ELEMS   3
 
#define SHORT_CHAIN_HEADER_FLAG_BIT   (1<<4)
 
#define SHORT_CHAIN_HEADER_SIZE_MASK   0x07
 

Typedefs

typedef PT1_TYPE TYPE
 

Enumerations

enum  PT1_TYPE {
  PT1_LEAF = 0, PT1_CHAIN = 1, PT1_NODE = 2, PT1_SAVED = 3,
  PT1_UNDEF = 4
}
 
enum  PT2_TYPE { PT2_LEAF = PT1_LEAF, PT2_CHAIN = PT1_CHAIN, PT2_NODE = PT1_NODE }
 

Functions

struct POS_TREE1 __attribute__ ((packed))
 
static void init_static ()
 
const charudata () const
 
POS_TREE1get_father () const
 
void set_father (POS_TREE1 *new_father)
 
void clear_fathers ()
 
void set_type (TYPE type)
 
TYPE get_type () const
 
bool is_node () const
 
bool is_leaf () const
 
bool is_chain () const
 
bool is_saved () const
 
 STATIC_ASSERT (SHORT_CHAIN_HEADER_SIZE_MASK >=SHORT_CHAIN_HEADER_ELEMS)
 
 STATIC_ASSERT ((SHORT_CHAIN_HEADER_SIZE_MASK &SHORT_CHAIN_HEADER_FLAG_BIT)==0)
 
 STATIC_ASSERT (sizeof(PT_long_chain_header) >=sizeof(PT_short_chain_header))
 
 STATIC_ASSERT ((sizeof(PT_short_chain_header)/SHORT_CHAIN_HEADER_ELEMS *(SHORT_CHAIN_HEADER_ELEMS+1)) > sizeof(PT_long_chain_header))
 
size_t PT_node_size (POS_TREE2 *node)
 
template<typename PT >
PT * PT_read_son (PT *node, PT_base base)
 
template<>
POS_TREE2PT_read_son< POS_TREE2 > (POS_TREE2 *node, PT_base base)
 
template<>
POS_TREE1PT_read_son< POS_TREE1 > (POS_TREE1 *node, PT_base base)
 
size_t PT_leaf_size (POS_TREE2 *node)
 
bool operator== (const AbsLoc &loc1, const AbsLoc &loc2)
 
const charPT_READ_CHAIN_ENTRY_stage_2 (const char *ptr, int refabspos, AbsLoc &loc)
 
charPT_WRITE_CHAIN_ENTRY (char *ptr, int refabspos, int name, const int apos)
 
template<typename PT , typename T >
int PT_forwhole_chain (PT *node, T &func)
 
template<typename T >
int PT_forwhole_chain (POS_TREE1 *node, T &func)
 
template<typename T >
int PT_forwhole_chain (POS_TREE2 *node, T &func)
 

Variables

pt_global PT_GLOBAL
 
uchar flags
 
POS_TREE1father
 
static TYPE flag_2_type [256]
 
struct PT_short_chain_header __attribute__
 

Macro Definition Documentation

#define PT_CHAIN_NTERM   250

Definition at line 27 of file probe_tree.h.

#define PT_SHORT_SIZE   0xffff

Definition at line 28 of file probe_tree.h.

Referenced by PT_create_leaf().

#define PT_INIT_CHAIN_SIZE   20

Definition at line 29 of file probe_tree.h.

#define IS_SINGLE_BRANCH_NODE   0x40

Definition at line 150 of file probe_tree.h.

Referenced by PT_node_size(), and PT_read_son< POS_TREE2 >().

#define LONG_SONS   0x80

Definition at line 155 of file probe_tree.h.

Referenced by PT_node_size(), and PT_read_son< POS_TREE2 >().

#define PT1_BASE_SIZE   sizeof(POS_TREE1)

Definition at line 161 of file probe_tree.h.

Referenced by PTD_set_object_to_saved_status().

#define PT1_EMPTY_LEAF_SIZE   (PT1_BASE_SIZE+6)

Definition at line 163 of file probe_tree.h.

Referenced by PT_create_leaf().

#define PT1_LEAF_SIZE (   leaf)    (PT1_BASE_SIZE+6+2*PT_GLOBAL.count_bits[3][(leaf)->flags])

Definition at line 164 of file probe_tree.h.

Referenced by PT_change_leaf_to_node(), PT_leaf_to_chain(), and PTD_write_tip_to_disk().

#define PT1_CHAIN_SHORT_HEAD_SIZE   (PT1_BASE_SIZE+2+sizeof(PT_PNTR))

Definition at line 165 of file probe_tree.h.

#define PT1_CHAIN_LONG_HEAD_SIZE   (PT1_CHAIN_SHORT_HEAD_SIZE+2)

Definition at line 166 of file probe_tree.h.

#define PT1_EMPTY_NODE_SIZE   PT1_BASE_SIZE

Definition at line 167 of file probe_tree.h.

Referenced by PT_change_leaf_to_node(), and PTD_write_node_to_disk().

#define PT1_MIN_CHAIN_ENTRY_SIZE   (sizeof(PT_PNTR)+3*sizeof(char))

Definition at line 169 of file probe_tree.h.

#define PT1_MAX_CHAIN_ENTRY_SIZE   (sizeof(PT_PNTR)+3*(sizeof(int)+1))

Definition at line 170 of file probe_tree.h.

#define PT1_NODE_WITHSONS_SIZE (   sons)    (PT1_EMPTY_NODE_SIZE+sizeof(PT_PNTR)*(sons))

Definition at line 172 of file probe_tree.h.

#define PT_NODE_SON_COUNT (   node)    (PT_GLOBAL.count_bits[PT_BASES][node->flags])

Definition at line 174 of file probe_tree.h.

#define PT1_NODE_SIZE (   node)    PT1_NODE_WITHSONS_SIZE(PT_NODE_SON_COUNT(node))

Definition at line 175 of file probe_tree.h.

Referenced by PT_create_leaf().

#define FLAG_TYPE_BITS   2

Definition at line 180 of file probe_tree.h.

#define FLAG_FREE_BITS   (8-FLAG_TYPE_BITS)

Definition at line 181 of file probe_tree.h.

Referenced by PT_create_leaf(), POS_TREE1::set_type(), and POS_TREE2::set_type().

#define FLAG_FREE_BITS_MASK   ((1<<FLAG_TYPE_BITS)-1)

Definition at line 182 of file probe_tree.h.

#define FLAG_TYPE_BITS_MASK   (0xFF^FLAG_FREE_BITS_MASK)

Definition at line 183 of file probe_tree.h.

#define SHORT_CHAIN_HEADER_ELEMS   3

Definition at line 257 of file probe_tree.h.

Referenced by PT_add_to_chain(), and ChainIteratorStage1::_U::_S::set_loc().

#define SHORT_CHAIN_HEADER_FLAG_BIT   (1<<4)
#define SHORT_CHAIN_HEADER_SIZE_MASK   0x07

Typedef Documentation

typedef PT2_TYPE TYPE

Definition at line 41 of file probe_tree.h.

Enumeration Type Documentation

enum PT1_TYPE
Enumerator
PT1_LEAF 
PT1_CHAIN 
PT1_NODE 
PT1_SAVED 
PT1_UNDEF 

Definition at line 185 of file probe_tree.h.

enum PT2_TYPE
Enumerator
PT2_LEAF 
PT2_CHAIN 
PT2_NODE 

Definition at line 193 of file probe_tree.h.

Function Documentation

struct POS_TREE1 __attribute__ ( (packed)  )
static void init_static ( )
static
char * udata ( ) const

Definition at line 46 of file probe_tree.h.

POS_TREE1* __attribute__::get_father ( ) const
void __attribute__::set_father ( POS_TREE1 new_father)

Definition at line 53 of file probe_tree.h.

void __attribute__::clear_fathers ( )
void set_type ( TYPE  type)

Definition at line 59 of file probe_tree.h.

Referenced by ED4_block::autocorrect_type(), and ED4_block::toggle_type().

TYPE get_type ( ) const
bool is_node ( ) const

Definition at line 66 of file probe_tree.h.

bool is_leaf ( ) const
bool is_chain ( ) const

Definition at line 68 of file probe_tree.h.

bool __attribute__::is_saved ( ) const

Definition at line 69 of file probe_tree.h.

STATIC_ASSERT ( SHORT_CHAIN_HEADER_SIZE_MASK >=  SHORT_CHAIN_HEADER_ELEMS)
STATIC_ASSERT ( sizeof(PT_long_chain_header) >=sizeof(PT_short_chain_header )
size_t PT_node_size ( POS_TREE2 node)
inline
template<typename PT >
PT* PT_read_son ( PT *  node,
PT_base  base 
)
inline
template<>
POS_TREE2* PT_read_son< POS_TREE2 > ( POS_TREE2 node,
PT_base  base 
)
inline
template<>
POS_TREE1* PT_read_son< POS_TREE1 > ( POS_TREE1 node,
PT_base  base 
)
inline

Definition at line 401 of file probe_tree.h.

References pt_global::count_bits, NULp, pt_assert_stage, and STAGE1.

size_t PT_leaf_size ( POS_TREE2 node)
inline

Definition at line 408 of file probe_tree.h.

References pt_global::count_bits, POS_TREE2::flags, and PT_BASES.

Referenced by PT_statistic::analyse().

bool operator== ( const AbsLoc loc1,
const AbsLoc loc2 
)
inline

Definition at line 489 of file probe_tree.h.

References AbsLoc::is_equal().

const char* PT_READ_CHAIN_ENTRY_stage_2 ( const char ptr,
int  refabspos,
AbsLoc loc 
)
inline

Definition at line 529 of file probe_tree.h.

References AbsLoc::get_name(), pt_assert_stage, PT_read_compact_nat(), and STAGE2.

char* PT_WRITE_CHAIN_ENTRY ( char ptr,
int  refabspos,
int  name,
const int  apos 
)
inline

Definition at line 542 of file probe_tree.h.

References pt_assert_stage, PT_write_compact_nat(), and STAGE1.

template<typename PT , typename T >
int PT_forwhole_chain ( PT *  node,
T func 
)
template<typename T >
int PT_forwhole_chain ( POS_TREE1 node,
T func 
)

Definition at line 693 of file probe_tree.h.

References error(), pt_assert_stage, and STAGE1.

template<typename T >
int PT_forwhole_chain ( POS_TREE2 node,
T func 
)

Definition at line 702 of file probe_tree.h.

References error(), pt_assert_stage, and STAGE2.

Variable Documentation

pt_global PT_GLOBAL

Definition at line 22 of file PT_prefixtree.cxx.

Referenced by probe_struct_global::enter_stage(), and PT_change_link_in_father().

uchar flags
POS_TREE1* father
static TYPE flag_2_type
static

Definition at line 43 of file probe_tree.h.

struct POS_TREE2 __attribute__

Referenced by print_file().