Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tlx Namespace Reference

Namespaces

 meta_detail
 
 multisequence_partition_detail
 
 multisequence_selection_detail
 
 multiway_merge_detail
 
 sort_strings_detail
 

Classes

class  AllocatorBase
 
class  btree
 Basic class implementing a B+ tree data structure in memory. More...
 
struct  btree_default_traits
 Generates default traits for a B+ tree used as a set or map. More...
 
class  btree_map
 Specialized B+ tree template class implementing STL's map container. More...
 
class  btree_multimap
 Specialized B+ tree template class implementing STL's multimap container. More...
 
class  btree_multiset
 Specialized B+ tree template class implementing STL's multiset container. More...
 
class  btree_set
 Specialized B+ tree template class implementing STL's set container. More...
 
class  CmdlineParser
 Command line parser which automatically fills variables and prints nice usage messages. More...
 
class  CountingPtr
 High-performance smart pointer used as a wrapping reference counting pointer. More...
 
class  CountingPtrDefaultDeleter
 default deleter for CountingPtr More...
 
class  CountingPtrNoOperationDeleter
 dummy deleter for CountingPtr More...
 
class  Delegate
 
class  Delegate< R(A...), Allocator >
 This is a faster replacement than std::function. More...
 
class  DieException
 Exception thrown by die_with_message() if. More...
 
class  FunctionChain
 A FunctionChain is a chain of functors that can be folded to a single functors. More...
 
class  FunctionStack
 A FunctionStack is a chain of functor that can be folded to a single functor (which is usually optimize by the compiler). More...
 
struct  index_sequence
 
struct  is_std_array
 test if is std::array<T, N> More...
 
struct  is_std_array< std::array< T, N > >
 
struct  is_std_pair
 test if is a std::pair<...> More...
 
struct  is_std_pair< std::pair< S, T > >
 
struct  is_std_tuple
 test if is a std::tuple<...> More...
 
struct  is_std_tuple< std::tuple< Ts...> >
 
struct  is_std_vector
 test if is std::vector<T> More...
 
struct  is_std_vector< std::vector< T > >
 
class  Log2
 
class  Log2< 0 >
 
class  Log2< 1 >
 
class  Log2Floor
 
class  Log2Floor< 0 >
 
class  Log2Floor< 1 >
 
class  Logger
 LOG and sLOG for development and debugging. More...
 
class  LoggerCollectOutput
 Class to hook logger output in the local thread. More...
 
class  LoggerFormatter
 template class for formatting. contains a print() method. More...
 
class  LoggerFormatter< AnyType >
 
class  LoggerFormatter< std::array< T, N > >
 
class  LoggerFormatter< std::deque< T, A > >
 
class  LoggerFormatter< std::map< K, V, C, A > >
 
class  LoggerFormatter< std::multimap< K, V, C, A > >
 
class  LoggerFormatter< std::multiset< T, C, A > >
 
class  LoggerFormatter< std::pair< A, B > >
 
class  LoggerFormatter< std::set< T, C, A > >
 
class  LoggerFormatter< std::tuple< Args...> >
 
class  LoggerFormatter< std::tuple<> >
 
class  LoggerFormatter< std::unordered_map< K, V, H, E, A > >
 
class  LoggerFormatter< std::unordered_multimap< K, V, H, E, A > >
 
class  LoggerFormatter< std::unordered_multiset< T, H, E, A > >
 
class  LoggerFormatter< std::unordered_set< T, H, E, A > >
 
class  LoggerFormatter< std::vector< T, A > >
 
class  LoggerOutputHook
 Abstract class to implement output hooks for logging. More...
 
class  LoggerPrefixHook
 Abstract class to implement prefix output hooks for logging. More...
 
class  LoggerTupleFormatter
 
class  LoggerVoidify
 
class  LoserTreeCopy
 Guarded loser tree/tournament tree, either copying the whole element into the tree structure, or looking up the element via the index. More...
 
class  LoserTreeCopy< true, ValueType, Comparator >
 Guarded loser tree/tournament tree, either copying the whole element into the tree structure, or looking up the element via the index. More...
 
class  LoserTreeCopyBase
 Guarded loser tree/tournament tree, either copying the whole element into the tree structure, or looking up the element via the index. More...
 
class  LoserTreeCopyUnguarded
 
class  LoserTreeCopyUnguarded< true, ValueType, Comparator >
 
class  LoserTreeCopyUnguardedBase
 Unguarded loser tree, copying the whole element into the tree structure. More...
 
class  LoserTreePointer
 Guarded loser tree, using pointers to the elements instead of copying them into the tree nodes. More...
 
class  LoserTreePointer< true, ValueType, Comparator >
 Guarded loser tree, using pointers to the elements instead of copying them into the tree nodes. More...
 
class  LoserTreePointerBase
 Guarded loser tree, using pointers to the elements instead of copying them into the tree nodes. More...
 
class  LoserTreePointerUnguarded
 
class  LoserTreePointerUnguarded< true, ValueType, Comparator >
 
class  LoserTreePointerUnguardedBase
 Unguarded loser tree, keeping only pointers to the elements in the tree structure. More...
 
class  LoserTreeSwitch
 
class  LruCacheMap
 This is an expected O(1) LRU cache which contains a map of (key -> value) elements. More...
 
class  LruCacheSet
 This is an expected O(1) LRU cache which contains a set of key-only elements. More...
 
struct  make_index_sequence
 
class  MD5
 MD-5 processor without external dependencies. More...
 
class  ReferenceCounter
 Provides reference counting abilities for use with CountingPtr. More...
 
class  RingBuffer
 A ring (circular) buffer of static (non-growing) size. More...
 
class  Semaphore
 A simple semaphore implementation using C++11 synchronization methods. More...
 
class  SHA1
 SHA-1 processor without external dependencies. More...
 
class  SHA256
 SHA-256 processor without external dependencies. More...
 
class  SHA512
 SHA-512 processor without external dependencies. More...
 
class  SimpleVector
 Simpler non-growing vector without initialization. More...
 
class  SpacingLogger
 A logging class which outputs spaces between elements pushed via operator<<. More...
 
class  StackAllocator
 
class  StackArena
 Storage area allocated on the stack and usable by a StackAllocator. More...
 
struct  StaticIndex
 
class  ThreadPool
 ThreadPool starts a fixed number p of std::threads which process Jobs that are enqueued into a concurrent job queue. More...
 

Typedefs

template<typename Type >
using counting_ptr = CountingPtr< Type >
 make alias due to similarity with std::shared_ptr<T> More...
 
template<typename Type >
using CountingPtrNoDelete = CountingPtr< Type, CountingPtrNoOperationDeleter >
 make alias for dummy deleter More...
 
template<typename T , typename Allocator = std::allocator<void>>
using delegate = Delegate< T, Allocator >
 make template alias due to similarity with std::function More...
 
using reference_counter = ReferenceCounter
 make alias due to CountingPtr's similarity with std::shared_ptr<T> More...
 
using semaphore = Semaphore
 alias for STL-like code style More...
 
template<typename T >
using simple_vector = SimpleVector< T >
 make template alias due to similarity with std::vector More...
 
typedef uint32_t u32
 
typedef uint64_t u64
 

Enumerations

enum  MultiwayMergeAlgorithm {
  MWMA_LOSER_TREE, MWMA_LOSER_TREE_COMBINED, MWMA_LOSER_TREE_SENTINEL, MWMA_BUBBLE,
  MWMA_ALGORITHM_LAST, MWMA_ALGORITHM_DEFAULT = MWMA_LOSER_TREE_COMBINED
}
 Different merging algorithms: bubblesort-alike, loser-tree variants, enum sentinel. More...
 
