/usr/include/pbcopper/utility/CallbackTimer.h is in libpbcopper-dev 0.0.1+20161202-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | #ifndef PBCOPPER_UTILITY_CALLBACKTIMER_H
#define PBCOPPER_UTILITY_CALLBACKTIMER_H
#include "pbcopper/Config.h"
#include <functional>
#include <memory>
namespace PacBio {
namespace Utility {
namespace internal { class CallbackTimerPrivate; }
/// \brief The CallbackTimer class provides repetitive and single-shot timers
/// for scheduling asynchronous tasks.
///
/// This class is used to schedule one or more callbacks to fire at some point
/// number of milliseconds in the future, and optionally fire again every so
/// many milliseconds.
///
/// As it stands, the callback function must be of the signature:
///
/// void foo(void);
///
/// whether a free function, member function, or lambda.
///
class CallbackTimer
{
public:
typedef uint64_t JobId;
typedef std::function<void()> HandlerFn;
public:
static void SingleShot(uint64_t when, const HandlerFn& handler);
static void SingleShot(uint64_t when, HandlerFn&& handler);
public:
CallbackTimer(void);
~CallbackTimer(void);
public:
JobId Schedule(const uint64_t when,
const uint64_t period,
const HandlerFn& handler);
JobId Schedule(const uint64_t when,
const uint64_t period,
HandlerFn&& handler);
public:
bool Cancel(const JobId id);
bool IsActive(const JobId id);
private:
std::unique_ptr<internal::CallbackTimerPrivate> d_;
};
} // namespace Utility
} // namespace PacBio
#include "internal/CallbackTimer-inl.h"
#endif // PBCOPPER_UTILITY_CALLBACKTIMER_H
|