OTest2
A C++ testing framework
state.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Ondrej Starek
3  *
4  * This file is part of OTest2.
5  *
6  * OTest2 is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License,
9  * or (at your option) any later version.
10  *
11  * OTest2 is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with OTest2. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OTest2INCLUDE_STATE_H_
21 #define OTest2INCLUDE_STATE_H_
22 
23 #include <otest2/caseordinaryptr.h>
24 #include <otest2/object.h>
25 #include <otest2/stateptr.h>
26 
27 namespace OTest2 {
28 
29 class Context;
30 
34 class State : public Object {
35  public:
39  State();
40 
44  virtual ~State();
45 
46  /* -- avoid copying */
47  State(
48  const State&) = delete;
50  const State&) = delete;
51 
62  virtual void scheduleRun(
63  const Context& context_,
64  CaseOrdinaryPtr parent_,
65  StatePtr this_ptr_,
66  bool delay_cmd_,
67  int delay_) = 0;
68 };
69 
70 } /* -- namespace OTest2 */
71 
72 #endif /* -- OTest2INCLUDE_STATE_H_ */
caseordinaryptr.h
OTest2::Object
Generic testing object.
Definition: object.h:32
OTest2::State::scheduleRun
virtual void scheduleRun(const Context &context_, CaseOrdinaryPtr parent_, StatePtr this_ptr_, bool delay_cmd_, int delay_)=0
Schedule run of the state.
OTest2::CaseOrdinaryPtr
std::shared_ptr< CaseOrdinary > CaseOrdinaryPtr
Shared pointer of the ordinary cases.
Definition: caseordinaryptr.h:27
OTest2
Definition: assertbean.h:25
OTest2::State::operator=
State & operator=(const State &)=delete
OTest2::State
Generic test state interface.
Definition: state.h:34
OTest2::StatePtr
std::shared_ptr< State > StatePtr
Pointer to test state objects.
Definition: stateptr.h:27
OTest2::State::~State
virtual ~State()
Dtor.
Definition: state.cpp:28
stateptr.h
OTest2::Context
OTest2 runtime context.
Definition: context.h:38
OTest2::State::State
State()
Ctor.
Definition: state.cpp:24
object.h