Skip to content

Commit

Permalink
Added a bit more explanations.
Browse files Browse the repository at this point in the history
  • Loading branch information
berndporr committed Feb 1, 2025
1 parent 99f3a0e commit 7145653
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CppTimerCallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "CppTimer.h"
#include <unistd.h>

// Demo which creates a callback interface as the abstract class "Runnable".
// This then allows to register a callback.

class CppTimerCallback : public CppTimer {

Expand Down
3 changes: 3 additions & 0 deletions CppTimerStdFuncCallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#include <unistd.h>
#include <functional>

// This is a demo how to create a callback with std::function which allows
// calling methods in other classes by registering a lambda function!

class CppTimerCallback : public CppTimer {

public:
Expand Down
3 changes: 3 additions & 0 deletions demo_stdfunccallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include <unistd.h>
#include <thread>

// Demo which shows how to register a callback via a lambda function.
// The method run() in the receiving classes below is called from the class CppTimerCallback.

class ReceiverClass1 {
public:
void run() {
Expand Down

0 comments on commit 7145653

Please sign in to comment.