enum  MultiwayMergeSplittingAlgorithm { MWMSA_SAMPLING, MWMSA_EXACT, MWMSA_LAST, MWMSA_DEFAULT = MWMSA_EXACT }
 Different splitting strategies for sorting/merging: by sampling, exact. More...
 
enum  SimpleVectorMode { Normal, NoInitButDestroy, NoInitNoDestroy }
 enum class to select SimpleVector object initialization More...
 

Functions

template<typename T >
T abs_diff (const T &a, const T &b)
 absolute difference, which also works for unsigned types More...
 
template<typename Functor , typename Tuple >
auto apply_tuple (Functor &&f, Tuple &&t)
 Call the functor f with the contents of t as arguments. More...
 
static uint16_t bswap16 (const uint16_t &v)
 bswap16 - generic More...
 
static uint16_t bswap16_generic (const uint16_t &x)
 bswap16 - generic implementation More...
 
static uint32_t bswap32 (const uint32_t &v)
 bswap32 - generic More...
 
static uint32_t bswap32_generic (const uint32_t &x)
 bswap32 - generic implementation More...
 
static uint64_t bswap64 (const uint64_t &v)
 bswap64 - generic More...
 
static uint64_t bswap64_generic (const uint64_t &x)
 bswap64 - generic implementation More...
 
template<size_t Size, typename Functor >
void call_for_range (Functor &&f)
 Call a generic functor (like a generic lambda) for the integers [0,Size). More...
 
template<size_t Begin, size_t End, typename Functor >
void call_for_range (Functor &&f)
 Call a generic functor (like a generic lambda) for the integers [Begin,End). More...
 
template<typename Functor , typename... Args>
void call_foreach (Functor &&f, Args &&...args)
 
template<typename Functor , typename Tuple >
void call_foreach_tuple (Functor &&f, Tuple &&t)
 
template<typename Functor , typename Tuple >
void call_foreach_tuple_with_index (Functor &&f, Tuple &&t)
 
template<typename Functor , typename... Args>
void call_foreach_with_index (Functor &&f, Args &&...args)
 
template<typename Integral >
unsigned clz (Integral x)
 
template<>
unsigned clz< int > (int i)
 clz (count leading zeros) More...
 
template<>
unsigned clz< long > (long i)
 clz (count leading zeros) More...
 
template<>
unsigned clz< long long > (long long i)
 clz (count leading zeros) More...
 
template<>
unsigned clz< unsigned > (unsigned i)
 clz (count leading zeros) More...
 
template<>
unsigned clz< unsigned long > (unsigned long i)
 clz (count leading zeros) More...
 
template<>
unsigned clz< unsigned long long > (unsigned long long i)
 clz (count leading zeros) More...
 
template<typename Integral >
static unsigned clz_template (Integral x)
 clz (count leading zeros) - generic implementation More...
 
int compare_icase (const char *a, const char *b)
 returns +1/0/-1 like strcmp(a, b) but without regard for letter case More...
 
int compare_icase (const char *a, const std::string &b)
 returns +1/0/-1 like strcmp(a, b) but without regard for letter case More...
 
int compare_icase (const std::string &a, const char *b)
 returns +1/0/-1 like strcmp(a, b) but without regard for letter case More...
 
int compare_icase (const std::string &a, const std::string &b)
 returns +1/0/-1 like strcmp(a, b) but without regard for letter case More...
 
bool contains (const std::string &str, const std::string &pattern)
 Tests of string contains pattern. More...
 
bool contains (const std::string &str, const char *pattern)
 Tests of string contains pattern. More...
 
bool contains (const std::string &str, const char ch)
 Tests of string contains character. More...
 
bool contains_word (const std::string &str, const char *word)
 Search the given string for a whitespace-delimited word. More...
 
bool contains_word (const std::string &str, const std::string &word)
 Search the given string for a whitespace-delimited word. More...
 
template<typename TypeA , typename TypeB >
bool die_equal_compare (TypeA a, TypeB b)
 helper method to compare two values in die_unequal() More...
 
template<>
bool die_equal_compare (const char *a, const char *b)
 
template<>
bool die_equal_compare (float a, float b)
 
template<>
bool die_equal_compare (double a, double b)
 
template<typename TypeA , typename TypeB >
bool die_equal_eps_compare (TypeA x, TypeB y, double eps)
 helper method to compare two values in die_unequal_eps() More...
 
template<typename Type >
Type die_unequal_eps_abs (const Type &t)
 simple replacement for std::abs More...
 
void die_with_message (const std::string &msg)
 die with message - either throw an exception or die via std::terminate() More...
 
void die_with_message (const char *msg, const char *file, size_t line)
 die with message - either throw an exception or die via std::terminate() More...
 
void die_with_message (const std::string &msg, const char *file, size_t line)
 die with message - either throw an exception or die via std::terminate() More...
 
template<typename IntegralN , typename IntegralK >
static constexpr auto div_ceil (const IntegralN &n, const IntegralK &k) -> decltype(n+k)
 calculate n div k with rounding up More...
 
bool ends_with (const std::string &str, const std::string &match)
 Checks if the given match string is located at the end of this string. More...
 
bool ends_with (const std::string &str, const char *match)
 Checks if the given match string is located at the end of this string. More...
 
bool ends_with_icase (const std::string &str, const std::string &match)
 Checks if the given match string is located at the end of this string. More...
 
bool ends_with_icase (const std::string &str, const char *match)
 Checks if the given match string is located at the end of this string. More...
 
bool equal_icase (const char *a, const char *b)
 returns true if a == b without regard for letter case More...
 
bool equal_icase (const char *a, const std::string &b)
 returns true if a == b without regard for letter case More...
 
bool equal_icase (const std::string &a, const char *b)
 returns true if a == b without regard for letter case More...
 
bool equal_icase (const std::string &a, const std::string &b)
 returns true if a == b without regard for letter case More...
 
std::string & erase_all (std::string *str, char drop= ' ')
 Remove all occurrences of the given character in-place. More...
 
std::string & erase_all (std::string *str, const char *drop)
 Remove all occurrences of the given characters in-place. More...
 
std::string & erase_all (std::string *str, const std::string &drop)
 Remove all occurrences of the given characters in-place. More...
 
std::string erase_all (const std::string &str, char drop= ' ')
 Remove all occurrences of the given character, return copy of string. More...
 
std::string erase_all (const std::string &str, const char *drop)
 Remove all occurrences of the given characters, return copy of string. More...
 
std::string erase_all (const std::string &str, const std::string &drop)
 Remove all occurrences of the given characters, return copy of string. More...
 
std::string escape_html (const std::string &str)
 Escape characters for inclusion in HTML documents: replaces the characters <, >, & and " with HTML entities. More...
 
std::string escape_html (const char *str)
 Escape characters for inclusion in HTML documents: replaces the characters <, >, & and " with HTML entities. More...
 
std::string escape_uri (const std::string &str)
 Escape a string into a URI-encoding. More...
 
std::string escape_uri (const char *str)
 Escape a string into a URI-encoding. More...
 
template<typename InputIterator , typename OutputIterator , typename T , typename BinaryOperation = std::plus<T>>
OutputIterator exclusive_scan (InputIterator first, InputIterator last, OutputIterator result, T init, BinaryOperation binary_op=BinaryOperation())
 Computes an exclusive prefix sum operation using binary_op the range [first, last), using init as the initial value, and writes the results to the range beginning at result. More...
 
std::string & expand_environment_variables (std::string *s)
 Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables. More...
 
std::string expand_environment_variables (const std::string &s)
 Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables. More...
 
std::string expand_environment_variables (const char *s)
 Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables. More...
 
std::string extract_between (const std::string &str, const char *sep1, const char *sep2)
 Search the string for given start and end separators and extract all characters between the both, if they are found. More...
 
