From 83794d060b9ffa30d75aacbc699163a85947439e Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 23 Nov 2012 20:39:42 +0100 Subject: base/time: make get_time static, constructor protected The Time class does not have any state so the get_time method could be static. Because the Time class now has only static methods, deny creation by making the ctor protected. --- src/base/time.hpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/base/time.hpp') diff --git a/src/base/time.hpp b/src/base/time.hpp index 229ac3e1..9e9eac20 100644 --- a/src/base/time.hpp +++ b/src/base/time.hpp @@ -27,11 +27,27 @@ namespace usdx { + /** + * Simple static-only wrapper class to get a time. This time does not need + * to correspond to the real clock. It should only be a changing number, + * that change at the same speed like the real clock. The current + * implementation uses SDL and returns the milliseconds since initialization + * of the library. + */ class Time { - public: + protected: + /** + * Protected constructor. This class currently contains only static + methods. So there should no need to create an instance of it. + */ Time(void); - float get_time(); + + public: + /** + * Returns the current "time" as milliseconds. + */ + static float get_time(); }; }; -- cgit v1.2.3