C++ for Embedded Systems

Who should attend?

Software developers with C experience having to develop object oriented applications in C++ for embedded systems.

Pre-requisites:

A good working knowledge of C.

Duration:

5 days

Course Description:

This course introduces the programming language C++ for use in embedded systems, as well as the fundamentals of the object oriented way of programming. It has been designed for experienced C programmers, who do not only want to learn the syntax of a new programming language, but also want to understand how object-oriented features work and what their advantages are over traditional C programming. Assessments of the language features with respect to memory consumption and execution time detail the benefits and the pitfalls of the object oriented approach, thus allowing the students to develop powerful solutions using the scarce resources of embedded systems efficiently. Additionally, this course illustrates how hardware devices can be mapped into objects for a seamless integration in embedded object oriented applications. The associated practical exercises are performed on an ARM-based target board.


 

Course Outline:

New Language Features

  • Data type bool
  • References
  • Function overloading
  • Default parameters
  • Namespaces
  • Dynamic memory management
  • Operator overloading
  • Input/output (cin/cout)

From Struct to Class

  • Data elements, attributes
  • Member functions, methods
  • Static / non-static elements
  • this-Pointer
  • Access rights public and private
  • Class

Constructors and Destructors

  • Default constructor and copy constructor
  • Global / static objects and arrays
  • Objects containing objects

Operators as Class Members

  • Assignment operator
  • Subscript operator
  • Type cast operator

Inheritance and Aggregation

  • Base class and derived class
  • Benefits of inheritance compared to aggregation
  • Modelling the base class functionality
  • Impact on construction and destruction
  • Access right protected
  • Protected and private inheritance

Virtual Functions and Polymorphism

  • Static and dynamic linking
  • Virtual function table (vtable)
  • Abstract functions and abstract classes

Assessment of the Language Features

  • Object model
  • Object creation and deletion
  • Temporary Objects
  • Inheritance
  • Virtual functions
  • Dynamic memory management

Mapping Hardware Devices into Objects

  • Traditional solutions
  • Struct-based solution
  • Hardware device as a C++ object
  • Interrupt handling

Practical Exercises