librime: Darts::DoubleArrayImpl< typename, typename, T, typename > Class Template Reference

| librime 1.2 Rime Input Method Engine, the core library

Classes | Public Types | Public Member Functions | List of all members
Darts::DoubleArrayImpl< typename, typename, T, typename > Class Template Reference

`#include <darts.h>`

## Classes
struct | result_pair_type

## Public Types
typedef T | value_type
typedef Details::char_type | key_type
typedef value_type | result_type

## Public Member Functions
| DoubleArrayImpl ()
virtual | ~DoubleArrayImpl ()
void | set_result (value_type *result, value_type value, std::size_t) const
void | set_result (result_pair_type *result, value_type value, std::size_t length) const
void | set_array (const void *ptr, std::size_t size=0)
const void * | array () const
void | clear ()
std::size_t | unit_size () const
std::size_t | size () const
std::size_t | total_size () const
std::size_t | nonzero_size () const
int | build (std::size_t num_keys, const key_type *const *keys, const std::size_t *lengths=NULL, const value_type *values=NULL, Details::progress_func_type progress_func=NULL)
int | open (const char *file_name, const char *mode="rb", std::size_t offset=0, std::size_t size=0)
int | save (const char *file_name, const char *mode="wb", std::size_t offset=0) const
template<class U>
void | exactMatchSearch (const key_type *key, U &result, std::size_t length=0, std::size_t node_pos=0) const
template<class U>
U | exactMatchSearch (const key_type *key, std::size_t length=0, std::size_t node_pos=0) const
template<class U>
std::size_t | commonPrefixSearch (const key_type *key, U *results, std::size_t max_num_results, std::size_t length=0, std::size_t node_pos=0) const
value_type | traverse (const key_type *key, std::size_t &node_pos, std::size_t &key_pos, std::size_t length=0) const

## Member Typedef Documentation

## ◆ key_type

template<typename, typename, typename T, typename>

typedef Details::char_type Darts::DoubleArrayImpl< typename, typename, T, typename >::key_type

## ◆ result_type

template<typename, typename, typename T, typename>

typedef value_type Darts::DoubleArrayImpl< typename, typename, T, typename >::result_type

## ◆ value_type

template<typename, typename, typename T, typename>

typedef T Darts::DoubleArrayImpl< typename, typename, T, typename >::value_type

## Constructor & Destructor Documentation

## ◆ DoubleArrayImpl()

template<typename, typename, typename T, typename>

Darts::DoubleArrayImpl< typename, typename, T, typename >::DoubleArrayImpl | ( |  | ) |
| inline

## ◆ ~DoubleArrayImpl()

template<typename, typename, typename T, typename>

virtual Darts::DoubleArrayImpl< typename, typename, T, typename >::~DoubleArrayImpl | ( |  | ) |
| inlinevirtual

## Member Function Documentation

## ◆ array()

template<typename, typename, typename T, typename>

const void * Darts::DoubleArrayImpl< typename, typename, T, typename >::array | ( |  | ) | const
| inline

## ◆ build()

template<typename A, typename B, typename T, typename C>

int Darts::DoubleArrayImpl< A, B, T, C >::build | ( | std::size_t | num_keys,
|  | const key_type *const * | keys,
|  | const std::size_t * | lengths = NULL,
|  | const value_type * | values = NULL,
|  | Details::progress_func_type | progress_func = NULL )

## ◆ clear()

template<typename, typename, typename T, typename>

void Darts::DoubleArrayImpl< typename, typename, T, typename >::clear | ( |  | ) |
| inline

## ◆ commonPrefixSearch()

template<typename A, typename B, typename T, typename C>
template<typename U>

std::size_t Darts::DoubleArrayImpl< A, B, T, C >::commonPrefixSearch | ( | const key_type * | key,
|  | U * | results,
|  | std::size_t | max_num_results,
|  | std::size_t | length = 0,
|  | std::size_t | node_pos = 0 ) const
| inline

## ◆ exactMatchSearch() [1/2]

template<typename A, typename B, typename T, typename C>
template<typename U>

U Darts::DoubleArrayImpl< A, B, T, C >::exactMatchSearch | ( | const key_type * | key,
|  | std::size_t | length = 0,
|  | std::size_t | node_pos = 0 ) const
| inline

## ◆ exactMatchSearch() [2/2]

template<typename, typename, typename T, typename>
template<class U>

void Darts::DoubleArrayImpl< typename, typename, T, typename >::exactMatchSearch | ( | const key_type * | key,
|  | U & | result,
|  | std::size_t | length = 0,
|  | std::size_t | node_pos = 0 ) const
| inline

## ◆ nonzero_size()

template<typename, typename, typename T, typename>

std::size_t Darts::DoubleArrayImpl< typename, typename, T, typename >::nonzero_size | ( |  | ) | const
| inline

## ◆ open()

template<typename A, typename B, typename T, typename C>

int Darts::DoubleArrayImpl< A, B, T, C >::open | ( | const char * | file_name,
|  | const char * | mode = "rb",
|  | std::size_t | offset = 0,
|  | std::size_t | size = 0 )

## ◆ save()

template<typename A, typename B, typename T, typename C>

int Darts::DoubleArrayImpl< A, B, T, C >::save | ( | const char * | file_name,
|  | const char * | mode = "wb",
|  | std::size_t | offset = 0 ) const

## ◆ set_array()

template<typename, typename, typename T, typename>

void Darts::DoubleArrayImpl< typename, typename, T, typename >::set_array | ( | const void * | ptr,
|  | std::size_t | size = 0 )
| inline

## ◆ set_result() [1/2]

template<typename, typename, typename T, typename>

void Darts::DoubleArrayImpl< typename, typename, T, typename >::set_result | ( | result_pair_type * | result,
|  | value_type | value,
|  | std::size_t | length ) const
| inline

## ◆ set_result() [2/2]

template<typename, typename, typename T, typename>

void Darts::DoubleArrayImpl< typename, typename, T, typename >::set_result | ( | value_type * | result,
|  | value_type | value,
|  | std::size_t | ) const
| inline

## ◆ size()

template<typename, typename, typename T, typename>

std::size_t Darts::DoubleArrayImpl< typename, typename, T, typename >::size | ( |  | ) | const
| inline

## ◆ total_size()

template<typename, typename, typename T, typename>

std::size_t Darts::DoubleArrayImpl< typename, typename, T, typename >::total_size | ( |  | ) | const
| inline

## ◆ traverse()

template<typename A, typename B, typename T, typename C>

DoubleArrayImpl< A, B, T, C >::value_type Darts::DoubleArrayImpl< A, B, T, C >::traverse | ( | const key_type * | key,
|  | std::size_t & | node_pos,
|  | std::size_t & | key_pos,
|  | std::size_t | length = 0 ) const
| inline

## ◆ unit_size()

template<typename, typename, typename T, typename>

std::size_t Darts::DoubleArrayImpl< typename, typename, T, typename >::unit_size | ( |  | ) | const
| inline

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

- darts.h