aboutsummaryrefslogtreecommitdiffstats
path: root/src/timer/timer.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-21 16:55:57 +0000
committerlloyd <[email protected]>2008-11-21 16:55:57 +0000
commit4db9d2279629408a9df94b887a65c6aabcefeb6f (patch)
treecb1b3979ab2a1d7e4f9fc1b30dac43b87059b707 /src/timer/timer.h
parent8c885d8fca72e46a27f3f86f3645c780d34596b8 (diff)
Make Timer a pure virtual interface and add a new subclass ANSI_Clock_Timer
which uses the ANSI/ISO clock function (previously this had been the Timer::clock default implementation).
Diffstat (limited to 'src/timer/timer.h')
-rw-r--r--src/timer/timer.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/timer/timer.h b/src/timer/timer.h
index 9aa95f261..dfa04ee3a 100644
--- a/src/timer/timer.h
+++ b/src/timer/timer.h
@@ -1,7 +1,7 @@
-/*************************************************
-* Timestamp Functions Header File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/**
+* Timestamp Functions Header File
+* (C) 1999-2008 Jack Lloyd
+*/
#ifndef BOTAN_TIMERS_H__
#define BOTAN_TIMERS_H__
@@ -10,23 +10,31 @@
namespace Botan {
-/*************************************************
-* Timer Interface *
-*************************************************/
+/**
+* Timer Interface
+*/
class BOTAN_DLL Timer : public EntropySource
{
public:
- virtual u64bit clock() const;
+ virtual u64bit clock() const = 0;
u32bit slow_poll(byte[], u32bit);
u32bit fast_poll(byte[], u32bit);
- std::string name() const { return "ANSI clock"; }
-
virtual ~Timer() {}
protected:
static u64bit combine_timers(u32bit, u32bit, u32bit);
};
+/**
+* ANSI Clock Timer
+*/
+class BOTAN_DLL ANSI_Clock_Timer : public Timer
+ {
+ public:
+ std::string name() const { return "ANSI clock"; }
+ u64bit clock() const;
+ };
+
}
#endif