std::string extract_between (const std::string &str, const char *sep1, const std::string &sep2)
 Search the string for given start and end separators and extract all characters between the both, if they are found. More...
 
std::string extract_between (const std::string &str, const std::string &sep1, const char *sep2)
 Search the string for given start and end separators and extract all characters between the both, if they are found. More...
 
std::string extract_between (const std::string &str, const std::string &sep1, const std::string &sep2)
 Search the string for given start and end separators and extract all characters between the both, if they are found. More...
 
template<typename Separator1 , typename Separator2 >
static std::string extract_between_template (const std::string &str, const Separator1 &sep1, size_t sep1_size, const Separator2 &sep2)
 
static unsigned ffs (int i)
 find first set bit in integer, or zero if none are set. More...
 
static unsigned ffs (unsigned int i)
 find first set bit in integer, or zero if none are set. More...
 
static unsigned ffs (long i)
 find first set bit in integer, or zero if none are set. More...
 
static unsigned ffs (unsigned long i)
 find first set bit in integer, or zero if none are set. More...
 
static unsigned ffs (long long i)
 find first set bit in integer, or zero if none are set. More...
 
static unsigned ffs (unsigned long long i)
 find first set bit in integer, or zero if none are set. More...
 
template<typename Integral >
static unsigned ffs_template (Integral x)
 ffs (find first set bit) - generic implementation More...
 
template<typename Reduce , typename Initial , typename... Args>
auto fold_left (Reduce &&r, Initial &&init, Args &&...args)
 
template<typename Reduce , typename Initial , typename Tuple >
auto fold_left_tuple (Reduce &&r, Initial &&init, Tuple &&t)
 
template<typename Reduce , typename Initial , typename... Args>
auto fold_right (Reduce &&r, Initial &&init, Args &&...args)
 
template<typename Reduce , typename Initial , typename Tuple >
auto fold_right_tuple (Reduce &&r, Initial &&init, Tuple &&t)
 
std::string format_iec_units (uint64_t number, int precision)
 Format number as something like 1 TiB. More...
 
std::string format_si_units (uint64_t number, int precision)
 Format number as something like 1 TB. More...
 
size_t index_of (const std::vector< std::string > &list, const char *str)
 Attempts to find str in the list and return the index. More...
 
size_t index_of (const std::vector< std::string > &list, const std::string &str)
 Attempts to find str in the list and return the index. More...
 
size_t index_of_icase (const std::vector< std::string > &list, const char *str)
 Attempts to find str in the list and return the index using case-insensitive comparisons. More...
 
size_t index_of_icase (const std::vector< std::string > &list, const std::string &str)
 Attempts to find str in the list and return the index using case-insensitive comparisons. More...
 
unsigned integer_log2_ceil (int i)
 calculate the log2 ceiling of an integer type (by repeated bit shifts) More...
 
unsigned integer_log2_ceil (unsigned int i)
 calculate the log2 ceiling of an integer type (by repeated bit shifts) More...
 
unsigned integer_log2_ceil (long i)
 calculate the log2 ceiling of an integer type (by repeated bit shifts) More...
 
unsigned integer_log2_ceil (unsigned long i)
 calculate the log2 ceiling of an integer type (by repeated bit shifts) More...
 
unsigned integer_log2_ceil (long long i)
 calculate the log2 ceiling of an integer type (by repeated bit shifts) More...
 
unsigned integer_log2_ceil (unsigned long long i)
 calculate the log2 ceiling of an integer type (by repeated bit shifts) More...
 
unsigned integer_log2_floor (int i)
 calculate the log2 floor of an integer type (by repeated bit shifts) More...
 
unsigned integer_log2_floor (unsigned int i)
 calculate the log2 floor of an integer type (by repeated bit shifts) More...
 
unsigned integer_log2_floor (long i)
 calculate the log2 floor of an integer type (by repeated bit shifts) More...
 
unsigned integer_log2_floor (unsigned long i)
 calculate the log2 floor of an integer type (by repeated bit shifts) More...
 
unsigned integer_log2_floor (long long i)
 calculate the log2 floor of an integer type (by repeated bit shifts) More...
 
unsigned integer_log2_floor (unsigned long long i)
 calculate the log2 floor of an integer type (by repeated bit shifts) More...
 
template<typename IntegerType >
static unsigned integer_log2_floor_template (IntegerType i)
 calculate the log2 floor of an integer type (by repeated bit shifts) More...
 
bool is_power_of_two (int i)
 does what it says: true if i is a power of two More...
 
bool is_power_of_two (unsigned int i)
 does what it says: true if i is a power of two More...
 
bool is_power_of_two (long i)
 does what it says: true if i is a power of two More...
 
bool is_power_of_two (unsigned long i)
 does what it says: true if i is a power of two More...
 
bool is_power_of_two (long long i)
 does what it says: true if i is a power of two More...
 
bool is_power_of_two (unsigned long long i)
 does what it says: true if i is a power of two More...
 
template<typename Integral >
static bool is_power_of_two_template (Integral i)
 
template<typename ForwardIterator , typename Comparator >
bool is_sorted_cmp (ForwardIterator first, ForwardIterator last, Comparator cmp)
 Checks if a range is sorted using a three-way Comparator (with memcmp() semantics). More...
 
template<typename ForwardIterator , typename Comparator >
ForwardIterator is_sorted_until_cmp (ForwardIterator first, ForwardIterator last, Comparator cmp)
 Checks if a range is sorted using a three-way Comparator (with memcmp() semantics). More...
 
bool is_space (char ch)
 
static bool is_white (char c)
 
bool less_icase (const char *a, const char *b)
 returns true if a < b without regard for letter case More...
 
bool less_icase (const char *a, const std::string &b)
 returns true if a < b without regard for letter case More...
 
bool less_icase (const std::string &a, const char *b)
 returns true if a < b without regard for letter case More...
 
bool less_icase (const std::string &a, const std::string &b)
 returns true if a < b without regard for letter case More...
 
template<typename Type , typename... Args>
CountingPtr< Type > make_counting (Args &&...args)
 method analogous to std::make_shared and std::make_unique. More...
 
template<class C , typename R , typename... A>
Delegate< R(A...)> make_delegate (C *const object_ptr, R(C::*const method_ptr)(A...)) noexcept
 constructor for wrapping a class::method with object pointer. More...
 
template<class C , typename R , typename... A>
Delegate< R(A...)> make_delegate (C &object_ptr, R(C::*const method_ptr)(A...)) noexcept
 constructor for wrapping a class::method with object reference. More...
 
template<class C , typename R , typename... A>
Delegate< R(A...)> make_delegate (C const &object_ptr, R(C::*const method_ptr)(A...) const) noexcept
 constructor for wrapping a const class::method with object reference. More...
 
template<typename Functor >
static auto make_function_chain (const Functor &functor)
 Functor chain maker. Can also be called with a lambda function. More...
 
static auto make_function_chain ()
 Construct and empty function chain. More...
 
template<typename Input , typename Functor >
static auto make_function_stack (const Functor &functor)
 Function-style construction of a FunctionStack. More...
 
std::string MD5_hex (const void *data, uint32_t size)
 process data and return 16 byte (128 bit) digest hex encoded More...
 
std::string MD5_hex (const std::string &str)
 process data and return 16 byte (128 bit) digest hex encoded More...
 
std::string MD5_hex_uc (const void *data, uint32_t size)
 process data and return 16 byte (128 bit) digest upper-case hex encoded More...
 
