Skip to main content

include/sleepy_discord/timer.h

Namespaces​

Name
SleepyDiscord

Classes​

Name
structSleepyDiscord::Timer

Types​

Name
typedef std::function< void()>TimedTask

Types Documentation​

typedef TimedTask​

typedef std::function<void()> SleepyDiscord::TimedTask;

Source code​

#pragma once
#include <functional>

namespace SleepyDiscord {
typedef std::function<void()> TimedTask;

struct Timer {
public:
typedef std::function<void()> StopTimerFunction;
Timer() {}
Timer(StopTimerFunction stopTimer) :
implStop(stopTimer) {}
inline void stop() { implStop(); implStop = nullptr; }
inline bool isValid() const { return implStop != nullptr; }
private:
StopTimerFunction implStop;
};
}

Updated on 13 April 2022 at 18:39:59 UTC