dastrie::builder< key_tmpl, value_tmpl, doublearray_traits > Class Template Reference
[DASTrie API]


Detailed Description

template<class key_tmpl, class value_tmpl, class doublearray_traits = doublearray5_traits>
class dastrie::builder< key_tmpl, value_tmpl, doublearray_traits >

A builder of a double-array trie.

This class builds a double-array trie from records sorted in dictionary order of keys.

Parameters:
key_tmpl A type that represents a record key. This type must be either char* or std::string .
value_tmpl A type that represents a record value.
doublearray_traits A class in which various properties of double-array elements are described.


Public Types

typedef key_tmpl key_type
 A type that represents a record.
typedef value_tmpl value_type
 A type that represents a record value.
typedef doublearray_traits::element_type element_type
 A type that represents an element of a double array.
typedef doublearray_traits::base_type base_type
 A type that represents a base value in a double array.
typedef doublearray_traits::check_type check_type
 A type that represents a check value in a double array.
typedef std::vector< element_typedoublearray_type
 A type that implements a double array.
typedef doublearray_type::size_type size_type
 A type of sizes.
typedef void(*) callback_type (void *instance, size_type i, size_type n)
 The type of a progress callback function.

Public Member Functions

 builder ()
 Constructs a builder.
virtual ~builder ()
 Destructs the builder.
void set_callback (void *instance, callback_type callback)
 Sets a progress callback.
void build (const record_type *first, const record_type *last)
 Builds a double-array trie from sorted records.
void clear ()
 Initializes the double array.
const doublearray_typedoublearray () const
 Obtains a read-only access to the double-array.
const otailtail () const
 Obtains a read-only access to the tail array.
const uint8_t * table () const
 Obtains a read-only access to the character table.
void write (std::ostream &os)
 Writes out the double-array trie to an output stream.

Data Structures

class  exception
 Exception class. More...
struct  record_type
 A type that represents a record (a pair of key and value). More...
struct  stat_type
 Statistics of the double array trie. More...


Copyright (c) 2002-2008 by Naoaki Okazaki
Mon Nov 10 12:28:35 2008