OTest2
A C++ testing framework
objectrepeater.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_OBJECTREPEATER_H_
21 #define OTest2_INCLUDE_OTEST2_OBJECTREPEATER_H_
22 
23 #include <string>
24 
25 #include <otest2/objectptr.h>
28 
29 namespace OTest2 {
30 
31 class Context;
32 class ObjectPath;
33 
39  public:
44 
48  virtual ~ObjectRepeater();
49 
50  /* -- avoid copying */
52  const ObjectRepeater&) = delete;
54  const ObjectRepeater&) = delete;
55 
62  virtual bool hasNextRun(
63  const Context& context_) const = 0;
64 
75  virtual void modifyObjectPath(
76  const Context& context_,
77  ObjectPath& path_) const = 0;
78 
89  const Context& context_,
90  const std::string& name_,
91  ObjectPtr parent_) = 0;
92 };
93 
94 } /* -- namespace OTest2 */
95 
96 #endif /* -- OTest2_INCLUDE_OTEST2_OBJECTREPEATER_H_ */
OTest2::ObjectRepeater
Generic interface of a repeater of a testing object (this repeater is not a part of the OTest2 API)
Definition: objectrepeater.h:38
objectrepeaterptr.h
OTest2::ObjectScenarioPtr
std::shared_ptr< ObjectScenario > ObjectScenarioPtr
Shared pointer of a testing object scheduled by the scenario.
Definition: objectscenarioptr.h:27
OTest2::ObjectPath
This is a simple object keeping path to current testing object.
Definition: objectpath.h:32
objectptr.h
OTest2::ObjectRepeater::createObject
virtual ObjectScenarioPtr createObject(const Context &context_, const std::string &name_, ObjectPtr parent_)=0
Create the testing object.
OTest2::ObjectRepeater::~ObjectRepeater
virtual ~ObjectRepeater()
Dtor.
Definition: objectrepeater.cpp:28
OTest2::ObjectRepeater::ObjectRepeater
ObjectRepeater()
Ctor.
Definition: objectrepeater.cpp:24
OTest2::ObjectRepeater::modifyObjectPath
virtual void modifyObjectPath(const Context &context_, ObjectPath &path_) const =0
Change current object path.
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::ObjectRepeater::operator=
ObjectRepeater & operator=(const ObjectRepeater &)=delete
OTest2::Context
OTest2 runtime context.
Definition: context.h:38
OTest2::ObjectRepeater::hasNextRun
virtual bool hasNextRun(const Context &context_) const =0
Check whether next run of the object is planned.