This commit is contained in:
Shunsuke Kanda 2021-07-02 15:00:59 +09:00
parent 8f59dfbd41
commit bc7b06bcb5
3 changed files with 13 additions and 7 deletions

View file

@ -282,12 +282,18 @@ Enumerate() = {
## API ## API
`xcdat.hpp` provides Xcdat can be used by including `xcdat.hpp`.
- `xcdat::trie_7_type`: ### Trie dictionary types
- `xcdat::trie_8_type`:
### Dictionary class The two dictionary types are difined.
- `xcdat::trie_8_type` is the trie dictionary using standard DACs using 8-bit integers for elements.
- `xcdat::trie_7_type` is the trie dictionary using pointer-based DACs using 7-bit integers for elements.
### Trie dictionary class
The trie dictionary has the following members.
```c++ ```c++
//! A compressed string dictionary based on an improved double-array trie. //! A compressed string dictionary based on an improved double-array trie.
@ -350,7 +356,7 @@ class trie {
//! Get the number of unused DA units. //! Get the number of unused DA units.
std::uint64_t num_free_units() const; std::uint64_t num_free_units() const;
//! Get the number of unused DA units. //! Get the length of TAIL vector.
std::uint64_t tail_length() const; std::uint64_t tail_length() const;
//! Lookup the ID of the keyword. //! Lookup the ID of the keyword.

View file

@ -10,8 +10,8 @@
namespace xcdat { namespace xcdat {
using trie_7_type = trie<bc_vector_7>;
using trie_8_type = trie<bc_vector_8>; using trie_8_type = trie<bc_vector_8>;
using trie_7_type = trie<bc_vector_7>;
//! Set the continuous memory block to a new trie instance. //! Set the continuous memory block to a new trie instance.
template <class Trie> template <class Trie>

View file

@ -97,7 +97,7 @@ class trie {
return m_bcvec.num_free_units(); return m_bcvec.num_free_units();
} }
//! Get the number of unused DA units. //! Get the length of TAIL vector.
inline std::uint64_t tail_length() const { inline std::uint64_t tail_length() const {
return m_tvec.size(); return m_tvec.size();
} }