|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Google Mock implementation of ICyclicController. More...
#include <mockCyclicController.h>
Inheritance diagram for profinet::cyclic::MockCyclicController:
Collaboration diagram for profinet::cyclic::MockCyclicController:Public Member Functions | |
| MockCyclicController ()=default | |
| Constructs a mock cyclic controller. | |
| ~MockCyclicController () override=default | |
| Destroys the mock cyclic controller. | |
| MOCK_METHOD (void, Start,(std::unique_ptr< IRawEthernetSocket >, std::unique_ptr< IRawEthernetSocket >),(override)) | |
| Mocks the Start() operation. | |
| MOCK_METHOD (void, Stop,(),(override)) | |
| Mocks the Stop() operation. | |
| MOCK_METHOD (bool, IsRunning,(),(const, override)) | |
| Mocks the IsRunning() check. | |
| MOCK_METHOD (CyclicState, State,(),(const, override)) | |
| Mocks the State() retrieval functionality. | |
| MOCK_METHOD (void, SetOutputData,(int, int, const Bytes &),(override)) | |
| Mocks the State() retrieval functionality. | |
| MOCK_METHOD (Bytes, GetOutputData,(int, int),(const, override)) | |
| Mocks the State() retrieval functionality. | |
| MOCK_METHOD (std::optional< Bytes >, GetInputData,(int, int, bool),(const, override)) | |
| Mocks the State() retrieval functionality. | |
Public Member Functions inherited from profinet::cyclic::ICyclicController | |
| virtual | ~ICyclicController ()=default |
| Virtual destructor. | |
| virtual void | Start (std::unique_ptr< IRawEthernetSocket > tx=nullptr, std::unique_ptr< IRawEthernetSocket > rx=nullptr)=0 |
| Starts cyclic PROFINET communication. | |
| virtual void | Stop ()=0 |
| Stops cyclic PROFINET communication. | |
| virtual bool | IsRunning () const =0 |
| Whether the controller is actively exchanging cyclic data. | |
| virtual CyclicState | State () const =0 |
| The controller's current lifecycle state. | |
| virtual void | SetOutputData (int slot, int subslot, const Bytes &data)=0 |
| Set complete process output data for one slot/subslot. | |
| virtual Bytes | GetOutputData (int slot, int subslot) const =0 |
| Read the currently configured output data for one slot/subslot. | |
| virtual std::optional< Bytes > | GetInputData (int slot, int subslot, bool allowBad=false) const =0 |
| Get the latest valid input process data. | |
Google Mock implementation of ICyclicController.
Allows unit tests to configure and verify calls to the cyclic controller Start() and Stop() operations. The mock does not create network resources or exchange cyclic IO data.
Definition at line 24 of file mockCyclicController.h.
|
default |
Constructs a mock cyclic controller.
|
overridedefault |
Destroys the mock cyclic controller.
| profinet::cyclic::MockCyclicController::MOCK_METHOD | ( | bool | , |
| IsRunning | , | ||
| () | , | ||
| (const, override) | |||
| ) |
Mocks the IsRunning() check.
| profinet::cyclic::MockCyclicController::MOCK_METHOD | ( | Bytes | , |
| GetOutputData | , | ||
| (int, int) | , | ||
| (const, override) | |||
| ) |
Mocks the State() retrieval functionality.
| profinet::cyclic::MockCyclicController::MOCK_METHOD | ( | CyclicState | , |
| State | , | ||
| () | , | ||
| (const, override) | |||
| ) |
Mocks the State() retrieval functionality.
| profinet::cyclic::MockCyclicController::MOCK_METHOD | ( | std::optional< Bytes > | , |
| GetInputData | , | ||
| (int, int, bool) | , | ||
| (const, override) | |||
| ) |
Mocks the State() retrieval functionality.
| profinet::cyclic::MockCyclicController::MOCK_METHOD | ( | void | , |
| SetOutputData | , | ||
| (int, int, const Bytes &) | , | ||
| (override) | |||
| ) |
Mocks the State() retrieval functionality.
| profinet::cyclic::MockCyclicController::MOCK_METHOD | ( | void | , |
| Start | , | ||
| (std::unique_ptr< IRawEthernetSocket >, std::unique_ptr< IRawEthernetSocket >) | , | ||
| (override) | |||
| ) |
Mocks the Start() operation.
| profinet::cyclic::MockCyclicController::MOCK_METHOD | ( | void | , |
| Stop | , | ||
| () | , | ||
| (override) | |||
| ) |
Mocks the Stop() operation.