tlx
StringShadowPtr< StringSet_ > 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 StringSet::String String
 
typedef StringSet::Iterator Iterator
 

Public Member Functions

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

Static Public Attributes

static const bool with_lcp
 if we want to save the LCPs More...
 

Protected Attributes

StringSet active_
 strings (front) and temporary shadow (back) array More...
 
StringSet shadow_
 
bool flipped_
 false if active_ is original, true if shadow_ is original More...
 

Detailed Description

template<typename StringSet_>
class tlx::sort_strings_detail::StringShadowPtr< StringSet_ >

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

Definition at line 54 of file string_ptr.hpp.

Member Typedef Documentation

◆ Iterator

typedef StringSet::Iterator Iterator

Definition at line 190 of file string_ptr.hpp.

◆ String

typedef StringSet::String String

Definition at line 189 of file string_ptr.hpp.

◆ StringSet

typedef StringSet_ StringSet

Definition at line 188 of file string_ptr.hpp.

Constructor & Destructor Documentation

◆ StringShadowPtr()

StringShadowPtr ( const StringSet original,
const StringSet shadow,
bool  flipped = false 
)
inline

constructor specifying all attributes

Definition at line 201 of file string_ptr.hpp.

Member Function Documentation

◆ active()

const StringSet& active ( ) const
inline

return currently active array

Definition at line 206 of file string_ptr.hpp.

◆ copy_back()

StringShadowPtr copy_back ( ) const
inline

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

Definition at line 236 of file string_ptr.hpp.

◆ fill_lcp()

void fill_lcp ( const LcpType &  ) const
inline

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

Definition at line 255 of file string_ptr.hpp.

◆ flip()

StringShadowPtr flip ( size_t  offset,
size_t  sub_size 
) const
inline

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

Definition at line 227 of file string_ptr.hpp.

◆ flipped()

bool flipped ( ) const
inline

true if flipped to back array

Definition at line 212 of file string_ptr.hpp.

◆ set_lcp()

void set_lcp ( size_t  ,
const LcpType &   
) const
inline

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

Definition at line 251 of file string_ptr.hpp.

◆ shadow()

const StringSet& shadow ( ) const
inline

return current shadow array

Definition at line 209 of file string_ptr.hpp.

◆ size()

size_t size ( ) const
inline

return valid length

Definition at line 215 of file string_ptr.hpp.

◆ sub()

StringShadowPtr sub ( size_t  offset,
size_t  sub_size 
) const
inline

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

Definition at line 218 of file string_ptr.hpp.

Member Data Documentation

◆ active_

StringSet active_
protected

strings (front) and temporary shadow (back) array

Definition at line 194 of file string_ptr.hpp.

◆ flipped_

bool flipped_
protected

false if active_ is original, true if shadow_ is original

Definition at line 197 of file string_ptr.hpp.

◆ shadow_

StringSet shadow_
protected

Definition at line 194 of file string_ptr.hpp.

◆ with_lcp

const bool with_lcp
static

if we want to save the LCPs

Definition at line 247 of file string_ptr.hpp.


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