std::string MD5_hex_uc (const std::string &str)
 process data and return 16 byte (128 bit) digest upper-case hex encoded More...
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename OutputIterator , typename DiffType , typename Comparator >
OutputIterator merge_advance (RandomAccessIterator1 &begin1, RandomAccessIterator1 end1, RandomAccessIterator2 &begin2, RandomAccessIterator2 end2, OutputIterator target, DiffType max_size, Comparator comp)
 Merge routine being able to merge only the max_size smallest elements. More...
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename OutputIterator , typename DiffType , typename Comparator >
OutputIterator merge_advance_movc (RandomAccessIterator1 &begin1, RandomAccessIterator1 end1, RandomAccessIterator2 &begin2, RandomAccessIterator2 end2, OutputIterator target, DiffType max_size, Comparator comp)
 Merge routine being able to merge only the max_size smallest elements. More...
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename OutputIterator , typename DiffType , typename Comparator >
OutputIterator merge_advance_usual (RandomAccessIterator1 &begin1, RandomAccessIterator1 end1, RandomAccessIterator2 &begin2, RandomAccessIterator2 end2, OutputIterator target, DiffType max_size, Comparator comp)
 Merge routine being able to merge only the max_size smallest elements. More...
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename Comparator , typename Combine = std::plus< typename std::iterator_traits<InputIterator1>::value_type>>
OutputIterator merge_combine (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Comparator cmp=Comparator(), Combine combine=Combine())
 Merge two sorted ranges and add all items comparing equal. More...
 
template<typename RanSeqs , typename RankType , typename RankIterator , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RanSeqs> ::value_type::first_type>::value_type>>
void multisequence_partition (const RanSeqs &begin_seqs, const RanSeqs &end_seqs, const RankType &rank, RankIterator begin_offsets, Comparator comp=Comparator())
 Splits several sorted sequences at a certain global rank, resulting in a splitting point for each sequence. More...
 
template<typename ValueType , typename RanSeqs , typename RankType , typename Comparator = std::less<ValueType>>
ValueType multisequence_selection (const RanSeqs &begin_seqs, const RanSeqs &end_seqs, const RankType &rank, RankType &offset, Comparator comp=Comparator())
 Selects the element at a certain global rank from several sorted sequences. More...
 
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>>
RandomAccessIterator3 multiway_merge (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT)
 Sequential multi-way merge. More...
 
template<bool Stable, bool Sentinels, typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>>
RandomAccessIterator3 multiway_merge_base (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT)
 Sequential multi-way merging switch. More...
 
template<bool Stable, typename RandomAccessIteratorIterator , typename Comparator >
void multiway_merge_exact_splitting (const RandomAccessIteratorIterator &seqs_begin, const RandomAccessIteratorIterator &seqs_end, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type total_size, Comparator comp, std::vector< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type > *chunks, const size_t num_threads)
 Splitting method for parallel multi-way merge routine: use multisequence selection for exact splitting. More...
 
template<bool Stable, typename RandomAccessIteratorIterator , typename Comparator >
void multiway_merge_sampling_splitting (const RandomAccessIteratorIterator &seqs_begin, const RandomAccessIteratorIterator &seqs_end, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type total_size, Comparator comp, std::vector< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type > *chunks, const size_t num_threads, const size_t merge_oversampling)
 Splitting method for parallel multi-way merge routine: use sampling and binary search for in-exact splitting. More...
 
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>>
RandomAccessIterator3 multiway_merge_sentinels (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT)
 Sequential multi-way merge with sentinels in sequences. More...
 
template<typename A , typename D >
std::ostream & operator<< (std::ostream &os, const CountingPtr< A, D > &c)
 print pointer More...
 
std::string pad (const std::string &s, size_t len, char pad_char= ' ')
 Truncate or pad string to exactly len characters. More...
 
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>>
RandomAccessIterator3 parallel_multiway_merge (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency())
 Parallel multi-way merge routine. More...
 
template<bool Stable, typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>>
RandomAccessIterator3 parallel_multiway_merge_base (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency())
 Parallel multi-way merge routine. More...
 
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>>
RandomAccessIterator3 parallel_multiway_merge_sentinels (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency())
 Parallel multi-way merge routine with sentinels. More...
 
bool parse_si_iec_units (const char *str, uint64_t *out_size, char default_unit=0)
 Parse a string like "343KB" or "44 GiB" into the corresponding size in bytes. More...
 
bool parse_si_iec_units (const std::string &str, uint64_t *out_size, char default_unit=0)
 Parse a string like "343KB" or "44 GiB" into the corresponding size in bytes. More...
 
template<typename RandomAccessIt , typename RandomBits >
void random_bipartition_shuffle (RandomAccessIt begin, RandomAccessIt end, size_t size_left_partition, RandomBits &urng)
 Similar to std::shuffle, but only generates a random bi-partition. More...
 
static uint32_t rol32 (const uint32_t &x, int i)
 rol32 - generic More...
 
static uint32_t rol32_generic (const uint32_t &x, int i)
 rol32 - generic implementation More...
 
static uint64_t rol64 (const uint64_t &x, int i)
 rol64 - generic More...
 
static uint64_t rol64_generic (const uint64_t &x, int i)
 rol64 - generic implementation More...
 
static uint32_t ror32 (const uint32_t &x, int i)
 ror32 - generic More...
 
static uint32_t ror32_generic (const uint32_t &x, int i)
 ror32 - generic implementation More...
 
static uint64_t ror64 (const uint64_t &x, int i)
 ror64 - generic More...
 
static uint64_t ror64_generic (const uint64_t &x, int i)
 ror64 - generic implementation More...
 
int round_down_to_power_of_two (int i)
 does what it says: round down to next power of two More...
 
unsigned int round_down_to_power_of_two (unsigned int i)
 does what it says: round down to next power of two More...
 
long round_down_to_power_of_two (long i)
 does what it says: round down to next power of two More...
 
unsigned long round_down_to_power_of_two (unsigned long i)
 does what it says: round down to next power of two More...
 
long long round_down_to_power_of_two (long long i)
 does what it says: round down to next power of two More...
 
unsigned long long round_down_to_power_of_two (unsigned long long i)
 does what it says: round down to next power of two More...
 
int round_up_to_power_of_two (int i)
 does what it says: round up to next power of two More...
 
unsigned int round_up_to_power_of_two (unsigned int i)
 does what it says: round up to next power of two More...
 
long round_up_to_power_of_two (long i)
 does what it says: round up to next power of two More...
 
unsigned long round_up_to_power_of_two (unsigned long i)
 does what it says: round up to next power of two More...
 
long long round_up_to_power_of_two (long long i)
 does what it says: round up to next power of two More...
 
unsigned long long round_up_to_power_of_two (unsigned long long i)
 does what it says: round up to next power of two More...
 
template<typename Integral >
static Integral round_up_to_power_of_two_template (Integral n)
 
bool set_die_with_exception (bool b)
 
LoggerOutputHookset_logger_output_hook (LoggerOutputHook *hook)
 
LoggerPrefixHookset_logger_prefix_hook (LoggerPrefixHook *hook)
 
int setenv (const char *name, const char *value, int overwrite)
 setenv - change or add an environment variable Windows porting madness because setenv() is apparently dangerous More...
 
std::string SHA1_hex (const void *data, uint32_t size)
 process data and return 20 byte (160 bit) digest hex encoded More...
 
std::string SHA1_hex (const std::string &str)
 process data and return 20 byte (160 bit) digest hex encoded More...
 
std::string SHA1_hex_uc (const void *data, uint32_t size)
 process data and return 20 byte (160 bit) digest upper-case hex encoded More...
 
std::string SHA1_hex_uc (const std::string &str)
 process data and return 20 byte (160 bit) digest upper-case hex encoded More...
 
std::string SHA256_hex (const void *data, uint32_t size)
 process data and return 32 byte (256 bit) digest hex encoded More...
 
