Robin Mueller fbffca3b4c Update cmake & meson version handling (#522)
* updated the version handling

- Introduces a new version.txt file
- This file is parsed by CMake to determine the current version

* assign version in project call

* use version variable

* Meson update

1. Minor fix for GCC build
2. Use external version file which can be used by CMake as well

* get version from git tag now

* ci/cd broke..

* maybe this solves the error

* updated workflow files

* one last test

* remove git describe call
2022-04-08 09:37:21 +02:00
.circleci Resolve 0U ambiguity in string utility tests 2020-08-02 15:14:52 +01:00
.github Update cmake & meson version handling (#522) 2022-04-08 09:37:21 +02:00
arduino Script to update version numbers 2022-04-08 09:37:21 +02:00
cmake Update cmake & meson version handling (#522) 2022-04-08 09:37:21 +02:00
examples Updated Arduino files 2022-03-07 09:06:19 +00:00
images Added etl::ibitset::span() member functions to return a span of the underlying binary data. 2020-07-27 10:52:07 +01:00
include/etl cplusplus traits is now 'long' 2022-04-01 11:55:32 +02:00
scripts Script to update version numbers 2022-04-08 09:37:21 +02:00
subprojects Meson tests & style fix (#447) 2021-10-22 18:39:26 +01:00
support Fixed undefined macros when compiler type is defined by the user 2022-03-24 14:46:38 +00:00
temp Updated version numbers 2020-12-01 13:19:44 +00:00
test Update cmake & meson version handling (#522) 2022-04-08 09:37:21 +02:00
uml UML framework diagrams 2017-08-03 09:53:33 +01:00
.clang-format Updated to closely match ETL formatting 2021-10-02 17:54:20 +01:00
.gitattributes Merge branch 'hotfix/issue-303-etl-not-compatible-with-arduino-ide' into development 2020-12-08 13:19:42 +00:00
.gitignore Update cmake & meson version handling (#522) 2022-04-08 09:37:21 +02:00
.gitlab-ci.yml Update cmake & meson version handling (#522) 2022-04-08 09:37:21 +02:00
.gitmodules Merge remote-tracking branch 'origin/feature/CMake' into development 2018-05-31 22:21:09 +01:00
appveyor.yml Updated appveyor configuration 2021-08-14 11:19:14 +01:00
CMakeLists.txt Update cmake & meson version handling (#522) 2022-04-08 09:37:21 +02:00
Doxyfile Updated doxygen file (#131) 2019-06-14 22:41:45 +01:00
file.txt Added etl::buffer_descriptors. 2020-11-12 19:13:10 +00:00
library.json Script to update version numbers 2022-04-08 09:37:21 +02:00
library.properties Script to update version numbers 2022-04-08 09:37:21 +02:00
LICENSE Merge remote-tracking branch 'origin/master' into development 2018-07-12 21:32:54 +01:00
meson_options.txt Meson tests & style fix (#447) 2021-10-22 18:39:26 +01:00
meson.build Update cmake & meson version handling (#522) 2022-04-08 09:37:21 +02:00
README.md CMake install instructions (#527) 2022-04-08 09:37:20 +02:00
todo.txt Merge remote-tracking branch 'origin/feature/etl__make_string' into development 2019-12-04 20:55:18 +00:00
version.txt Update cmake & meson version handling (#522) 2022-04-08 09:37:21 +02:00

Embedded Template Library (ETL)

Release date GitHub release (latest by date) Standard License Sponsors

CI CI CI Build status Codacy Badge

Motivation

C++ is a great language to use for embedded applications and templates are a powerful aspect. The standard library can offer a great deal of well tested functionality, but there are some parts of the standard library that do not fit well with deterministic behaviour and limited resource requirements. These limitations usually preclude the use of dynamically allocated memory and containers with open ended sizes.

What is needed is a template library where the user can declare the size, or maximum size of any object upfront. Most embedded compilers do not currently support the standard beyond C++ 03, therefore excluding the programmer from using the enhanced features of the later library.

This is what the ETL attempts to achieve.

Summary

The ETL is not designed to completely replace the STL, but complement it. Its design objective covers three areas.

  • Create a set of containers where the size or maximum size is determined at compile time. These containers are direct equivalents of those supplied in the STL.
  • Be compatible with C++ 03 but implement as many of the C++ 11 additions as possible.
  • Add other useful components that are not present in the standard library.

The embedded template library has been designed for lower resource embedded applications. It contains a set of containers, algorithms and utilities, some of which emulate parts of the STL. There is no dynamic memory allocation. The library makes no use of the heap. All of the containers have a fixed capacity allowing all memory allocation to be determined at compile time. The library is intended for any compiler that supports C++ 03.

Main features

  • Cross platform. This library is not specific to any processor type.
  • No dynamic memory allocation
  • No RTTI required
  • Very little use of virtual functions. They are used only when they are absolutely necessary for the required functionality
  • A set of fixed capacity containers. (array, bitset, deque, forward_list, list, queue, stack, vector, map, set, etc.)
  • As the storage for all of the container types is allocated as a contiguous block, they are extremely cache friendly
  • Templated compile time constants
  • Templated design pattern base classes (Visitor, Observer)
  • Reverse engineered C++ 0x11 features (type traits, algorithms, containers etc.)
  • Type-safe enumerations
  • Type-safe typedefs
  • 8, 16, 32 & 64 bit CRC calculations
  • Checksums & hash functions
  • Variants (a type that can store many types in a type-safe interface)
  • Choice of asserts, exceptions, error handler or no checks on errors
  • Unit tested (currently over 6480 tests), using VS2019, GCC 8.1.0, , GCC 9.3.0, Clang 9.0.0 & 10.0.0
  • Many utilities for template support.
  • Easy to read and documented source.
  • Free email support

Any help porting the library to work under different platforms and compilers would be gratefully received. I am especially interested in people who are using Keil, IAR, Green Hills, TI Code Composer etc, bare metal or RTOS, and DSPs.

See (https://www.etlcpp.com) for up-to-date information.

Installing this library

You can find the setup steps here.

CMake

One way to use this library is to drop it somewhere in your project directory and then make the library available by using add_subdirectory

add_subdirectory(etl)
add_executable(foo main.cpp)
target_link_libraries(foo PRIVATE etl)

If you want to install this library with CMake, you can perform the following steps

git clone https://github.com/ETLCPP/etl.git
git checkout <targetVersion>
cmake -B build .
sudo cmake --install build/

After the library has been installed, you can use find_package to use the library. Replace <majorVersionRequirement> with your desired major version:

find_package(etl <majorVersionRequirement>)
add_executable(foo main.cpp)
target_link_libraries(foo PRIVATE etl)

Alternatively you can use FetchContent, replacing <targetVersion> with the version to install based on a git tag:

Include(FetchContent)

FetchContent_Declare(
  etl
  GIT_REPOSITORY https://github.com/ETLCPP/etl
  GIT_TAG        <targetVersion>
)

FetchContent_MakeAvailable(etl)

add_executable(foo main.cpp)
target_link_libraries(foo PRIVATE etl)

Arduino library

The content of this repo is available as a library in the Arduino IDE (search for the "Embedded Template Library" in the IDE library manager). The Arduino library repository is available at https://github.com/ETLCPP/etl-arduino, see there for more details.