OTest2
A C++ testing framework
cmdstartupobject.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 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 OTest2_INCLUDE_OTEST2_CMDSTARTUPOBJECT_H_
21 #define OTest2_INCLUDE_OTEST2_CMDSTARTUPOBJECT_H_
22 
23 #include <otest2/command.h>
24 #include <otest2/objectptr.h>
26 #include <otest2/scenarioptr.h>
27 
28 namespace OTest2 {
29 
33 class CmdStartUpObject : public Command {
34  private:
35  ObjectScenarioPtr object;
36  ScenarioPtr scenario;
37  ObjectPtr parent;
38  int index;
39 
40  public:
50  explicit CmdStartUpObject(
51  ObjectScenarioPtr object_,
52  ScenarioPtr scenario_,
53  ObjectPtr parent_,
54  int index_);
55 
59  virtual ~CmdStartUpObject();
60 
61  /* -- avoid copying */
63  const CmdStartUpObject&) = delete;
65  const CmdStartUpObject&) = delete;
66 
67  /* -- command interface */
68  virtual void run(
69  const Context& context_) override;
70 };
71 
72 } /* -- namespace OTest2 */
73 
74 #endif /* -- OTest2_INCLUDE_OTEST2_CMDSTARTUPOBJECT_H_ */
OTest2::CmdStartUpObject::operator=
CmdStartUpObject & operator=(const CmdStartUpObject &)=delete
OTest2::CmdStartUpObject::~CmdStartUpObject
virtual ~CmdStartUpObject()
Dtor.
Definition: cmdstartupobject.cpp:46
OTest2::ObjectScenarioPtr
std::shared_ptr< ObjectScenario > ObjectScenarioPtr
Shared pointer of a testing object scheduled by the scenario.
Definition: objectscenarioptr.h:27
objectptr.h
OTest2::CmdStartUpObject
Start a testing object up.
Definition: cmdstartupobject.h:33
command.h
objectscenarioptr.h
OTest2::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Shared pointer to a testing object.
Definition: objectptr.h:27
OTest2
Definition: assertbean.h:25
OTest2::ScenarioPtr
std::shared_ptr< Scenario > ScenarioPtr
Shared pointer of the scenario object.
Definition: scenarioptr.h:27
OTest2::Command
generic command interface
Definition: command.h:30
OTest2::Context
OTest2 runtime context.
Definition: context.h:38
OTest2::CmdStartUpObject::CmdStartUpObject
CmdStartUpObject(ObjectScenarioPtr object_, ScenarioPtr scenario_, ObjectPtr parent_, int index_)
Ctor.
Definition: cmdstartupobject.cpp:34
OTest2::CmdStartUpObject::run
virtual void run(const Context &context_) override
Run the command.
Definition: cmdstartupobject.cpp:50
scenarioptr.h