X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2FTimeout.C;h=7ef659b3d9482d6e2c5411cb61639e41791b0ff7;hb=31334d39348282d4586eb82b9bb5e91f03018542;hp=e8d7fbae83e9cfb84572c236e52f302d2ab47714;hpb=1eb8155fa0d2253d9504a8d660cb3d666c1224f6;p=lyx.git diff --git a/src/frontends/Timeout.C b/src/frontends/Timeout.C index e8d7fbae83..7ef659b3d9 100644 --- a/src/frontends/Timeout.C +++ b/src/frontends/Timeout.C @@ -1,37 +1,25 @@ /** - * \file Timeout.C - * Copyright 2001 LyX Team + * \file Timeout.cpp * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * * \author Lars Gullik Bjønnes * \author John Levon * - * Full author contact details are available in file CREDITS + * Full author contact details are available in file CREDITS. */ -#ifdef __GNUG__ -#pragma implementation -#endif #include #include "Timeout.h" -#include "debug.h" -#include "Timeout_pimpl.h" - -Timeout::Timeout(unsigned int msec, Type t) - : type(t), timeout_ms(msec) -{ - pimpl_ = new Pimpl(this); -} +namespace lyx { Timeout::~Timeout() { pimpl_->stop(); - delete pimpl_; } @@ -46,17 +34,20 @@ void Timeout::start() pimpl_->start(); } + void Timeout::stop() { pimpl_->stop(); } + void Timeout::restart() { pimpl_->stop(); pimpl_->start(); } + void Timeout::emit() { pimpl_->reset(); @@ -65,6 +56,7 @@ void Timeout::emit() pimpl_->start(); } + Timeout & Timeout::setType(Type t) { type = t; @@ -74,6 +66,12 @@ Timeout & Timeout::setType(Type t) Timeout & Timeout::setTimeout(unsigned int msec) { + // Can't have a timeout of zero! + BOOST_ASSERT(msec); + timeout_ms = msec; return * this; } + + +} // namespace lyx