4 #ifndef IBIS_DICTIONARY_H
5 #define IBIS_DICTIONARY_H
27 uint32_t
size()
const {
return key_.size();}
31 const char*
find(
const char* str)
const;
34 uint32_t
insert(
const char* str);
41 int read(
const char* name);
42 int write(
const char* name)
const;
66 int readRaw(
const char*, FILE *);
85 return (i < raw_.size() ? raw_[i] : raw_[0]);
94 const uint32_t ind = operator[](str);
95 if (ind < raw_.size())
99 #endif // IBIS_DICTIONARY_H
void clear()
Clear the allocated memory. Leave only the NULL entry.
Definition: dict-0.cpp:363
const char * find(const char *str) const
Find the given string in the dictionary.
Definition: dict-0.h:92
void sort(array_t< uint32_t > &)
Reassign the integer values to the strings.
Definition: dict-0.cpp:816
int readKeys(const char *, FILE *)
Read the ordered strings.
Definition: dict-0.cpp:314
array_t< uint32_t > code_
Member variable code_ contains the integer code for each string in key_.
Definition: dict-0.h:61
const char * operator[](uint32_t i) const
Return a string corresponding to the integer.
Definition: dict-0.h:84
int morph(const dictionary &, array_t< uint32_t > &) const
Produce an array that maps the integers in old dictionary to the new one.
Definition: dict-0.cpp:920
void swap(array_t< T > &rhs)
Swap the content of two array_t objects.
Definition: array_t.h:184
The current implementation of FastBit is code named IBIS; most data structures and functions are in t...
Definition: bord.h:16
uint32_t insertRaw(char *str)
Non-copying insert.
Definition: dict-0.cpp:730
int read(const char *name)
Read the content of the named file.
Definition: dict-0.cpp:173
void copy(const dictionary &rhs)
Copy function. Use copy constructor and swap the content.
Definition: dict-0.cpp:60
int merge(const dictionary &)
Merge the incoming dictionary with this one.
Definition: dict-0.cpp:834
array_t< const char * > key_
Member variable key_ contains the string values in alphabetic order.
Definition: dict-0.h:58
uint32_t insert(const char *str)
Insert a string to the dictionary.
Definition: dict-0.cpp:578
uint32_t size() const
Return the number of valid (not null) strings in the dictionary.
Definition: dict-0.h:27
Defines minor utility functions and common classes used by FastBit.
int write(const char *name) const
Write the content of the dictionary to the named file.
Definition: dict-0.cpp:81
dictionary()
Default constructor. Generates one (NULL) entry.
Definition: dict-0.h:24
array_t< const char * > raw_
Member variable raw_ contains the string values in the order of the code assignment.
Definition: dict-0.h:56
void swap(dictionary &)
Swap the content of two dictionaries.
Definition: dict-0.h:74
array_t< char * > buffer_
Member varaible buffer_ contains a list of pointers to the memory that holds the strings.
Definition: dict-0.h:64
bool equal_to(const ibis::dictionary &) const
Compare whether this dicrionary and the other are equal in content.
Definition: dict-0.cpp:48
Provide a dual-directional mapping between strings and integers.
Definition: dict-0.h:19
uint32_t appendOrdered(const char *str)
Append a string to the dictionary.
Definition: dict-0.cpp:686
int readRaw(const char *, FILE *)
Read the raw strings.
Definition: dict-0.cpp:251
void patternSearch(const char *pat, array_t< uint32_t > &matches) const
Find all codes that matches the SQL LIKE pattern.
Definition: dict-0.cpp:375