~ubuntu-branches/ubuntu/karmic/brutalchess/karmic

« back to all changes in this revision

Viewing changes to timerchain.h

  • Committer: Bazaar Package Importer
  • Author(s): Gürkan Sengün
  • Date: 2006-04-07 10:41:25 UTC
  • Revision ID: james.westby@ubuntu.com-20060407104125-18mnxbl1yzju7e84
Tags: upstream-0.0.20060314cvs
Import upstream version 0.0.20060314cvs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// timerchain.h
 
2
// TimerChain
 
3
// String of multiple timers
 
4
// by Joe Flint
 
5
 
 
6
/***************************************************************************
 
7
 *                                                                         *
 
8
 *   This program is free software; you can redistribute it and/or modify  *
 
9
 *   it under the terms of the GNU General Public License as published by  *
 
10
 *   the Free Software Foundation; either version 2 of the License, or     *
 
11
 *   (at your option) any later version.                                   *
 
12
 *                                                                         *
 
13
 ***************************************************************************/
 
14
 
 
15
#ifndef _TIMERCHAIN_H
 
16
#define _TIMERCHAIN_H
 
17
 
 
18
#include <vector>
 
19
#include "timer.h"
 
20
 
 
21
using namespace std;
 
22
 
 
23
/** String of multiple timers
 
24
 *  Runs several timers, one after another.
 
25
 */
 
26
class TimerChain
 
27
{
 
28
        public:
 
29
                TimerChain();
 
30
 
 
31
                void add( const Timer & t );
 
32
                void clear();
 
33
                
 
34
                void start();
 
35
                bool started() const;   
 
36
                void stop();
 
37
                bool done();
 
38
                void resetDone();
 
39
                void update();
 
40
                void operator++(int);
 
41
                
 
42
                double change() const;
 
43
                double value() const;
 
44
 
 
45
        protected:
 
46
                double val, lastval;
 
47
                bool starton, doneon;
 
48
                vector< Timer > timers;
 
49
                unsigned int curtimer;
 
50
                
 
51
};
 
52
#endif