/collection2

Collection of common data structures

Primary LanguageC++MIT LicenseMIT

unittest

Overview

Collection of common data structures

Features

  • header-only library
  • designed for small embedded system
    • no dynamic memory allocation (malloc, new, ...)
    • no code depends on STL
    • all test cases pass on AVR microcontroller (emulated with QEMU)
  • generic data structures:
    • Queue
    • Stack
    • Buffer
    • List
    • Tree (v0.5.0~)

Install

You can install collection2 by some ways.

1. install as dependency of your project (using FetchContent of CMake)

Add the following to your CMakeLists.txt:

# Fetch library
include(FetchContent)
FetchContent_Declare(
    collection2
    GIT_REPOSITORY https://github.com/Enchan1207/collection2
    GIT_TAG v0.6.0
)
FetchContent_MakeAvailable(collection2)

# assume target name is main
add_executable(main)
target_sources(main
    ...
)

# Include directories are automatically set when linking
target_link_libraries(main PRIVATE
    collection2 
)

2. install to your client machine

After clone this repository, exec commands shown below. To exec these commands, the library will be installed on your system.

mkdir build
cd build
cmake ..
cmake --build .
ctest
cmake --install .

Usage

Latest document is hosted on GitHub Pages.

License

This repository is published under MIT License.