OTest2
A C++ testing framework
|
Go to the documentation of this file.
20 #ifndef OTest2_INCLUDE_OTEST2_OBJECTREPEATERONCEIMPL_H_
21 #define OTest2_INCLUDE_OTEST2_OBJECTREPEATERONCEIMPL_H_
32 template<
typename Object_>
35 std::string section_path;
39 const std::string& decorated_name_,
41 return std::make_shared<Object_>(context_, section_path);
46 const std::string& section_path_) :
47 section_path(section_path_) {
59 template<
typename Object_>
73 const std::string& section_path_)
const {
74 return std::make_shared<ObjectRepeaterOnceRoot<Object_> >(section_path_);
78 template<
typename Parent_,
typename Object_>
85 std::string section_path;
89 const std::string& decorated_name_,
91 auto parent_typed_(std::dynamic_pointer_cast<Parent_>(parent_));
92 assert(parent_typed_ !=
nullptr);
93 return (parent_typed_.get()->*factory_method)(context_, section_path);
99 const std::string& section_path_) :
100 factory_method(factory_method_),
101 section_path(section_path_) {
114 template<
typename Parent_,
typename Object_>
125 factory_method(factory_method_) {
139 const std::string& section_path_)
const {
140 return std::make_shared<ObjectRepeaterOnceNested<Parent_, Object_> >(factory_method, section_path_);
ObjectRepeaterFactoryOnceRoot & operator=(const ObjectRepeaterFactoryOnceRoot &)=delete
std::shared_ptr< ObjectScenario > ObjectScenarioPtr
Shared pointer of a testing object scheduled by the scenario.
ObjectRepeaterOnceNested< Parent_, Object_ >::FactoryMethod FactoryMethod
virtual ~ObjectRepeaterOnceNested()=default
virtual ~ObjectRepeaterOnceRoot()=default
ObjectScenarioPtr(Parent_::* FactoryMethod)(const Context &, const std::string &)
virtual ObjectRepeaterPtr createRepeater(const Context &context_, const std::string §ion_path_) const
Create repeater object.
Object repeater which runs the test just once.
ObjectRepeaterOnceNested(FactoryMethod factory_method_, const std::string §ion_path_)
virtual ~ObjectRepeaterFactoryOnceNested()=default
virtual ~ObjectRepeaterFactoryOnceRoot()=default
std::shared_ptr< Object > ObjectPtr
Shared pointer to a testing object.
ObjectRepeaterFactoryOnceRoot()=default
std::shared_ptr< ObjectRepeater > ObjectRepeaterPtr
Shared pointer of the object repeater objects.
ObjectRepeaterOnceRoot(const std::string §ion_path_)
ObjectRepeaterOnceRoot & operator=(const ObjectRepeaterOnceRoot &)=delete
Factory of object repeater objects.
ObjectRepeaterFactoryOnceNested(FactoryMethod factory_method_)
virtual ObjectRepeaterPtr createRepeater(const Context &context_, const std::string §ion_path_) const
Create repeater object.
ObjectRepeaterOnceNested & operator=(const ObjectRepeaterOnceNested &)=delete
ObjectRepeaterFactoryOnceNested & operator=(const ObjectRepeaterFactoryOnceNested &)=delete