OTest2
A C++ testing framework
Classes | Public Member Functions | Protected Member Functions | List of all members
OTest2::StateGenerated Class Referenceabstract

Common implementation of generated states. More...

#include <stategenerated.h>

Inheritance diagram for OTest2::StateGenerated:
Inheritance graph
[legend]
Collaboration diagram for OTest2::StateGenerated:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Member Functions

 StateGenerated (const StateGenerated &)=delete
 
StateGeneratedoperator= (const StateGenerated &)=delete
 
 StateGenerated (const Context &context_, const std::string &name_, const std::string &section_path_)
 Ctor. More...
 
virtual ~StateGenerated ()
 Dtor. More...
 
virtual std::string getName () const
 Get object's name. More...
 
virtual void executeState (const Context &context_, CaseOrdinaryPtr parent_)
 Run the state. More...
 
virtual const Contextotest2Context () const
 Get the OTest2 context. More...
 
- Public Member Functions inherited from OTest2::StateOrdinary
 StateOrdinary (const StateOrdinary &)=delete
 
StateOrdinaryoperator= (const StateOrdinary &)=delete
 
 StateOrdinary (const Context &context_)
 Ctor. More...
 
virtual ~StateOrdinary ()
 Dtor. More...
 
virtual void scheduleRun (const Context &context_, CaseOrdinaryPtr parent_, StatePtr this_ptr_, bool wait_, int delay_)
 Schedule run of the state. More...
 
- Public Member Functions inherited from OTest2::State
 State ()
 Ctor. More...
 
virtual ~State ()
 Dtor. More...
 
 State (const State &)=delete
 
Stateoperator= (const State &)=delete
 
- Public Member Functions inherited from OTest2::Object
 Object (const Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object ()
 Ctor. More...
 
virtual ~Object ()
 Dtor. More...
 
- Public Member Functions inherited from OTest2::ContextObject
 ContextObject (const ContextObject &)=delete
 
ContextObjectoperator= (const ContextObject &)=delete
 
 ContextObject ()
 Ctor. More...
 
virtual ~ContextObject ()
 Dtor. More...
 

Protected Member Functions

void switchState (const Context &context_, const std::string &name_, int delay_)
 Switch test states. More...
 
bool isTestSectionActive (const Context &context_, const std::string &section_path_)
 Check whether a test section is active. More...
 

Detailed Description

Common implementation of generated states.

Definition at line 35 of file stategenerated.h.

Constructor & Destructor Documentation

◆ StateGenerated() [1/2]

OTest2::StateGenerated::StateGenerated ( const StateGenerated )
delete

◆ StateGenerated() [2/2]

OTest2::StateGenerated::StateGenerated ( const Context context_,
const std::string &  name_,
const std::string &  section_path_ 
)
explicit

Ctor.

Parameters
context_OTest2 context
name_Name of the state
section_path_Path of active section. Empty string means all sections are active.

Definition at line 76 of file stategenerated.cpp.

◆ ~StateGenerated()

OTest2::StateGenerated::~StateGenerated ( )
virtual

Dtor.

Definition at line 85 of file stategenerated.cpp.

Member Function Documentation

◆ executeState()

void OTest2::StateGenerated::executeState ( const Context context_,
CaseOrdinaryPtr  parent_ 
)
virtual

Run the state.

Parameters
context_The OTest2 context
parent_State's parent object

Implements OTest2::StateOrdinary.

Definition at line 93 of file stategenerated.cpp.

◆ getName()

std::string OTest2::StateGenerated::getName ( ) const
virtual

Get object's name.

Implements OTest2::Object.

Definition at line 89 of file stategenerated.cpp.

◆ isTestSectionActive()

bool OTest2::StateGenerated::isTestSectionActive ( const Context context_,
const std::string &  section_path_ 
)
protected

Check whether a test section is active.

Parameters
context_The OTest2 context
section_path_Absolute section path based on the test case
Returns
True if the section is active

Definition at line 120 of file stategenerated.cpp.

◆ operator=()

StateGenerated& OTest2::StateGenerated::operator= ( const StateGenerated )
delete

◆ otest2Context()

const Context & OTest2::StateGenerated::otest2Context ( ) const
virtual

Get the OTest2 context.

Implements OTest2::ContextObject.

Definition at line 105 of file stategenerated.cpp.

◆ switchState()

void OTest2::StateGenerated::switchState ( const Context context_,
const std::string &  name_,
int  delay_ 
)
protected

Switch test states.

The method sets specified state to be run after leaving of current state.

Parameters
context_The OTest2 context
name_Name of the next state
delay_Delay of running of the next state in milliseconds

Definition at line 109 of file stategenerated.cpp.


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