version 0.5.0_alpha
git-svn-id: svn://db.shs.com.ru/pip@8 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Timer
|
||||
Copyright (C) 2014 Ivan Pelipenko peri4ko@gmail.com
|
||||
Copyright (C) 2015 Ivan Pelipenko peri4ko@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -54,8 +54,11 @@ public:
|
||||
|
||||
bool stop();
|
||||
|
||||
protected:
|
||||
typedef void(*TickFunc)(PITimer*);
|
||||
TickFunc tfunc;
|
||||
PITimer * parent;
|
||||
|
||||
protected:
|
||||
|
||||
virtual bool startTimer(double interval_ms) = 0;
|
||||
virtual bool stopTimer() = 0;
|
||||
@@ -64,8 +67,6 @@ protected:
|
||||
bool deferred_, deferred_mode; // mode: true - date, false - delay
|
||||
volatile bool running_;
|
||||
PIDateTime deferred_datetime;
|
||||
PITimer * parent;
|
||||
TickFunc tfunc;
|
||||
};
|
||||
|
||||
|
||||
@@ -90,20 +91,18 @@ private:
|
||||
|
||||
|
||||
#ifdef PIP_TIMER_RT
|
||||
struct _PITimerImp_RT_Private_;
|
||||
class _PITimerImp_RT: public _PITimerBase {
|
||||
public:
|
||||
_PITimerImp_RT();
|
||||
virtual ~_PITimerImp_RT() {stop();}
|
||||
virtual ~_PITimerImp_RT();
|
||||
protected:
|
||||
private:
|
||||
virtual bool startTimer(double interval_ms);
|
||||
virtual bool stopTimer();
|
||||
static void threadFuncS(sigval sv) {((_PITimerImp_RT * )sv.sival_ptr)->tfunc(((_PITimerImp_RT * )sv.sival_ptr)->parent);}
|
||||
|
||||
int ti;
|
||||
itimerspec spec;
|
||||
timer_t tt;
|
||||
sigevent se;
|
||||
_PITimerImp_RT_Private_ * priv;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -259,7 +258,7 @@ public:
|
||||
* \brief Start timer with \b interval_msecs loop delay after \b start_datetime date and time.
|
||||
* \details Timer wait until \b start_datetime and then normally starts with
|
||||
* \b interval_msecs loop delay. */
|
||||
|
||||
|
||||
//! \fn void clearDelimiters()
|
||||
//! \brief Remove all frequency delimiters
|
||||
|
||||
|
||||
Reference in New Issue
Block a user