std::string SHA256_hex (const std::string &str)
 process data and return 32 byte (256 bit) digest hex encoded More...
 
std::string SHA256_hex_uc (const void *data, uint32_t size)
 process data and return 32 byte (256 bit) digest upper-case hex encoded More...
 
std::string SHA256_hex_uc (const std::string &str)
 process data and return 32 byte (256 bit) digest upper-case hex encoded More...
 
std::string SHA512_hex (const void *data, uint32_t size)
 process data and return 64 byte (512 bit) digest hex encoded More...
 
std::string SHA512_hex (const std::string &str)
 process data and return 64 byte (512 bit) digest hex encoded More...
 
std::string SHA512_hex_uc (const void *data, uint32_t size)
 process data and return 64 byte (512 bit) digest upper-case hex encoded More...
 
std::string SHA512_hex_uc (const std::string &str)
 process data and return 64 byte (512 bit) digest upper-case hex encoded More...
 
static uint64_t siphash (const uint8_t key[16], const uint8_t *msg, size_t size)
 
static uint64_t siphash (const uint8_t *msg, size_t size)
 
template<typename Type >
static uint64_t siphash (const Type &value)
 
static uint64_t siphash_plain (const uint8_t key[16], const uint8_t *m, size_t len)
 
void sort_strings (std::vector< unsigned char * > &strings, size_t memory)
 
static std::vector< std::string > & split (std::vector< std::string > *into, const char *sep, size_t sep_size, const std::string &str, std::string::size_type limit)
 
