1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef anna_testing_TestTimer_hpp
10 #define anna_testing_TestTimer_hpp
12 #include <anna/core/RuntimeException.hpp>
13 #include <anna/core/Allocator.hpp>
14 #include <anna/timex/Transaction.hpp>
25 class TestTimer : public anna::timex::Transaction {
29 struct Type { enum _v { TimeLeft, Delay }; };
30 static const char* asText(const Type::_v type) throw();
33 TestStep* getTestCaseStep() throw() { return reinterpret_cast <TestStep*>(getContext()); }
34 const TestStep* getTestCaseStep() const throw() { return reinterpret_cast <const TestStep*>(getContext()); }
36 void setType(const Type::_v type) throw() { a_type = type; }
37 const Type::_v &getType(const Type::_v type) const throw() { return a_type; }
39 std::string asString() const throw();
46 void expire(anna::timex::Engine*) throw(anna::RuntimeException);
48 friend class anna::Allocator<TestTimer>;