External | ||
Standalone | ||
_clang-format | ||
.gitignore | ||
build.bat | ||
build.sh | ||
dqn_allocator.cpp | ||
dqn_allocator.h | ||
dqn_base.cpp | ||
dqn_base.h | ||
dqn_cgen.cpp | ||
dqn_cgen.h | ||
dqn_containers.cpp | ||
dqn_containers.h | ||
dqn_cppbuild.h | ||
dqn_debug.cpp | ||
dqn_debug.h | ||
dqn_docs.cpp | ||
dqn_external.cpp | ||
dqn_external.h | ||
dqn_hash.cpp | ||
dqn_hash.h | ||
dqn_helpers.cpp | ||
dqn_helpers.h | ||
dqn_json.h | ||
dqn_math.cpp | ||
dqn_math.h | ||
dqn_os_posix.cpp | ||
dqn_os_win32.cpp | ||
dqn_os_win32.h | ||
dqn_os.cpp | ||
dqn_os.h | ||
dqn_string.cpp | ||
dqn_string.h | ||
dqn_thread_context.cpp | ||
dqn_thread_context.h | ||
dqn_type_info.h | ||
dqn_unit_tests.cpp | ||
dqn_win32.h | ||
dqn.h | ||
readme.md |
Dqn
My personal standard library that provides allocator aware data structures,
custom memory allocators and various miscellaneous helpers for prototyping. The
library is a unity-build style library where data structures and functions are
separated by category into files for organisation. You only need to include
dqn.h
which amalgamates all the files into one translation unit.
Build
To build with this library, copy all the *.[h|cpp]
files at the root of the
repository to your desired location, accessible by your project and in one
header file include the header.
#include "dqn.h"
dqn.h
includes all other files and their declaration into your header. In
one .cpp
file define the macro to enable the implementation of the header in
that translation unit.
#define DQN_IMPLEMENTATION
#include "dqn.h"
Finally ensure that the compiler has in its search paths for the include
directory where headers are located, e.g. -I <path/to/dqn/headers>
.
Customisation
The headers provide macros to compile out sections that are not needed. This can be useful to speed up compile times or reduce binary size if you only need a particular part of the library. Each header contains a table-of-contents that denotes the macro to define to disable that section that should be defined before the header include.
#define DQN_NO_VARRAY // Disable virtual array container
#define DQN_NO_JSON_BUILDER // Disable the JSON string builder
#include "dqn.h"