Skip to content

File evaHeartbeat.h

File List > src > evaHeartbeat.h

Go to the documentation of this file

#pragma once
#include <evaTickable.h>

namespace eva
{
    class Heartbeat : public Tickable
    {
    private:
        const unsigned long periodMs;
        unsigned long lastBeatMs;

    protected:
        virtual void onHeartbeat() = 0;

    public:
        Heartbeat(unsigned long periodMs);

        virtual ~Heartbeat() = default;

        void tick() override;

        unsigned long getPeriod() const;
    };

}