tudocomp
– The TU Dortmund Compression Framework
def.hpp File Reference
#include <cstddef>
#include <limits>
#include <type_traits>
#include <tudocomp/ds/uint_t.hpp>

Go to the source code of this file.

Namespaces

 tdc
 Contains the text compression and encoding framework.
 

Macros

#define tdc_likely(x)   x
 Provides a hint to the compiler that x is expected to resolve to true. More...
 
#define tdc_unlikely(x)   x
 Provides a hint to the compiler that x is expected to resolve to false. More...
 
#define IF_DEBUG(x)
 x is compiled only in debug builds. More...
 
#define GOOGLE_STRIP_LOG   1
 
#define IF_PARANOID(x)
 x is compiled only in debug builds and when the PARANOID macro is defined. More...
 
#define IF_STATS(x)   x
 x is compiled only when the STATS_DISABLED macro is undefined. More...
 

Typedefs

template<typename actual_type >
using tdc::fast_t = typename FastIntType< actual_type >::Type
 Type to represent integer values in the size range of actual_type that may require more Bits than it, while being faster. More...
 
using tdc::len_compact_t = uint32_t
 Type to represent an bit-compact length value. More...
 
using tdc::len_t = fast_t< len_compact_t >
 Type to represent an length value. More...
 
typedef uint8_t tdc::uliteral_t
 Type to represent signed single literals. More...
 

Functions

template<typename T = size_t>
constexpr T tdc::literal2int (uliteral_t c)
 Converts a literal to an integer value as if unsigned. More...
 
template<typename T = size_t>
constexpr uliteral_t tdc::int2literal (const T &c)
 Converts an integer value to a literal as if unsigned. More...
 

Variables

constexpr size_t tdc::INDEX_MAX = std::numeric_limits<len_compact_t>::max()
 The maximum value of len_compact_t. More...
 
constexpr size_t tdc::INDEX_BITS = 8 * sizeof(len_compact_t)
 The amount of bits required to store the binary representation of a value of type len_compact_t. More...
 
constexpr size_t tdc::INDEX_FAST_MAX = std::numeric_limits<len_t>::max()
 The maximum value of len_t. More...
 
constexpr size_t tdc::INDEX_FAST_BITS = 8 * sizeof(len_t)
 The amount of bits required to store the binary representation of a value of type len_t. More...
 
constexpr size_t tdc::ULITERAL_MAX = std::numeric_limits<uliteral_t>::max()
 The maximum value of uliteral_t. More...
 

Macro Definition Documentation

◆ GOOGLE_STRIP_LOG

#define GOOGLE_STRIP_LOG   1

Definition at line 38 of file def.hpp.

◆ IF_DEBUG

#define IF_DEBUG (   x)

x is compiled only in debug builds.

Definition at line 32 of file def.hpp.

◆ IF_PARANOID

#define IF_PARANOID (   x)

x is compiled only in debug builds and when the PARANOID macro is defined.

Definition at line 49 of file def.hpp.

◆ IF_STATS

#define IF_STATS (   x)    x

x is compiled only when the STATS_DISABLED macro is undefined.

Definition at line 59 of file def.hpp.

◆ tdc_likely

#define tdc_likely (   x)    x

Provides a hint to the compiler that x is expected to resolve to true.

Definition at line 20 of file def.hpp.

◆ tdc_unlikely

#define tdc_unlikely (   x)    x

Provides a hint to the compiler that x is expected to resolve to false.

Definition at line 23 of file def.hpp.