Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
fmmd.H File Reference

File memory-mapped data utilities. More...

#include <tpl_tree.H>
#include <tpl_binNode.H>
#include <tpl_dlist.H>
#include <fstream>
Include dependency graph for fmmd.H:

Go to the source code of this file.

Classes

struct  Two_Nibbles
 
struct  pre_in< T >
 

Functions

template<class Key >
BinNode< Key > * forest_to_bin (Tree_Node< Key > *root)
 
template<class Key >
void insert_child (BinNode< Key > *bin_node, Tree_Node< Key > *&tree)
 
template<class Key >
void insert_sibling (BinNode< Key > *bin_node, Tree_Node< Key > *&tree)
 
template<class Key >
void bin_to_tree (BinNode< Key > *bn, Tree_Node< Key > *&tree)
 
template<class Key >
Tree_Node< Key > * bin_to_forest (BinNode< Key > *bn)
 
char nibble_to_char (unsigned char c)
 
char * stringficate (void *src_data, size_t src_size, char *result)
 
int char_to_nibble (unsigned char c)
 
void destringficate (void *result, size_t src_size, char *src_data)
 
template<class Node , class T >
static void get_pre_in_list (Node *node, Dlist< T > &l, int &pos)
 
template<class Key >
void write_to_stream (BinNode< Key > *root, ofstream &output_stream)
 
template<class Key >
BinNode< Key > * build_tree (DynArray< Key > &preorder, int inf_p, int sup_p, DynArray< Key > &inorder, int inf_i, int sup_i)
 
template<class Key >
BinNode< Key > * read_from_stream (ifstream &input_stream)
 

Detailed Description

File memory-mapped data utilities.

Author
Leandro Rabindranath León

Definition in file fmmd.H.

Function Documentation

◆ bin_to_forest()

template<class Key >
Tree_Node< Key > * bin_to_forest ( BinNode< Key > *  bn)

Definition at line 101 of file fmmd.H.

References bin_to_tree(), and KEY.

◆ bin_to_tree()

template<class Key >
void bin_to_tree ( BinNode< Key > *  bn,
Tree_Node< Key > *&  tree 
)

Definition at line 85 of file fmmd.H.

References bin_to_tree(), insert_child(), and insert_sibling().

Referenced by bin_to_forest(), and bin_to_tree().

◆ build_tree()

template<class Key >
BinNode< Key > * build_tree ( DynArray< Key > &  preorder,
int  inf_p,
int  sup_p,
DynArray< Key > &  inorder,
int  inf_i,
int  sup_i 
)

Definition at line 217 of file fmmd.H.

References build_tree(), inorder(), preorder(), and root().

◆ char_to_nibble()

int char_to_nibble ( unsigned char  c)

Definition at line 142 of file fmmd.H.

Referenced by destringficate().

◆ destringficate()

void destringficate ( void *  result,
size_t  src_size,
char *  src_data 
)

Definition at line 148 of file fmmd.H.

References char_to_nibble(), Two_Nibbles::n1, and Two_Nibbles::n2.

Referenced by read_from_stream().

◆ forest_to_bin()

template<class Key >
BinNode< Key > * forest_to_bin ( Tree_Node< Key > *  root)

Definition at line 46 of file fmmd.H.

References forest_to_bin(), BinNode< Key >::getL(), BinNode< Key >::getR(), and root().

Referenced by forest_to_bin().

◆ get_pre_in_list()

template<class Node , class T >
static void get_pre_in_list ( Node node,
Dlist< T > &  l,
int &  pos 
)
inlinestatic

Definition at line 171 of file fmmd.H.

References Aleph::DynList< T >::append(), get_pre_in_list(), KEY, and l.

Referenced by get_pre_in_list(), and write_to_stream().

◆ insert_child()

template<class Key >
void insert_child ( BinNode< Key > *  bin_node,
Tree_Node< Key > *&  tree 
)

Definition at line 61 of file fmmd.H.

References KEY.

Referenced by bin_to_tree().

◆ insert_sibling()

template<class Key >
void insert_sibling ( BinNode< Key > *  bin_node,
Tree_Node< Key > *&  tree 
)

Definition at line 73 of file fmmd.H.

References KEY.

Referenced by bin_to_tree().

◆ nibble_to_char()

char nibble_to_char ( unsigned char  c)

Definition at line 119 of file fmmd.H.

Referenced by stringficate().

◆ read_from_stream()

template<class Key >
BinNode< Key > * read_from_stream ( ifstream &  input_stream)

Definition at line 251 of file fmmd.H.

References destringficate(), inorder(), and preorder().

◆ stringficate()

char * stringficate ( void *  src_data,
size_t  src_size,
char *  result 
)

Definition at line 124 of file fmmd.H.

References Two_Nibbles::n1, Two_Nibbles::n2, and nibble_to_char().

Referenced by write_to_stream().

◆ write_to_stream()

template<class Key >
void write_to_stream ( BinNode< Key > *  root,
ofstream &  output_stream 
)

Definition at line 191 of file fmmd.H.

References get_pre_in_list(), KEY, l, root(), and stringficate().