LogCabin
Classes | Namespaces | Defines | Functions
Core/Util.h File Reference

Common utilities and definitions. More...

#include <cassert>
#include <cinttypes>
#include <functional>
#include <stdexcept>

Go to the source code of this file.

Classes

class  LogCabin::Core::Util::Finally
 Calls a function when this object goes out of scope. More...
class  LogCabin::Core::Util::ThreadInterruptedException
 The thread could not complete its task because it was asked to exit. More...

Namespaces

namespace  LogCabin
namespace  LogCabin::Core
namespace  LogCabin::Core::Util

Defines

#define sizeof32(x)
 Like sizeof but returns a uint32_t.

Functions

template<typename Small , typename Large >
Small LogCabin::Core::Util::downCast (const Large &large)
 Cast a bigger int down to a smaller one.
bool LogCabin::Core::Util::isPowerOfTwo (uint64_t x)
 Return true if the log of x in base 2 is a whole number.
void * LogCabin::Core::Util::memcpy (void *dest, std::initializer_list< std::pair< const void *, size_t >> src)
 Copy some noncontiguous chunks of data into a contiguous chunk.

Detailed Description

Common utilities and definitions.

See also Core::STLUtil and Core::StringUtil.

Definition in file Util.h.


Define Documentation

#define sizeof32 (   x)

Like sizeof but returns a uint32_t.

Definition at line 52 of file Util.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines