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

Namespaces

 detail
 

Classes

class  AllocatorBase
 
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  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  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  ReferenceCounter
 Provides reference counting abilities for use with CountingPtr. More...
 
class  RingBuffer
 A ring (circular) buffer of static (non-growing) size. 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...
 
template<typename T >
using simple_vector = SimpleVector< T >
 make template alias due to similarity with std::vector More...
 

Enumerations

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...
 
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)
 
void die_with_message (const std::string &msg)
 die with message - either throw an exception or die via abort() More...
 
void die_with_message (const char *msg, const char *file, size_t line)
 die with message - either throw an exception or die via abort() 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 abort() 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_uri (const std::string &src)
 Escape a string into a URI-encoding. 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...
 
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)
 
bool is_space (char ch)
 
static bool is_white (char c)
 
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...
 
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...
 
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...
 
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...
 
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...
 
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...
 
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)
 
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)
 
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...
 
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 (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_words (const std::string &str, std::string::size_type limit=std::string::npos)
 Split the given string by whitespaces into distinct words. 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 & trim (std::string *str, const char *drop=" \r\n\t")
 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, const char *drop=" \r\n\t")
 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_left (std::string *str, const char *drop=" \r\n\t")
 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, const char *drop=" \r\n\t")
 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...
 
std::string & trim_right (std::string *str, const char *drop=" \r\n\t")
 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, const char *drop=" \r\n\t")
 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 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... 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...
 
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...
 

Variables

static std::mutex s_logger_mutex
 mutex for log output 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.

Function Documentation

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

helper method to compare two values in die_unequal()

Definition at line 75 of file die.hpp.

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

Definition at line 80 of file die.hpp.

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

Definition at line 86 of file die.hpp.

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

Definition at line 92 of file die.hpp.

void die_with_message ( const std::string &  msg)

die with message - either throw an exception or die via abort()

Definition at line 18 of file die.cpp.

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 abort()

Definition at line 23 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 abort()

Definition at line 29 of file die.cpp.

References die_with_message().

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 67 of file backtrace.cpp.

References free(), malloc(), 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 28 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 63 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().

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

Definition at line 242 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 251 of file siphash.hpp.

References siphash().

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

Definition at line 260 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 45 of file siphash.hpp.

References sipcompress, and TLX_ATTRIBUTE_FALLTHROUGH.

Referenced by siphash().

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(), BinaryHeap< Timer >::pop_heap(), thrill::common::qsort_three_pivots(), thrill::common::qsort_two_pivots_yaroslavskiy(), thrill::common::radix_sort_CI(), thrill::common::qsort_local::sort3(), thrill::common::qsort_local::sort4(), thrill::common::qsort_local::sort5(), Range::Swap(), SimpleVector< std::thread >::swap(), CountingPtr< FileBase >::swap(), Delegate< R(A...), Allocator >::swap(), and SortNode< ValueType, CompareFunction, SortAlgorithm >::TransmitItems().

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

Definition at line 20 of file unused.hpp.

Referenced by 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(), MemoryFile::discard(), FileBase::discard(), LoserTreePointerBase< ValueType, Comparator >::insert_start(), LoserTreeCopyUnguardedBase< ValueType, Comparator >::insert_start(), LoserTreePointerUnguardedBase< ValueType, Comparator >::insert_start(), thrill::common::LogCmdlineParams(), OutputSVG(), thrill::common::PortSetCloseOnExec(), print_cxx_backtrace(), print_raw_backtrace(), Dispatcher::PumpRecvQueue(), Dispatcher::PumpSendQueue(), Dispatcher::QueueAsyncRecv(), Dispatcher::QueueAsyncSend(), Stats::read_started(), ReducePrePhase< TableItem, Key, Value, KeyExtractor, ReduceFunction, VolatileKey, BlockWriter, ReduceConfig_, IndexFunction, KeyEqualFunction, HashFunction, false >::ReducePrePhase(), RequestQueueImpl1Q::RequestQueueImpl1Q(), RequestQueueImplQwQr::RequestQueueImplQwQr(), Stats::ScopedWaitTimer::ScopedWaitTimer(), thrill::common::SetCpuAffinity(), RequestQueue::SetPriorityOp(), RequestQueueImpl1Q::SetPriorityOp(), RequestQueueImplQwQr::SetPriorityOp(), and Stats::write_started().

Variable Documentation

std::mutex s_logger_mutex
static

mutex for log output

Definition at line 24 of file logger.cpp.

Referenced by Logger::Output().