CppELib is a portable C++ library for embedded software development. This works on the freestanding environment such as:
- No standard C++ libraries
- Disabled exception-handling
CppELib provides these mechanisms:
-
Assertion
This is used instead of standard
assert()
macro. If an assertion fails, you must handle to do shutdown your application safely. There are two assertion macros. CHECK_ASSERT() is always enabled, DEBUG_ASSERT() is enabled only whenNDEBUG
macro is not defined. -
Container
STL-like containers without dynamic memory allocation: fixed capacity vector, fixed capacity deque, intrusive list, etc.
-
OSWrapper
If you use a vendor's real-time operating system (RTOS), perhaps you can't use common class library like
std::thread
. OSWrapper provides abstract C++ interface of common RTOS: thread, mutex, event flag, message queue, memory pool, etc. This makes your application more portable and testable. And you can get a simulation environment for debug or test of your application on your host machine without the target board too (but real-time property may not be guaranteed). If the source files for your OS platform are not prepared inplatform
directory, you need to implement concrete classes of OS API wrapper. These concrete classes are only used for Dependency Injection as the application is initialized.
You can get the latest version from here.
https://github.com/katono/cppelib
mechanism
: C++98 or later (freestanding)platform
of Windows and POSIX: C++11 or later
Add source and header files to your application source tree and add mechanism
and platform
directories to the include path.
Tests of CppELib use CppUTest because this testing framework is portable. Tests can be run on multi-platform: Visual Studio, g++, and your target platform.
MIT License