This course introduces the C++ language for use on real-time and embedded applications. The course highlights areas of concern for real-time and embedded development. The focus is on developing core object-oriented programming skills and understanding of how to build effective, maintainable and efficient C++ programs.
Attendees perform hands-on embedded programming, on target hardware, during course practicals. Approximately 50% of the course is given over to practical work.
- To provide a solid understanding of the essentials of the C++ programming language.
- To give you practical experience of writing C++ for real-time and embedded systems.
- To give you the confidence to apply these new concepts to your next real-time project.
Delegates will learn:
- The core C++ syntax and semantics
- How to access hardware in the language
- How to program interrupt handlers in C++
- About memory and performance issues associated with C++
- How real time operating systems (RTOS) affect the use of the language
- A good working knowledge of C
Who should attend:
This course is designed for real-time engineers who are embarking on a project using C++ for the first time. It is also targeted at developers currently reluctant to move from C to C++ as they believe it poses too great an overhead. This course will clearly demonstrate both the strengths and weaknesses of C++ versus C.
- Five days.
- Delegate handbook
- Delegate workbook
- Delegate datakey
This course makes use of target hardware during the real-time practical exercises. The board targeted is an ARM Cortex-M based MCU which gives attendees a real sense of embedded application development.
- How C++ relates to C
- I/O mechanisms
Declarations and definitions:
- Object lifetime and scope
Principles of Object-Oriented Design:
- Objects and messaging
- Dealing with complexity
- Classes and instances
- Member variables and member functions
- Constructors and destructors
- Objects as function parameters
- In, Out and InOut parameters
- const correctness
- Header files
- Memory-mapped hardware access
- Object-oriented hardware abstraction
- 1:1, 1:N associations
Building complex objects
- Composition of objects
- RAII / RDID
- Copy constructors and assignment operators
- The Rule of the Big Three
- Why do we have inheritance in OO design?
Creating substitutable objects
- Constructing derived objects
- Accessing base class members
- Overriding and hiding
- Dynamic polymorphism
- Virtual functions and their implementation
Abstract base classes
- The Single Responsibility Principle
- Extension of interface
- Safe down-casting
- The pure virtual class
- Interface segregation
- Template functions
- Template classes
- The exception handling mechanism
- Exception objects
Principles of concurrency
- Scheduling patterns
Creating concurrent objects
- Thread-Is-Polymorphic-Object pattern
- Race conditions and their impact
- Mutex classes
- The scope-locked idiom
- Condition objects
- The Monitor pattern