OTest2
A C++ testing framework
cmdrepeatobject.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_CMDREPEATOBJECT_H_
21 #define OTest2_INCLUDE_OTEST2_CMDREPEATOBJECT_H_
22 
23 #include <string>
24 
25 #include <otest2/command.h>
26 #include <otest2/objectptr.h>
28 #include <otest2/scenarioptr.h>
29 
30 namespace OTest2 {
31 
35 class CmdRepeatObject : public Command {
36  private:
37  ScenarioPtr scenario;
38  ObjectRepeaterPtr repeater;
39  std::string name;
40  ObjectPtr parent;
41 
42  public:
51  explicit CmdRepeatObject(
52  ScenarioPtr scenarion_,
53  ObjectRepeaterPtr repeater_,
54  const std::string& name_,
55  ObjectPtr parent_);
56 
60  virtual ~CmdRepeatObject();
61 
62  /* -- avoid copying */
64  const CmdRepeatObject&) = delete;
66  const CmdRepeatObject&) = delete;
67 
68  /* -- command interface */
69  virtual void run(
70  const Context& context_) override;
71 };
72 
73 } /* -- namespace OTest2 */
74 
75 #endif /* -- OTest2_INCLUDE_OTEST2_CMDREPEATOBJECT_H_ */
objectrepeaterptr.h
objectptr.h
OTest2::CmdRepeatObject::~CmdRepeatObject
virtual ~CmdRepeatObject()
Dtor.
Definition: cmdrepeatobject.cpp:49
OTest2::CmdRepeatObject::CmdRepeatObject
CmdRepeatObject(ScenarioPtr scenarion_, ObjectRepeaterPtr repeater_, const std::string &name_, ObjectPtr parent_)
Ctor.
Definition: cmdrepeatobject.cpp:36
command.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::ObjectRepeaterPtr
std::shared_ptr< ObjectRepeater > ObjectRepeaterPtr
Shared pointer of the object repeater objects.
Definition: objectrepeaterptr.h:27
OTest2::Command
generic command interface
Definition: command.h:30
OTest2::Context
OTest2 runtime context.
Definition: context.h:38
OTest2::CmdRepeatObject::run
virtual void run(const Context &context_) override
Run the command.
Definition: cmdrepeatobject.cpp:53
OTest2::CmdRepeatObject
Schedule repeated run of testing object.
Definition: cmdrepeatobject.h:35
OTest2::CmdRepeatObject::operator=
CmdRepeatObject & operator=(const CmdRepeatObject &)=delete
scenarioptr.h