Othello
 All Classes Files Functions Variables Macros
MulOth< keyType, IOvalueType > Class Template Reference

Describes the data structure Grouped l-Othello. It classifies keys of keyType into 2^L classes.
The keys are first classifed into groups, each group is then maintained by one l-Othello. More...

#include <muloth.h>

Collaboration diagram for MulOth< keyType, IOvalueType >:

Public Member Functions

 MulOth (uint32_t _L, uint32_t NN)
 This generates toy data for test purpose.
 
 MulOth (uint32_t _L, unsigned char _split, class FileReader< keyType, IOvalueType > *_reader)
 Construct a Grouped l-Othello from a file. More...
 
 MulOth (uint32_t _L, const char *fname, unsigned char _split, class IOHelper< keyType, IOvalueType > *_helper, bool fileIsSorted=false)
 
IOvalueType query (const keyType &k)
 returns a L-bit integer query value for a key.
 
void printall ()
 
void writeToFile (const char *fname)
 write Grouped l-Othello to a file. More...
 
 MulOth (const char *fname, IOHelper< keyType, IOvalueType > *_helper)
 construct a Grouped l-Othello from a file.
 

Public Attributes

vector< keyType > removedKeys
 list of skipped keys for all underlying Othello.
 
bool buildsucc
 
IOHelper< keyType, IOvalueType > * helper
 

Detailed Description

template<typename keyType, typename IOvalueType = uint16_t>
class MulOth< keyType, IOvalueType >

Describes the data structure Grouped l-Othello. It classifies keys of keyType into 2^L classes.
The keys are first classifed into groups, each group is then maintained by one l-Othello.

Note
Query a key of keyType always return uint64_t, however, only the lowest L bits are meaningful.

Constructor & Destructor Documentation

template<typename keyType , typename IOvalueType = uint16_t>
MulOth< keyType, IOvalueType >::MulOth ( uint32_t  _L,
unsigned char  _split,
class FileReader< keyType, IOvalueType > *  _reader 
)
inline

Construct a Grouped l-Othello from a file.

Parameters
uint32_t_L
char* fname the file contains key/value pairs, each in a line.
unsignedchar _split the keys are first classifed according to their highest *_split* bits. There are in total 2^_split groups. Classification method as described in splitgrp.
IOHelper_helper identifies how to convert a raw data to keytype and group.
boolfileIsSorted When fileIsSorted, assume that the file is sorted so that the keys appear in the ascending order of groups.

Member Function Documentation

template<typename keyType , typename IOvalueType = uint16_t>
void MulOth< keyType, IOvalueType >::writeToFile ( const char *  fname)
inline

write Grouped l-Othello to a file.

Note
file structure.
0x00 32bit split
0x04 version (reserved);
0x20 32Byte info for othello 0
0x40 32Byte info for othello 1
...
...
Array for othello 0
..,
32bit nRemovedKeys
(64bit) keyType &removedKeys* 0

The documentation for this class was generated from the following file: