Tupperware container and utility library.
twlib aims to be a lightweight container and OS abstraction library for C++. It is built off ideas in the ACE library, a few features (very few) in Boost, and implementations of high performance container from various authors.
The library is built for simplicity, and code readability, while still using the most important features of C++.
twlib provides the following and more:
- Buffer management, block chaining, and reference counting based on the ideas from the ACE_Message_Block except a simpler implementation with some addition functionality.
- Semaphore driven, thread-safe queueing classes.
- Allocator support via classes similar to that in boost / ACE.
- Thread safe logging.
- C++11 templates for thread-safe FIFOs and circular buffers.
- Simple, fast, non-STL C++ hashmap implementation based on Google sparsehash and densehash and [khash](Always update with latests code at: https://github.com/attractivechaos/klib/blob/master/test/khash_keith.c) by Attractive Chaos
- Red-black tree implementation via C++ template from FreeBSD's RB tree, originally by Niels Provos
###Templates###
Many things such as FIFOs, hash tables and circular buffers are only templates - in that case no library build is needed.
###Building###
(only needed if using calls beyond the template library)
You will need Google sparsehash and densehash and gtest.
After cloning, take a look at the Makefile. You will need to place gtest and sparsehash in exapanded_prereqs or another directory you provide.
Then just:
make tw_lib
###Status###
twlib is a work in progress right now, but much of the code is well tested.
Todos:
- automated build process
- move to libuv for cross platform support.
- disk based hash tables