std::vector< std::string > split_words (const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string by whitespaces into distinct words. More...
 
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>>
RandomAccessIterator3 stable_multiway_merge (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT)
 Stable sequential multi-way merge. More...
 
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>>
RandomAccessIterator3 stable_multiway_merge_sentinels (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT)
 Stable sequential multi-way merge with sentinels in sequences. More...
 
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>>
RandomAccessIterator3 stable_parallel_multiway_merge (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency())
 Stable parallel multi-way merge routine. More...
 
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>>
RandomAccessIterator3 stable_parallel_multiway_merge_sentinels (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency())
 Stable parallel multi-way merge routine with sentinels. More...
 
bool starts_with (const std::string &str, const std::string &match)
 Checks if the given match string is located at the start of this string. More...
 
bool starts_with (const std::string &str, const char *match)
 Checks if the given match string is located at the start of this string. More...
 
bool starts_with_icase (const std::string &str, const std::string &match)
 Checks if the given match string is located at the start of this string. More...
 
bool starts_with_icase (const std::string &str, const char *match)
 Checks if the given match string is located at the start of this string. More...
 
template<typename A , typename D >
void swap (CountingPtr< A, D > &a1, CountingPtr< A, D > &a2) noexcept
 
char to_lower (char ch)
 Transform the given character to lower case without any localization. More...
 
std::string & to_lower (std::string *str)
 Transforms the given string to lowercase and returns a reference to it. More...
 
std::string to_lower (const std::string &str)
 Returns a copy of the given string converted to lowercase. More...
 
char to_upper (char ch)
 Transform the given character to upper case without any localization. More...
 
std::string & to_upper (std::string *str)
 Transforms the given string to uppercase and returns a reference to it. More...
 
std::string to_upper (const std::string &str)
 Returns a copy of the given string converted to uppercase. More...
 
std::string union_words (const std::string &wordsA, const std::string &wordsB)
 Return union of two keyword sets. More...
 
template<typename... Types>
void unused (Types &&...)
 
template<typename... Types>
void vexpand (Types &&...)
 
template<size_t Size, typename Functor >
auto vmap_for_range (Functor &&f)
 Vmap a generic functor (like a generic lambda) for the integers [0,Size). More...
 
template<size_t Begin, size_t End, typename Functor >
auto vmap_for_range (Functor &&f)
 Vmap a generic functor (like a generic lambda) for the integers [Begin,End). More...
 
template<typename Functor , typename... Args>
auto vmap_foreach (Functor &&f, Args &&...args)
 
template<typename Functor , typename Tuple >
auto vmap_foreach_tuple (Functor &&f, Tuple &&t)
 
template<typename Functor , typename Tuple >
auto vmap_foreach_tuple_with_index (Functor &&f, Tuple &&t)
 
template<typename Functor , typename... Args>
auto vmap_foreach_with_index (Functor &&f, Args &&...args)
 
std::string word_wrap (const std::string &str, unsigned int wrap=80)
 Try to wrap a string to 80 columns without split words. More...
 
Stack Backtrace Printing
void print_raw_backtrace (FILE *out, unsigned int max_frames, const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(3
 Print a plain hex stack backtrace of the called function to FILE* out, prefixed with the given printf formatted output. More...
 
void print_raw_backtrace (FILE *out=stderr, unsigned int max_frames=63)
 Print a plain hex stack backtrace of the called function to FILE* out. More...
 
void print_cxx_backtrace (FILE *out=stderr, unsigned int max_frames=63)
 Print a demangled stack backtrace of the caller function to FILE* out. More...
 
void enable_segv_backtrace ()
 Install SIGSEGV signal handler and output backtrace on segmentation fault. More...
 
String Sorting Algorithms
void sort_strings (char **strings, size_t size, size_t memory=0)
 Sort a set of strings represented by C-style char* in place. More...
 
void sort_strings (unsigned char **strings, size_t size, size_t memory=0)
 Sort a set of strings represented by C-style uint8_t* in place. More...
 
void sort_strings (const char **strings, size_t size, size_t memory=0)
 Sort a set of strings represented by C-style char* in place. More...
 
void sort_strings (const unsigned char **strings, size_t size, size_t memory=0)
 Sort a set of strings represented by C-style uint8_t* in place. More...
 
void sort_strings (std::vector< char * > &strings, size_t memory=0)
 Sort a set of strings represented by C-style char* in place. More...
 
void sort_strings (std::vector< unsigned char > &strings, size_t memory=0)
 Sort a set of strings represented by C-style uint8_t* in place. More...
 
void sort_strings (std::vector< const char * > &strings, size_t memory=0)
 Sort a set of strings represented by C-style char* in place. More...
 
void sort_strings (std::vector< const unsigned char * > &strings, size_t memory=0)
 Sort a set of strings represented by C-style uint8_t* in place. More...
 
void sort_strings (std::string *strings, size_t size, size_t memory=0)
 Sort a set of std::strings in place. More...
 
void sort_strings (std::vector< std::string > &strings, size_t memory=0)
 Sort a vector of std::strings in place. More...
 
Base64 Encoding and Decoding
std::string base64_encode (const void *data, size_t size, size_t line_break=0)
 Encode the given binary data into base64 representation as described in RFC 2045 or RFC 3548. More...
 
std::string base64_encode (const std::string &str, size_t line_break=0)
 Encode the given binary string into base64 representation as described in RFC 2045 or RFC 3548. More...
 
std::string base64_decode (const void *data, size_t size, bool strict=true)
 Decode a string in base64 representation as described in RFC 2045 or RFC 3548 and return the original data. More...
 
std::string base64_decode (const std::string &str, bool strict=true)
 Decode a string in base64 representation as described in RFC 2045 or RFC 3548 and return the original data. More...
 
Hexdump Methods
std::string hexdump (const void *const data, size_t size)
 Dump a (binary) string as a sequence of uppercase hexadecimal pairs. More...
 
std::string hexdump (const std::string &str)
 Dump a (binary) string as a sequence of uppercase hexadecimal pairs. More...
 
std::string hexdump (const std::vector< char > &data)
 Dump a char vector as a sequence of uppercase hexadecimal pairs. More...
 
std::string hexdump (const std::vector< uint8_t > &data)
 Dump a uint8_t vector as a sequence of uppercase hexadecimal pairs. More...
 
std::string hexdump_sourcecode (const std::string &str, const std::string &var_name="name")
 Dump a (binary) string into a C source code snippet. More...
 
std::string hexdump_lc (const void *const data, size_t size)
 Dump a (binary) string as a sequence of lowercase hexadecimal pairs. More...
 
std::string hexdump_lc (const std::string &str)
 Dump a (binary) string as a sequence of lowercase hexadecimal pairs. More...
 
std::string hexdump_lc (const std::vector< char > &data)
 Dump a char vector as a sequence of lowercase hexadecimal pairs. More...
 
std::string hexdump_lc (const std::vector< uint8_t > &data)
 Dump a uint8_t vector as a sequence of lowercase hexadecimal pairs. More...
 
std::string parse_hexdump (const std::string &str)
 Read a string as a sequence of hexadecimal pairs. More...
 
template<typename Type >
std::string hexdump_type (const Type &t)
 Dump a (binary) item as a sequence of uppercase hexadecimal pairs. More...
 
template<typename Type >
std::string hexdump_lc_type (const Type &t)
 Dump a (binary) item as a sequence of lowercase hexadecimal pairs. More...
 
Split and Join
std::string join (char glue, const std::vector< std::string > &parts)
 Join a vector of strings by some glue character between each pair from the sequence. More...
 
std::string join (const char *glue, const std::vector< std::string > &parts)
 Join a vector of strings by some glue string between each pair from the sequence. More...
 
std::string join (const std::string &glue, const std::vector< std::string > &parts)
 Join a vector of strings by some glue string between each pair from the sequence. More...
 
template<typename Glue , typename Iterator >
static std::string join (Glue glue, Iterator first, Iterator last)
 Join a sequence of strings by some glue string between each pair from the sequence. More...
 
template<typename Container >
static std::string join (char glue, const Container &parts)
 Join a Container of strings by some glue character between each pair from the sequence. More...
 
template<typename Container >
static std::string join (const char *glue, const Container &parts)
 Join a Container of strings by some glue string between each pair from the sequence. More...
 
template<typename Container >
static std::string join (const std::string &glue, const Container &parts)
 Join a Container of strings by some glue string between each pair from the sequence. More...
 
std::string join_quoted (const std::vector< std::string > &str, char sep, char quote, char escape)
 Join a vector of strings using a separator character. More...
 
std::string join_quoted (const std::vector< std::string > &str)
 Join a vector of strings using spaces as separator character. More...
 
std::vector< std::string > split (char sep, const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string at each separator character into distinct substrings. More...
 
std::vector< std::string > split (const char *sep, const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > split (const std::string &sep, const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > split (char sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit)
 Split the given string at each separator character into distinct substrings. More...
 
std::vector< std::string > split (const char *sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > split (const std::string &sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > & split (std::vector< std::string > *into, char sep, const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string at each separator character into distinct substrings. More...
 
std::vector< std::string > & split (std::vector< std::string > *into, const char *sep, const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > & split (std::vector< std::string > *into, const std::string &sep, const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > & split (std::vector< std::string > *into, char sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit)
 Split the given string at each separator character into distinct substrings. More...
 
std::vector< std::string > & split (std::vector< std::string > *into, const char *sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > & split (std::vector< std::string > *into, const std::string &sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit)
 Split the given string at each separator string into distinct substrings. More...
 
std::vector< std::string > split_quoted (const std::string &str, char sep, char quote, char escape)
 Split the given string at each separator character into distinct substrings. More...
 
std::vector< std::string > split_quoted (const std::string &str)
 Split the given string at each space into distinct substrings. More...
 
Search and Replace
std::string & replace_first (std::string *str, const std::string &needle, const std::string &instead)
 Replace only the first occurrence of needle in str. More...
 
std::string & replace_first (std::string *str, const std::string &needle, const char *instead)
 Replace only the first occurrence of needle in str. More...
 
std::string & replace_first (std::string *str, const char *needle, const std::string &instead)
 Replace only the first occurrence of needle in str. More...
 
std::string & replace_first (std::string *str, const char *needle, const char *instead)
 Replace only the first occurrence of needle in str. More...
 
std::string & replace_first (std::string *str, char needle, char instead)
 Replace only the first occurrence of needle in str. More...
 
std::string replace_first (const std::string &str, const std::string &needle, const std::string &instead)
 Replace only the first occurrence of needle in str. More...
 
std::string replace_first (const std::string &str, const std::string &needle, const char *instead)
 Replace only the first occurrence of needle in str. More...
 
std::string replace_first (const std::string &str, const char *needle, const std::string &instead)
 Replace only the first occurrence of needle in str. More...
 
std::string replace_first (const std::string &str, const char *needle, const char *instead)
 Replace only the first occurrence of needle in str. More...
 
std::string replace_first (const std::string &str, char needle, char instead)
 Replace only the first occurrence of needle in str. More...
 
std::string & replace_all (std::string *str, const std::string &needle, const std::string &instead)
 Replace all occurrences of needle in str. More...
 
std::string & replace_all (std::string *str, const std::string &needle, const char *instead)
 Replace all occurrences of needle in str. More...
 
std::string & replace_all (std::string *str, const char *needle, const std::string &instead)
 Replace all occurrences of needle in str. More...
 
std::string & replace_all (std::string *str, const char *needle, const char *instead)
 Replace all occurrences of needle in str. More...
 
std::string & replace_all (std::string *str, char needle, char instead)
 Replace all occurrences of needle in str. More...
 
std::string replace_all (const std::string &str, const std::string &needle, const std::string &instead)
 Replace all occurrences of needle in str. More...
 
std::string replace_all (const std::string &str, const std::string &needle, const char *instead)
 Replace all occurrences of needle in str. More...
 
std::string replace_all (const std::string &str, const char *needle, const std::string &instead)
 Replace all occurrences of needle in str. More...
 
std::string replace_all (const std::string &str, const char *needle, const char *instead)
 Replace all occurrences of needle in str. More...
 
std::string replace_all (const std::string &str, char needle, char instead)
 Replace all occurrences of needle in str. More...
 
Trim
std::string & trim (std::string *str)
 Trims the given string in-place on the left and right. More...
 
std::string & trim (std::string *str, const char *drop)
 Trims the given string in-place on the left and right. More...
 
std::string & trim (std::string *str, const std::string &drop)
 Trims the given string in-place on the left and right. More...
 
std::string trim (const std::string &str)
 Trims the given string in-place on the left and right. More...
 
std::string trim (const std::string &str, const char *drop)
 Trims the given string in-place on the left and right. More...
 
std::string trim (const std::string &str, const std::string &drop)
 Trims the given string in-place on the left and right. More...
 
std::string & trim_right (std::string *str)
 Trims the given string in-place only on the right. More...
 
std::string & trim_right (std::string *str, const char *drop)
 Trims the given string in-place only on the right. More...
 
std::string & trim_right (std::string *str, const std::string &drop)
 Trims the given string in-place only on the right. More...
 
std::string trim_right (const std::string &str)
 Trims the given string only on the right. More...
 
std::string trim_right (const std::string &str, const char *drop)
 Trims the given string only on the right. More...
 
std::string trim_right (const std::string &str, const std::string &drop)
 Trims the given string only on the right. More...
 
std::string & trim_left (std::string *str)
 Trims the given string in-place only on the left. More...
 
std::string & trim_left (std::string *str, const char *drop)
 Trims the given string in-place only on the left. More...
 
std::string & trim_left (std::string *str, const std::string &drop)
 Trims the given string in-place only on the left. More...
 
std::string trim_left (const std::string &str)
 Trims the given string only on the left. More...
 
std::string trim_left (const std::string &str, const char *drop)
 Trims the given string only on the left. More...
 
std::string trim_left (const std::string &str, const std::string &drop)
 Trims the given string only on the left. More...
 

Variables

bool parallel_multiway_merge_force_parallel = false
 setting to force parallel_multiway_merge() calls to run with parallel code More...
 
bool parallel_multiway_merge_force_sequential = false
 setting to force all parallel_multiway_merge() calls to run sequentially More...
 
size_t parallel_multiway_merge_minimal_k = 2
 minimal number of sequences for switching to parallel merging More...
 
size_t parallel_multiway_merge_minimal_n = 1000
 minimal number of items for switching to parallel merging More...
 
size_t parallel_multiway_merge_oversampling = 10
 default oversampling factor for parallel_multiway_merge More...
 
static DefaultLoggerOutput s_default_logger
 default logger singleton More...
 
static std::atomic< bool > s_die_with_exception
 
static std::atomic
< LoggerOutputHook * > 
s_logger_output_hook
 global logger output hook More...
 
static std::atomic
< LoggerPrefixHook * > 
s_logger_prefix_hook
 global logger prefix hook More...
 

Typedef Documentation

using counting_ptr = CountingPtr<Type>

make alias due to similarity with std::shared_ptr<T>

Definition at line 248 of file counting_ptr.hpp.

make alias for dummy deleter

Definition at line 252 of file counting_ptr.hpp.

using delegate = Delegate<T, Allocator>

make template alias due to similarity with std::function

Definition at line 426 of file delegate.hpp.

make alias due to CountingPtr's similarity with std::shared_ptr<T>

Definition at line 332 of file counting_ptr.hpp.

alias for STL-like code style

Definition at line 83 of file semaphore.hpp.

typedef uint32_t u32

Definition at line 32 of file md5.cpp.

typedef uint64_t u64

Definition at line 33 of file md5.cpp.

Function Documentation

bool tlx::die_equal_compare ( TypeA  a,
TypeB  b 
)
inline

helper method to compare two values in die_unequal()

Definition at line 87 of file die.hpp.

bool tlx::die_equal_compare ( const char *  a,
const char *  b 
)
inline

Definition at line 92 of file die.hpp.

bool tlx::die_equal_compare ( float  a,
float  b 
)
inline

Definition at line 98 of file die.hpp.

bool tlx::die_equal_compare ( double  a,
double  b 
)
inline

Definition at line 104 of file die.hpp.

bool tlx::die_equal_eps_compare ( TypeA  x,
TypeB  y,
double  eps 
)
inline

helper method to compare two values in die_unequal_eps()

Definition at line 139 of file die.hpp.

References die_unequal_eps_abs().

Type tlx::die_unequal_eps_abs ( const Type &  t)
inline

simple replacement for std::abs

Definition at line 133 of file die.hpp.

Referenced by die_equal_eps_compare().

void die_with_message ( const std::string &  msg)

die with message - either throw an exception or die via std::terminate()

Definition at line 29 of file die.cpp.

References s_die_with_exception.

Referenced by die_with_message().

void die_with_message ( const char *  msg,
const char *  file,
size_t  line 
)

die with message - either throw an exception or die via std::terminate()

Definition at line 39 of file die.cpp.

References die_with_message().

void die_with_message ( const std::string &  msg,
const char *  file,
size_t  line 
)

die with message - either throw an exception or die via std::terminate()

Definition at line 45 of file die.cpp.

References die_with_message().

void enable_segv_backtrace ( )

Install SIGSEGV signal handler and output backtrace on segmentation fault.

Compile with -rdynamic for more useful output.

Definition at line 178 of file backtrace.cpp.

static std::string tlx::extract_between_template ( const std::string &  str,
const Separator1 &  sep1,
size_t  sep1_size,
const Separator2 &  sep2 
)
inlinestatic

Definition at line 19 of file extract_between.cpp.

Referenced by extract_between().

static bool tlx::is_power_of_two_template ( Integral  i)
inlinestatic

Definition at line 16 of file is_power_of_two.cpp.

Referenced by is_power_of_two().

bool tlx::is_space ( char  ch)

Definition at line 17 of file word_wrap.cpp.

Referenced by word_wrap().

static bool tlx::is_white ( char  c)
inlinestatic

Definition at line 15 of file contains_word.cpp.

Referenced by contains_word().

CountingPtr<Type> tlx::make_counting ( Args &&...  args)

method analogous to std::make_shared and std::make_unique.

Definition at line 256 of file counting_ptr.hpp.

Referenced by thrill::data::ConstructDynBlockSource().

Delegate< R(A...)> make_delegate ( C *const  object_ptr,
R(C::*)(A...)  method_ptr 
)
inlinenoexcept

constructor for wrapping a class::method with object pointer.

constructor for wrapping a const class::method with object pointer.

Definition at line 431 of file delegate.hpp.

Delegate<R(A...)> tlx::make_delegate ( C &  object_ptr,
R(C::*)(A...)  method_ptr 
)
inlinenoexcept

constructor for wrapping a class::method with object reference.

Definition at line 447 of file delegate.hpp.

Delegate<R(A...)> tlx::make_delegate ( C const &  object_ptr,
R(C::*)(A...) const  method_ptr 
)
inlinenoexcept

constructor for wrapping a const class::method with object reference.

Definition at line 455 of file delegate.hpp.

std::ostream& tlx::operator<< ( std::ostream &  os,
const CountingPtr< A, D > &  c 
)

print pointer

Definition at line 269 of file counting_ptr.hpp.

void void print_cxx_backtrace ( FILE *  out = stderr,
unsigned int  max_frames = 63 
)

Print a demangled stack backtrace of the caller function to FILE* out.

Warning
The binary has to be compiled with -rdynamic for meaningful output.

Definition at line 73 of file backtrace.cpp.

References free(), and unused().

void print_raw_backtrace ( FILE *  out,
unsigned int  max_frames,
const char *  fmt,
  ... 
)

Print a plain hex stack backtrace of the called function to FILE* out, prefixed with the given printf formatted output.

Definition at line 30 of file backtrace.cpp.

References unused().

Referenced by thrill::mem::bypass_malloc(), and print_raw_backtrace().

void print_raw_backtrace ( FILE *  out,
unsigned int  max_frames 
)

Print a plain hex stack backtrace of the called function to FILE* out.

Definition at line 69 of file backtrace.cpp.

References print_raw_backtrace().

static Integral tlx::round_up_to_power_of_two_template ( Integral  n)
inlinestatic

Definition at line 18 of file round_to_power_of_two.cpp.

Referenced by round_up_to_power_of_two().

bool set_die_with_exception ( bool  b)

Switch between dying via std::terminate() and throwing an exception. Alternatively define the macro TLX_DIE_WITH_EXCEPTION=1

Definition at line 52 of file die.cpp.

References s_die_with_exception.

LoggerOutputHook * set_logger_output_hook ( LoggerOutputHook *  hook)

Set new LoggerOutputHook instance to receive global log lines. Returns the old hook.

Definition at line 48 of file logger.cpp.

References s_logger_output_hook.

Referenced by LoggerCollectOutput::LoggerCollectOutput(), and LoggerCollectOutput::~LoggerCollectOutput().

LoggerPrefixHook * set_logger_prefix_hook ( LoggerPrefixHook *  hook)

Set new LoggerPrefixHook instance to prefix global log lines. Returns the old hook.

Definition at line 57 of file logger.cpp.

References s_logger_prefix_hook.

static uint64_t tlx::siphash ( const uint8_t  key[16],
const uint8_t *  msg,
size_t  size 
)
inlinestatic

Definition at line 239 of file siphash.hpp.

References siphash_plain().

Referenced by HyperLogLogRegisters< p >::insert(), and siphash().

static uint64_t tlx::siphash ( const uint8_t *  msg,
size_t  size 
)
inlinestatic

Definition at line 248 of file siphash.hpp.

References siphash().

static uint64_t tlx::siphash ( const Type &  value)
inlinestatic

Definition at line 257 of file siphash.hpp.

References siphash().

static uint64_t tlx::siphash_plain ( const uint8_t  key[16],
const uint8_t *  m,
size_t  len 
)
inlinestatic

Definition at line 41 of file siphash.hpp.

References TLX_ATTRIBUTE_FALLTHROUGH, TLX_SIPCOMPRESS, and ull().

Referenced by siphash().

void tlx::sort_strings ( std::vector< unsigned char * > &  strings,
size_t  memory 
)

Definition at line 34 of file strings1.cpp.

References sort_strings().

static std::vector<std::string>& tlx::split ( std::vector< std::string > *  into,
const char *  sep,
size_t  sep_size,
const std::string &  str,
std::string::size_type  limit 
)
inlinestatic

Definition at line 107 of file split.cpp.

void tlx::swap ( CountingPtr< A, D > &  a1,
CountingPtr< A, D > &  a2 
)
noexcept

swap enclosed object with another counting pointer (no reference counts need change)

Definition at line 263 of file counting_ptr.hpp.

Referenced by JoinNode< ValueType, FirstDIA, SecondDIA, KeyExtractor1, KeyExtractor2, JoinFunction, HashFunction, UseLocationDetection >::AddEqualKeysToVec(), File::Clear(), LoserTreeCopy< Stable, ValueType, Comparator >::delete_min_insert(), LoserTreeCopy< true, ValueType, Comparator >::delete_min_insert(), LoserTreePointer< Stable, ValueType, Comparator >::delete_min_insert(), LoserTreePointer< true, ValueType, Comparator >::delete_min_insert(), LoserTreeCopyUnguarded< Stable, ValueType, Comparator >::delete_min_insert(), LoserTreeCopyUnguarded< true, ValueType, Comparator >::delete_min_insert(), LoserTreePointerUnguarded< Stable, ValueType, Comparator >::delete_min_insert(), LoserTreePointerUnguarded< true, ValueType, Comparator >::delete_min_insert(), ConcatToDIANode< ValueType >::Dispose(), EqualToDIANode< ValueType >::Dispose(), DistributeNode< ValueType >::Dispose(), ReduceTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_, IndexFunction, KeyEqualFunction >::Dispose(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Dispose(), ReduceOldProbingHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_, IndexFunction, KeyEqualFunction >::Dispose(), ReduceBucketHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig, IndexFunction, KeyEqualFunction >::Dispose(), LocationDetection< thrill::api::JoinNode::HashCount >::Dispose(), BinaryHeap< Timer >::erase(), LocationDetection< thrill::api::JoinNode::HashCount >::Flush(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::FlushAndConsume(), thrill::common::qsort_local::InsertionSort(), GroupToIndexNode< ValueType, KeyExtractor, GroupFunction >::MainOp(), GroupByNode< ValueType, KeyExtractor, GroupFunction, HashFunction, UseLocationDetection >::MainOp(), SortNode< ValueType, CompareFunction, SortAlgorithm >::MainOp(), tlx::sort_strings_detail::multikey_quicksort(), tlx::multiway_merge_detail::multiway_merge_bubble(), BinaryHeap< Timer >::pop_heap(), thrill::common::qsort_three_pivots(), thrill::common::qsort_two_pivots_yaroslavskiy(), thrill::common::radix_sort_CI(), RadixStep_CI2< StringSet >::RadixStep_CI2(), RadixStep_CI3< StringSet >::RadixStep_CI3(), random_bipartition_shuffle(), block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::schedule_read(), thrill::common::qsort_local::sort3(), thrill::common::qsort_local::sort4(), thrill::common::qsort_local::sort5(), Range::Swap(), SimpleVector< std::thread >::swap(), btree_set< Key_, Compare_, Traits_, Alloc_ >::swap(), btree_multimap< Key_, Data_, Compare_, Traits_, Alloc_ >::swap(), btree_multiset< Key_, Compare_, Traits_, Alloc_ >::swap(), btree_map< Key_, Data_, Compare_, Traits_, Alloc_ >::swap(), CountingPtr< WriteStream >::swap(), Delegate< R(A...), Allocator >::swap(), btree< key_type, value_type, key_of_value, key_compare, traits, true, allocator_type >::swap(), foxxll::swap_1D_arrays(), SortNode< ValueType, CompareFunction, SortAlgorithm >::TransmitItems(), and tlx::sort_strings_detail::vec_swap().

void tlx::unused ( Types &&  ...)

Definition at line 20 of file unused.hpp.

Referenced by block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::acquire(), foxxll::compute_prefetch_schedule(), LoserTreePointer< Stable, ValueType, Comparator >::delete_min_insert(), LoserTreePointer< true, ValueType, Comparator >::delete_min_insert(), LoserTreeCopyUnguarded< Stable, ValueType, Comparator >::delete_min_insert(), LoserTreeCopyUnguarded< true, ValueType, Comparator >::delete_min_insert(), LoserTreePointerUnguarded< Stable, ValueType, Comparator >::delete_min_insert(), LoserTreePointerUnguarded< true, ValueType, Comparator >::delete_min_insert(), memory_file::discard(), fileperblock_file< base_file_type >::discard(), file::discard(), fileperblock_file< base_file_type >::export_files(), file::export_files(), LoserTreePointerBase< ValueType, Comparator >::insert_start(), LoserTreeCopyUnguardedBase< ValueType, Comparator >::insert_start(), LoserTreePointerUnguardedBase< ValueType, Comparator >::insert_start(), thrill::common::LogCmdlineParams(), ZipWindowNode< ValueType, ZipFunction_, Pad_, UnequalCheck, UseStdArray, kNumInputs_ >::MainOp(), tlx::multiway_merge_detail::multiway_merge_3_variant(), tlx::multiway_merge_detail::multiway_merge_4_variant(), OutputSVG(), thrill::common::PortSetCloseOnExec(), print_cxx_backtrace(), print_raw_backtrace(), Dispatcher::PumpRecvQueue(), Dispatcher::PumpSendQueue(), Dispatcher::QueueAsyncRecv(), Dispatcher::QueueAsyncSend(), ReducePrePhase< TableItem, Key, Value, KeyExtractor, ReduceFunction, VolatileKey, BlockWriter, ReduceConfig_, IndexFunction, KeyEqualFunction, HashFunction, false >::ReducePrePhase(), request_queue_impl_1q::request_queue_impl_1q(), request_queue_impl_qwqr::request_queue_impl_qwqr(), block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::schedule_write(), request_queue::set_priority_op(), request_queue_impl_1q::set_priority_op(), request_queue_impl_qwqr::set_priority_op(), and thrill::common::SetCpuAffinity().

Variable Documentation

DefaultLoggerOutput s_default_logger
static

default logger singleton

Definition at line 41 of file logger.cpp.

std::atomic<bool> s_die_with_exception
static
Initial value:
{
false
}

Definition at line 21 of file die.cpp.

Referenced by die_with_message(), and set_die_with_exception().

std::atomic<LoggerOutputHook*> s_logger_output_hook
static
Initial value:
{
}
static DefaultLoggerOutput s_default_logger
default logger singleton
Definition: logger.cpp:41

global logger output hook

Definition at line 44 of file logger.cpp.

Referenced by set_logger_output_hook().

std::atomic<LoggerPrefixHook*> s_logger_prefix_hook
static
Initial value:
{
nullptr
}

global logger prefix hook

Definition at line 53 of file logger.cpp.

Referenced by Logger::Logger(), set_logger_prefix_hook(), and SpacingLogger::SpacingLogger().