ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/vendor/pxys2-2.1.0/pxyscand/src/PXRepeater.cc
Revision: 3253
Committed: Wed Apr 2 20:46:18 2014 UTC (10 years ago) by michael
Content type: text/x-c++src
File size: 1422 byte(s)
Log Message:
- Imported pxys2-2.1.0

File Contents

# Content
1 // Copyright (C) 2003 Stephane Thiell
2 //
3 // This file is part of pxyscand (from pxys)
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 //
19 #define RCSID "$Id: PXRepeater.cc,v 1.2 2004/01/10 14:32:29 mbuna Exp $"
20
21 #include "PXRepeater.h"
22
23 PXRepeater::PXRepeater(int inInterval)
24 {
25 mRepeaterTimer = peak_timer_create(inInterval, inInterval, TimerCallback,
26 this);
27 peak_task_timer_add(peak_task_self(), mRepeaterTimer);
28 }
29
30 PXRepeater::~PXRepeater()
31 {
32 peak_task_timer_remove(peak_task_self(), mRepeaterTimer);
33 peak_release(mRepeaterTimer);
34 }
35
36 void
37 PXRepeater::TimerCallback(peak_timer t, void *context)
38 {
39 PXRepeater *repeater = reinterpret_cast<PXRepeater*>(context);
40
41 repeater->RepeaterFire();
42 }