3 #ifndef INCLUDE_NN_NLIB_SUCCINCT_LOUDS_H_
4 #define INCLUDE_NN_NLIB_SUCCINCT_LOUDS_H_
6 #include "nn/nlib/Swap.h"
9 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS)
10 #undef NLIB_VIS_PUBLIC
11 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT
21 NLIB_MOVE_MEMBER_HELPER_1(
Louds, m_Sbv);
23 template <
class TREEITER>
33 bool IsLeaf(uint32_t pos)
const NLIB_NOEXCEPT {
34 return this->FirstChild(pos) < 0;
36 size_t MemSize() const NLIB_NOEXCEPT {
return m_Sbv.MemSize(); }
37 void Reset() NLIB_NOEXCEPT { m_Sbv.Reset(); }
46 template <
class TREEITER>
51 m_Sbv.Init(2 * num_nodes + 1);
57 idx += iter.GetNumChildren();
59 }
while (iter.BfsMoveNext());
61 NLIB_ASSERT(idx == 2 * num_nodes + 1);
72 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS)
73 #undef NLIB_VIS_PUBLIC
74 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT
77 #endif // INCLUDE_NN_NLIB_SUCCINCT_LOUDS_H_
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Defines the basic classes that form the basis to Rank and Select operations.
Louds() noexcept
Instantiates the object.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
Succinct data structure to hold a set of 32-bit unsigned integers for a Rank/Select operation...
bool IsLeaf(uint32_t pos) const noexcept
Determines whether the specified node is a leaf (or external) node.
bool Import(BinaryReader *r) noexcept
Reads the written object.
void swap(Louds &rhs) noexcept
Swaps the contents of an object.
~Louds() noexcept
Destructor.
void Reset() noexcept
Returns the object to the state immediately after the constructor is called.
Provides a compact tree structure that can provide various operations in constant time...
The class for writing binary to streams (to OutputStream).
The class for reading binary from streams (from InputStream).
bool Export(BinaryWriter *w) const noexcept
Writes the object to the file.
size_t MemSize() const noexcept
Returns the amount of memory explicitly allocated by the class.