CppCore is my personal C++17 framework with focus on:
- High Performance
- Cross Platform Compatibility
- Easy Integration (almost header-only)
It was made for my own use but I am happy to share it with everyone.
Min. OS | X64 | X86 | ARM64 | ARM | Github Action |
---|---|---|---|---|---|
Windows 10 | β | β | β | π΄ | |
Ubuntu 20.04 | β | β | β | β | |
OSX 10.15 | β | π΄ | β | π΄ | |
Android 23 | β | β | β | β | |
iOS 13.0 | π΄ | π΄ | β | π΄ |
- Performance, Performance, Performance:
The most important principle. This framework was design to be used in real-time critical applications such as games. If you find something that can be done faster, please let me know. - Fixed-Size Memory Pooling:
This framework avoids usingmalloc()
andfree()
(respectivelynew
anddelete
) to allocate memory at runtime in favor of a fully compile-time specified memory layout. Almost all memory is allocated on startup and used until shutdown - faster, predictable and no undefined out-of-memory behaviour. Yes, there are always exclusions. - Virtual Function Pointers:
OOB programming is great but its disadvantages are often forgotten. No, you won't find things like tiny vector classes blown up in size due to a VFPTR with horribly slow non-inlined arithmetic function calls in this library. - Header-Only:
Allows the compiler to efficiently inline all the framework code into your object files and therefore making integration much simpler and code executing faster. There are a few exclusions to this pattern due to platform limitations (e.g. Windows Message Processing Function) - Multithreading:
This framework comes with its own multithreading patterns and uses multiple cores whenever possible/useful.
- CppCore is an almost header-only library. Just include the headers and build the CppCore.cpp with your project.
- Only examples and test executables can be built from this repository (see Build Notes for them).
Header | Bits | Reference | Notes |
---|---|---|---|
CRC32.h | 32 | CRC32/CRC32C (CPU) | |
Murmur3.h | 32 | Popular for hash tables | |
MD5.h | 128 | Wikipedia | |
SHA2.h | 256/512 | Wikipedia |
Header | Reference | Notes |
---|---|---|
AES.h | Wikipedia | 128/192/256 Bit | ECB/CBC/CTR | AES-NI |
HMAC.h | Wikipedia | MD5 | SHA2-256 | SHA2-512 |
PBKDF2.h | Wikipedia | HMAC-SHA2-256 | HMAC-SHA2-512 |
Header | Notes |
---|---|
BigInt.h | Large unsigned integers from uint128_t up to uint2048_t |
Primes.h | Prime Tests (Miller-Rabin/Lucas-Lehmer/...) |
V2.h | 2D Vector for float double int32_t int64_t with SSE/AVX |
V3.h | 3D Vector for float double int32_t int64_t with SSE/AVX |
V4.h | 4D Vector for float double int32_t int64_t with SSE/AVX |
Header | Complexity | Notes |
---|---|---|
QuickSort.h | O(n*log(n)) |
Non-Recursive Quicksort Algorithm |
BinarySearch.h | O(log(n)) |
Non-Recursive Binarysearch Algorithm |
Different O(k)
are used to outline some differences between operations with constant complexity on different containers.
Header | Operation | Complexity | Notes |
---|---|---|---|
Array.h | operator[] pushFront() pushBack() popFront() popBack() insertAt() removeAt() |
O(1) O(n) O(1) O(n) O(1) O(n) O(n) |
|
BinTree.h | |||
Queue.h | operator[] pushFront() pushBack() popFront() popBack() insertAt() removeAt() |
O(10) O(10) O(10) O(10) O(10) O(n) O(n) |
|
MinHeap.h | operator[] push() pop() removeAt() |
O(1) O(log(n)) O(log(n)) O(log(n)) |
|
HashTable.h | insert() remove() find() |
O(1000) O(1000) O(1000) |
|
... |
Header | Operation | Complexity | Notes |
---|---|---|---|
Cache.h |
Header | Notes |
---|---|
Runnable.h | Wraps std::function executing a piece of code on a thread at a certain time. |
Thread.h | Uses std::thread |
Schedule.h |
Header | Notes |
---|---|
Socket.h |
|
TcpSocket.h |
|
TcpLink.h |
|
TcpClient.h |
|
TcpSession.h |
|
TcpServer.h |
|
... |
Header | Notes |
---|---|
Input.h | Keyboard/Mouse Input from Window-Events on Win/Linux/OSX |
Window.h | Windows Wrapper for Windows/Linux/OSX |
Header | Notes |
---|---|
Buffer.h | Fixed Size Memory Buffer |
Random.h | Pseudo Random Number Generators
* with RDRAND |
Uuid.h | Universally Unique Identifier |
Start type Console
from terminal on OSX.
Name | Type | Folder | Notes | |
---|---|---|---|---|
CppCore.Example.Client | Console | Link | Custom binary network protocol client | |
CppCore.Example.Server | Console | Link | Custom binary network protocol server | |
CppCore.Example.UI | Window | Link | Cross-Platform Application Window and Input |
Name | Type | Folder | Notes | |
---|---|---|---|---|
CppCore.Test | Console | VS-Test | Link | Unit Tests | |
CppCore.Debug | Console | Link | Empty project to run code during development |