PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PTimer.h
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: src/devices/PTimer.h
4// Purpose: Primary Timer Event Device.
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2003 Shane T. Mueller <smueller@umich.edu>
7// License: GPL 2
8//
9//
10//
11// This file is part of the PEBL project.
12//
13// PEBL is free software; you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation; either version 2 of the License, or
16// (at your option) any later version.
17//
18// PEBL is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with PEBL; if not, write to the Free Software
25// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27#ifndef __PTIMER_H__
28#define __PTIMER_H__
29
30#include "PDevice.h"
31#include <iostream>
32
33
38
39
40class PTimer: public PDevice
41{
42
43public:
45 PTimer();
46
48 virtual ~PTimer();
49
50 virtual void Wait(unsigned long int msecs) = 0;
51 virtual void Sleep(unsigned long int msecs) = 0; // OS sleep (yields CPU)
52 virtual unsigned long int GetTime() const =0;
53 virtual void GetTimeOfDay(unsigned long & secs, unsigned long & msecs)=0;
54 virtual int GetState(int iface) const=0;
56private:
57
58 //Inheritable printing Method.
59 virtual std::ostream& SendToStream(std::ostream& out)const;
60};
61
62
63
64
65
66#endif
PEBL_DEVICE_TYPE
Definition PDevice.h:40
@ PDT_TIMER
Definition PDevice.h:48
virtual void GetTimeOfDay(unsigned long &secs, unsigned long &msecs)=0
virtual void Wait(unsigned long int msecs)=0
PTimer()
The Standard constructor.
Definition PTimer.cpp:35
virtual void Sleep(unsigned long int msecs)=0
virtual int GetState(int iface) const =0
virtual PEBL_DEVICE_TYPE GetDeviceType()
Definition PTimer.h:55
virtual unsigned long int GetTime() const =0
virtual ~PTimer()
The Standard destructor.
Definition PTimer.cpp:41