2015-10-15 13:09:21 +02:00
|
|
|
#pragma once
|
|
|
|
#ifndef MESSMER_BLOCKSTORE_IMPLEMENTATIONS_CACHING_CACHE_PERIODICTASK_H_
|
|
|
|
#define MESSMER_BLOCKSTORE_IMPLEMENTATIONS_CACHING_CACHE_PERIODICTASK_H_
|
2015-04-18 16:50:19 +02:00
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <boost/thread.hpp>
|
|
|
|
|
|
|
|
namespace blockstore {
|
|
|
|
namespace caching {
|
|
|
|
|
|
|
|
class PeriodicTask {
|
|
|
|
public:
|
|
|
|
PeriodicTask(std::function<void ()> task, double intervalSec);
|
|
|
|
virtual ~PeriodicTask();
|
|
|
|
|
|
|
|
private:
|
|
|
|
boost::thread _thread;
|
|
|
|
std::function<void ()> _task;
|
|
|
|
double _intervalSec;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|