/* * Author: Patrick-Christopher Mattulat * Company: Lynar Studios * E-Mail: webmaster@lynarstudios.com * Created: 2020-09-16 * Changed: 2022-05-15 * * */ #include "TestDataFactory.hpp" ls::std::logic::StateMachine ls_std_logic_test::TestDataFactory::createStateMachine() { ls::std::logic::StateMachine stateMachine{"test_machine"}; std::shared_ptr stateA = std::make_shared("A"); std::shared_ptr stateB = std::make_shared("B"); std::shared_ptr stateC = std::make_shared("C"); std::shared_ptr stateD = std::make_shared("D"); std::shared_ptr stateE = std::make_shared("E"); // add states stateMachine.addState(stateA); stateMachine.addState(stateB); stateMachine.addState(stateC); stateMachine.addState(stateD); stateMachine.addState(stateE); // add connections / see state_machine_test.png stateA->addStateConnection("AB", stateB); stateB->addStateConnection("BC", stateC); stateB->addStateConnection("BD", stateD); stateC->addStateConnection("CB", stateB); stateC->addStateConnection("CE", stateE); stateD->addStateConnection("DE", stateE); return stateMachine; }