TSMotter / toaster-active-object

Active object pattern - C++, cmake, gtest, docker, boost, threads, queues, timers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Active Object Pattern

  • This repository show a C++ implementation of the Active Objects (Actors) pattern as is described in the book "Practical UML Statecharts in C/C++: Event-Driven Programming for Embedded Systems - Miro Samek".

  • The example implemented is the Toaster example, presented in Chapter 2 of the book

  • In this pattern, Active Objects (Actors) are event-driven, strictly encapsulated software objects running in their own threads of control that communicate with one another asynchronously by exchanging events.

How to operate the repository

  • If you wish to use docker to operate the repository, build the image and launch it using the helper scripts inside of the docker folder

  • The repository can be operated outside of the docker container if all the dependencies are met

  • Once the environment is set (whether inside or outside the container), the following commands can be issued:

  • To format the code base with clang-format:

./bbuild.sh -f
  • To perform an static analysis in the code base with clang-tidy:
./bbuild.sh -s
  • In the following examples, <target> is either app or test

  • To build:

./bbuild.sh -b <target>
  • To rebuild:
./bbuild.sh -r <target>
  • To execute the built binary:
./bbuild.sh -e <target>
  • To format, analyze, rebuild and execute with verbose turned ON:
./bbuild.sh -v -f -s -r -e <target>
  • Examples:

    • ./bbuild.sh -v -f -s -r -e app
    • ./bbuild.sh -v -f -s -r -e test
  • To check all options available::

./bbuild.sh --help

About

Active object pattern - C++, cmake, gtest, docker, boost, threads, queues, timers


Languages

Language:C++ 77.1%Language:Shell 10.8%Language:CMake 7.5%Language:Dockerfile 4.6%