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.
MIT License
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 using malloc()
and free()
(respectively new
and delete
) 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 |
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 |
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) |
- Simple Array
- Sorted or Unsorted
- Fastest
operator[] pushBack() popBack()
|
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) |
- Simple Queue
- Sorted or Unsorted
- Constant
O(k) for pushFront() popFront() - Example: Message Queue
|
MinHeap.h |
operator[]
push()
pop()
removeAt() |
O(1)
O(log(n))
O(log(n))
O(log(n)) |
- Binary Min Heap
- Always Sorted
- Finds minimum at root in
O(1) - Example: Timer Schedule
- Example: A* Open-List
|
HashTable.h |
insert()
remove()
find() |
O(1000)
O(1000)
O(1000) |
- Example: Large Lookup Dictionary
- Example: Database Table
|
... |
|
|
|
Header |
Operation |
Complexity |
Notes |
Cache.h |
|
|
|
Header |
Notes |
Socket.h |
- Basic POSIX Socket Wrapper Class
- Works around remaining differences on platforms
|
TcpSocket.h |
- Builds upon
Socket.h - TCP IPv6 Dual-Stack Socket
- For Server and Client
- Advanced
connect() , listen() and accept() methods
|
TcpLink.h |
- Builds upon
TcpSocket.h - Implements a raw TCP connection
- For Server and Client
|
TcpClient.h |
- Builds upon
TcpLink.h - For Client
|
TcpSession.h |
- Builds upon
TcpLink.h - For Server
|
TcpServer.h |
- Builds upon
TcpSession.h - For Server
|
... |
|
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 Xorshift32 Xorshift64 Xoshiro32 Xoshiro64 Mulberry32 Splitmix64 Cpu32* Cpu64* * 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 |