29 void encodeBase64(
const void *data,
size_t size, std::string &out);
33 return h1 + 0x9e3779b9 + (h2 << 6) + (h2 >> 2);
40 using Lock = std::lock_guard<std::mutex>;
43 mutable std::mutex
qM;
54 template <
typename... E>
62 std::optional<T>
pop() {
74 void pop(std::function<
bool(
const T &)> callback) {
std::mutex qM
The queue and its mutex.
std::mutex popM
A mutex to ensure that only one 'pop' operation is happening at a time.
bool empty() const
Is the queue empty?
void push(E... t)
Push onto the queue.
std::lock_guard< std::mutex > Lock
std::optional< T > pop()
Pop something off the queue but return nullopt if the queue is empty.
void pop(std::function< bool(const T &)> callback)
Call the callback for the front of the queue (if anything is there).
void encodeBase64(const void *data, size_t size, std::string &out)
size_t hash_combine(size_t h1, size_t h2)
C++'s stdlib doesn't have a hash_combine function. This is a simple one.