OTest2
A C++ testing framework
Public Member Functions | Static Public Member Functions | List of all members
OTest2::RepeaterValue< Value_ > Class Template Reference

Generic repeater for a list of values. More...

#include <repeatervalues.h>

Inheritance diagram for OTest2::RepeaterValue< Value_ >:
Inheritance graph
[legend]
Collaboration diagram for OTest2::RepeaterValue< Value_ >:
Collaboration graph
[legend]

Public Member Functions

 RepeaterValue (const RepeaterValue &)=delete
 
RepeaterValueoperator= (const RepeaterValue &)=delete
 
 RepeaterValue (std::vector< Value_ > &&values_)
 Ctor - initial values. More...
 
 RepeaterValue (std::initializer_list< Value_ > values_)
 Ctor. More...
 
template<typename Container_ >
 RepeaterValue (Container_ &&values_)
 Ctor - initial values. More...
 
template<typename Iter_ >
 RepeaterValue (Iter_ begin_, Iter_ end_)
 Ctor - initial values. More...
 
virtual ~RepeaterValue ()
 Dtor. More...
 
Value_ getValue () const
 Get current value. More...
 
int getIndex () const
 Get current value index. More...
 
virtual bool hasNextRun (const Context &context_) const noexcept
 Check whether there is a next run prepared. More...
 
template<typename Value_ >
std::shared_ptr< RepeaterValue< Value_ > > createNext (const Context &context_, std::shared_ptr< RepeaterValue< Value_ >> &current_, std::vector< Value_ > &&values_)
 
- Public Member Functions inherited from OTest2::Repeater
 Repeater (const Repeater &)=delete
 
Repeateroperator= (const Repeater &)=delete
 
 Repeater ()
 Ctor. More...
 
virtual ~Repeater ()
 Dtor. More...
 

Static Public Member Functions

static std::shared_ptr< RepeaterValuecreateNext (const Context &context_, std::shared_ptr< RepeaterValue > &current_, std::vector< Value_ > &&values_)
 Factory function of particular runs. More...
 
template<typename Container_ >
static std::shared_ptr< RepeaterValuecreateNext (const Context &context_, std::shared_ptr< RepeaterValue > &current_, Container_ &&values_)
 Factory function of particular runs. More...
 
template<typename Iter_ >
static std::shared_ptr< RepeaterValuecreateNext (const Context &context_, std::shared_ptr< RepeaterValue > &current_, Iter_ begin_, Iter_ end_)
 Factory function of particular runs. More...
 

Detailed Description

template<typename Value_>
class OTest2::RepeaterValue< Value_ >

Generic repeater for a list of values.

This repeater repeats the testing object once for each specified value.

Definition at line 36 of file repeatervalues.h.

Constructor & Destructor Documentation

◆ RepeaterValue() [1/5]

template<typename Value_ >
OTest2::RepeaterValue< Value_ >::RepeaterValue ( const RepeaterValue< Value_ > &  )
delete

◆ RepeaterValue() [2/5]

template<typename Value_ >
OTest2::RepeaterValue< Value_ >::RepeaterValue ( std::vector< Value_ > &&  values_)
explicit

Ctor - initial values.

Definition at line 30 of file repeatervaluesimpl.h.

◆ RepeaterValue() [3/5]

template<typename Value_ >
OTest2::RepeaterValue< Value_ >::RepeaterValue ( std::initializer_list< Value_ >  values_)
explicit

Ctor.

Parameters
values_The list of values

◆ RepeaterValue() [4/5]

template<typename Value_ >
template<typename Container_ >
OTest2::RepeaterValue< Value_ >::RepeaterValue ( Container_ &&  values_)
explicit

Ctor - initial values.

◆ RepeaterValue() [5/5]

template<typename Value_ >
template<typename Iter_ >
OTest2::RepeaterValue< Value_ >::RepeaterValue ( Iter_  begin_,
Iter_  end_ 
)

Ctor - initial values.

◆ ~RepeaterValue()

template<typename Value_ >
OTest2::RepeaterValue< Value_ >::~RepeaterValue
virtual

Dtor.

Definition at line 38 of file repeatervaluesimpl.h.

Member Function Documentation

◆ createNext() [1/4]

template<typename Value_ >
template<typename Container_ >
static std::shared_ptr<RepeaterValue> OTest2::RepeaterValue< Value_ >::createNext ( const Context context_,
std::shared_ptr< RepeaterValue< Value_ > > &  current_,
Container_ &&  values_ 
)
inlinestatic

Factory function of particular runs.

Parameters
context_The OTest2 context
current_Current repeater instance
values_Initial values. Any container which can be converted to the std::vector instance.
Returns
New instance of the repeater

Definition at line 119 of file repeatervalues.h.

◆ createNext() [2/4]

template<typename Value_ >
template<typename Iter_ >
static std::shared_ptr<RepeaterValue> OTest2::RepeaterValue< Value_ >::createNext ( const Context context_,
std::shared_ptr< RepeaterValue< Value_ > > &  current_,
Iter_  begin_,
Iter_  end_ 
)
inlinestatic

Factory function of particular runs.

Parameters
context_The OTest2 context
current_Current repeater instance
begin_Begin of the range of initial values
end_End of the range
Returns
New instance of the repeater

Definition at line 139 of file repeatervalues.h.

◆ createNext() [3/4]

template<typename Value_ >
static std::shared_ptr<RepeaterValue> OTest2::RepeaterValue< Value_ >::createNext ( const Context context_,
std::shared_ptr< RepeaterValue< Value_ > > &  current_,
std::vector< Value_ > &&  values_ 
)
static

Factory function of particular runs.

Parameters
context_The OTest2 context
current_Current repeater instance
values_Initial values
Returns
New instance of the repeater

◆ createNext() [4/4]

template<typename Value_ >
template<typename Value_ >
std::shared_ptr<RepeaterValue<Value_> > OTest2::RepeaterValue< Value_ >::createNext ( const Context context_,
std::shared_ptr< RepeaterValue< Value_ >> &  current_,
std::vector< Value_ > &&  values_ 
)

Definition at line 60 of file repeatervaluesimpl.h.

◆ getIndex()

template<typename Value_ >
int OTest2::RepeaterValue< Value_ >::getIndex

Get current value index.

Definition at line 49 of file repeatervaluesimpl.h.

◆ getValue()

template<typename Value_ >
Value_ OTest2::RepeaterValue< Value_ >::getValue

Get current value.

Definition at line 43 of file repeatervaluesimpl.h.

◆ hasNextRun()

template<typename Value_ >
bool OTest2::RepeaterValue< Value_ >::hasNextRun ( const Context context_) const
virtualnoexcept

Check whether there is a next run prepared.

Parameters
context_OTest2 context
Returns
true if there is next run

Implements OTest2::Repeater.

Definition at line 54 of file repeatervaluesimpl.h.

◆ operator=()

template<typename Value_ >
RepeaterValue& OTest2::RepeaterValue< Value_ >::operator= ( const RepeaterValue< Value_ > &  )
delete

The documentation for this class was generated from the following files: