ANNA Suite  2020b
Multipurpose development suite for Telco applications
TestTimer.hpp
Go to the documentation of this file.
1 // ANNA - Anna is Not Nothingness Anymore //
2 // //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
4 // //
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 //
7 
8 
9 #ifndef anna_testing_TestTimer_hpp
10 #define anna_testing_TestTimer_hpp
11 
13 #include <anna/core/Allocator.hpp>
15 
16 
17 namespace anna {
18 
19 namespace testing {
20 
21 
22 class TestStep;
23 
24 
26 
27 public:
28 
29  struct Type { enum _v { TimeLeft, Delay }; };
30  static const char* asText(const Type::_v type) ;
31 
32 
33  TestStep* getTestCaseStep() { return reinterpret_cast <TestStep*>(getContext()); }
34  const TestStep* getTestCaseStep() const { return reinterpret_cast <const TestStep*>(getContext()); }
35 
36  void setType(const Type::_v type) { a_type = type; }
37  const Type::_v &getType(const Type::_v type) const { return a_type; }
38 
39  std::string asString() const ;
40 
41 private:
42  Type::_v a_type;
43 
44  TestTimer() {;}
45 
46  void expire(anna::timex::Engine*) noexcept(false);
47 
48  friend class anna::Allocator<TestTimer>;
49 };
50 
51 }
52 }
53 
54 #endif
55 
Definition: TestTimer.hpp:29
Definition: Transaction.hpp:34
Definition: TestTimer.hpp:25
Definition: Allocator.hpp:19
void * getContext()
Definition: Transaction.hpp:66
std::string asString() const
const Type::_v & getType(const Type::_v type) const
Definition: TestTimer.hpp:37
Definition: app.hpp:12
static const char * asText(const Type::_v type)
Definition: TestTimer.hpp:29
Definition: TestStep.hpp:46
Definition: Engine.hpp:62
const TestStep * getTestCaseStep() const
Definition: TestTimer.hpp:34
Definition: TestTimer.hpp:29
_v
Definition: TestTimer.hpp:29
void setType(const Type::_v type)
Definition: TestTimer.hpp:36
TestStep * getTestCaseStep()
Definition: TestTimer.hpp:33