#include <config.h>
#include "Timeout.h"
-#include "debug.h"
+#include "support/LAssert.h"
-#include "Timeout_pimpl.h"
-
-
-Timeout::Timeout(unsigned int msec, Type t)
- : type(t), timeout_ms(msec)
-{
- pimpl_ = new Pimpl(this);
-}
+using namespace lyx::support;
Timeout::~Timeout()
{
pimpl_->stop();
- delete pimpl_;
}
pimpl_->start();
}
+
void Timeout::stop()
{
pimpl_->stop();
}
+
void Timeout::restart()
{
pimpl_->stop();
pimpl_->start();
}
+
void Timeout::emit()
{
pimpl_->reset();
pimpl_->start();
}
+
Timeout & Timeout::setType(Type t)
{
type = t;
Timeout & Timeout::setTimeout(unsigned int msec)
{
+ // Can't have a timeout of zero!
+ Assert(msec);
+
timeout_ms = msec;
return * this;
}