Giter Club home page Giter Club logo

cppelib's Introduction

CppELib

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

CI Build status Coverage Status

Description

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 when NDEBUG 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 in platform 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.

Repository

You can get the latest version from here.

https://github.com/katono/cppelib

Documentation

https://katono.github.io/cppelib-docs

Requirements

  • mechanism: C++98 or later (freestanding)
  • platform of Windows and POSIX: C++11 or later

Installation

Add source and header files to your application source tree and add mechanism and platform directories to the include path.

If you can use Conan C++ package manager, execute these commands in this repo root directory to install cppelib_mechanism package and cppelib_platform package.

conan create mechanism
conan create platform

If you want these packages with C++ exception disabled, you can use tool/profiles/profile_noexceptions to include in your conan profile. In that case, all your packages must use the same conan profile. See tool/build_package.sh to know about how to use a sample conan profile.

Test

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.

Execute these conan commands in this repo root directory to run tests.

conan build mechanism/test --build=missing
conan build platform/test --build=missing

License

MIT License

cppelib's People

Contributors

katono avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.