Skip to content

Latest commit

 

History

History

.template

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Template component

This is a template, which can be used to quickly add new components to the project. Simply copy this directory to create a new component.

A component in this project has following structure:

component
├── README.md
├── CMakeLists.txt
├── include
│   ├── public_header.h
│   └── ...
├── src
│   ├── private_header.h
│   ├── ...
│   ├── private_code.h
│   └── ...
└── test
    ├── CMakeLists.txt
    ├── test_header.h
    ├── ...
    ├── test_code.c
    └── ...
  • /component is the name of the component
    • ATTENTION: a component will replace any other component with the same name
  • /component/README.md gives additional information about the component
  • /component/CMakeLists.txt defines how the component should be build and what to export
  • /component/include/*.h are public header files for other components
  • /component/src/*.{c,h} are the private source files of the component
  • /component/test/CMakeLists.txt defines how the unit test should be build
  • /component/test/*.{c,h} are the unit test files of the component

Concept

This component implements a private dummy counter variable which can be manipulated through various simple functions.

Examples

Reset

#include "counter.h"
Counter zero = counter_reset();

Increment

#include "counter.h"
Counter inc = counter_increment();

Decrement

#include "counter.h"
Counter dec = counter_decrement();

Add

#include "counter.h"
Counter added = counter_add(5);

Sub

#include "counter.h"
Counter sub = counter_sub(7);

Related