tlx
Loading...
Searching...
No Matches
StringShadowLcpPtr< StringSet_, LcpType_ > Class Template Reference

Objectified string array pointer and shadow pointer array for out-of-place swapping of pointers. More...

#include <string_ptr.hpp>

Public Types

typedef StringSet_ StringSet
 
typedef LcpType_ LcpType
 
typedef StringSet::String String
 
typedef StringSet::Iterator Iterator
 

Public Member Functions

 StringShadowLcpPtr (const StringSet &original, const StringSet &shadow, LcpType *lcp, bool flipped=false)
 constructor specifying all attributes
 
const StringSet & active () const
 return currently active array
 
const StringSet & shadow () const
 return current shadow array
 
bool flipped () const
 true if flipped to back array
 
size_t size () const
 return valid length
 
StringShadowLcpPtr sub (size_t offset, size_t sub_size) const
 Advance (both) pointers by given offset, return sub-array without flip.
 
StringShadowLcpPtr flip (size_t offset, size_t sub_size) const
 construct a StringShadowLcpPtr object specifying a sub-array with flipping to other array.
 
StringShadowLcpPtr copy_back () const
 return subarray pointer to n strings in original array, might copy from shadow before returning.
 
LcpType * lcp () const
 return LCP array pointer
 
LcpType get_lcp (size_t i) const
 return LCP array value
 
void set_lcp (size_t i, const LcpType &v) const
 set the i-th lcp to v and check its value
 
void fill_lcp (const LcpType &v) const
 fill entire LCP array with v, excluding the first lcp[0] position!
 

Static Public Attributes

static const bool with_lcp
 if we want to save the LCPs
 

Protected Attributes

StringSet active_
 strings (front) and temporary shadow (back) array
 
StringSet shadow_
 
LcpType * lcp_
 lcp array
 
bool flipped_
 false if active_ is original, true if shadow_ is original
 

Detailed Description

template<typename StringSet_, typename LcpType_>
class tlx::sort_strings_detail::StringShadowLcpPtr< StringSet_, LcpType_ >

Objectified string array pointer and shadow pointer array for out-of-place swapping of pointers.

Definition at line 247 of file string_ptr.hpp.

Member Typedef Documentation

◆ Iterator

template<typename StringSet_ , typename LcpType_ >
typedef StringSet::Iterator Iterator

Definition at line 253 of file string_ptr.hpp.

◆ LcpType

template<typename StringSet_ , typename LcpType_ >
typedef LcpType_ LcpType

Definition at line 251 of file string_ptr.hpp.

◆ String

template<typename StringSet_ , typename LcpType_ >
typedef StringSet::String String

Definition at line 252 of file string_ptr.hpp.

◆ StringSet

template<typename StringSet_ , typename LcpType_ >
typedef StringSet_ StringSet

Definition at line 250 of file string_ptr.hpp.

Constructor & Destructor Documentation

◆ StringShadowLcpPtr()

template<typename StringSet_ , typename LcpType_ >
StringShadowLcpPtr ( const StringSet & original,
const StringSet & shadow,
LcpType * lcp,
bool flipped = false )
inline

constructor specifying all attributes

Definition at line 267 of file string_ptr.hpp.

Member Function Documentation

◆ active()

template<typename StringSet_ , typename LcpType_ >
const StringSet & active ( ) const
inline

return currently active array

Definition at line 272 of file string_ptr.hpp.

◆ copy_back()

template<typename StringSet_ , typename LcpType_ >
StringShadowLcpPtr copy_back ( ) const
inline

return subarray pointer to n strings in original array, might copy from shadow before returning.

Definition at line 302 of file string_ptr.hpp.

◆ fill_lcp()

template<typename StringSet_ , typename LcpType_ >
void fill_lcp ( const LcpType & v) const
inline

fill entire LCP array with v, excluding the first lcp[0] position!

Definition at line 333 of file string_ptr.hpp.

◆ flip()

template<typename StringSet_ , typename LcpType_ >
StringShadowLcpPtr flip ( size_t offset,
size_t sub_size ) const
inline

construct a StringShadowLcpPtr object specifying a sub-array with flipping to other array.

Definition at line 293 of file string_ptr.hpp.

◆ flipped()

template<typename StringSet_ , typename LcpType_ >
bool flipped ( ) const
inline

true if flipped to back array

Definition at line 278 of file string_ptr.hpp.

◆ get_lcp()

template<typename StringSet_ , typename LcpType_ >
LcpType get_lcp ( size_t i) const
inline

return LCP array value

Definition at line 321 of file string_ptr.hpp.

◆ lcp()

template<typename StringSet_ , typename LcpType_ >
LcpType * lcp ( ) const
inline

return LCP array pointer

Definition at line 316 of file string_ptr.hpp.

◆ set_lcp()

template<typename StringSet_ , typename LcpType_ >
void set_lcp ( size_t i,
const LcpType & v ) const
inline

set the i-th lcp to v and check its value

Definition at line 327 of file string_ptr.hpp.

◆ shadow()

template<typename StringSet_ , typename LcpType_ >
const StringSet & shadow ( ) const
inline

return current shadow array

Definition at line 275 of file string_ptr.hpp.

◆ size()

template<typename StringSet_ , typename LcpType_ >
size_t size ( ) const
inline

return valid length

Definition at line 281 of file string_ptr.hpp.

◆ sub()

template<typename StringSet_ , typename LcpType_ >
StringShadowLcpPtr sub ( size_t offset,
size_t sub_size ) const
inline

Advance (both) pointers by given offset, return sub-array without flip.

Definition at line 284 of file string_ptr.hpp.

Member Data Documentation

◆ active_

template<typename StringSet_ , typename LcpType_ >
StringSet active_
protected

strings (front) and temporary shadow (back) array

Definition at line 257 of file string_ptr.hpp.

◆ flipped_

template<typename StringSet_ , typename LcpType_ >
bool flipped_
protected

false if active_ is original, true if shadow_ is original

Definition at line 263 of file string_ptr.hpp.

◆ lcp_

template<typename StringSet_ , typename LcpType_ >
LcpType* lcp_
protected

lcp array

Definition at line 260 of file string_ptr.hpp.

◆ shadow_

template<typename StringSet_ , typename LcpType_ >
StringSet shadow_
protected

Definition at line 257 of file string_ptr.hpp.

◆ with_lcp

template<typename StringSet_ , typename LcpType_ >
const bool with_lcp
static

if we want to save the LCPs

Definition at line 313 of file string_ptr.hpp.


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