C++: Advanced Topics (2023-12-04 - 2023-12-06)

Day 1: Introduction: C++, A New Language


Brace Initialization

New OO Features

Functions: std::function<>, Lambdas

From Functions, Functions:

From Lambda

Day 2: Simply Getting Stuff Done

Classic Polymorphism: Interfaces

Inheritance And Object Oriented Design

Look over sensor hierachy in our project:

Smart Pointers

From Smart Pointers (std::unique_ptr, std::shared_ptr)

Move Semantics

From Move Semantics, Rvalue References

Day 3: All The Rest

Morning Wakeup

Interfaces, And OO Design: Kochtopf And The Cloud

  • Show switch.h: convenience methods in interface are possible :-)

  • Show Kochtopf component

    Discuss design issues, e.g.

    • Relationship between controls and component (this, friend)

    • PowerControl::start() vs. set_state()

    • TemperatureControl::get_target_temperature()Hysteresis

    Discuss threading

    • std::unique_ptr<> as member keeps component from being copyable

    • [this]

    • _runningstd::atomic<>

    • Shutdown?

  • Show test fixture

  • What about sensor temperature? Add KochtopfTemperatureControl::get_current_temperature() (⟶ override)

  • This would not be easy without TDD ☝️

  • Discuss technical debt: Kochtopf has hardwired range of 2

Moving, Roundup

Containers And Algorithms

From Standard Template Library

And Embedded?

Still Untold