PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
profinet::AlarmListenerTestAccess Class Reference

Narrow private-access adapter used only by AlarmListener tests. More...

#include <alarmListenerTestAccess.h>

+ Collaboration diagram for profinet::AlarmListenerTestAccess:

Static Public Member Functions

static void SetSock (AlarmListener &listener, std::unique_ptr< IRawEthernetSocket > sock)
 Set the Layer 2 Ethernet socket used by the listener.
 
static void HandleLayer2Frame (AlarmListener &listener)
 Receive and process one Layer 2 RTA frame.
 
static std::size_t CallbackCount (const AlarmListener &listener)
 Return the number of callbacks registered with the listener.
 
static const MacAddress & ControllerMac (const AlarmListener &listener)
 Return the listener's configured controller MAC address.
 

Detailed Description

Narrow private-access adapter used only by AlarmListener tests.

Provides controlled access to selected AlarmListener internals without exposing those members through the production API.

Keeping the access points here makes the test-only coupling explicit and prevents individual test fixtures from requiring separate friend declarations in AlarmListener.

Definition at line 36 of file alarmListenerTestAccess.h.

Member Function Documentation

◆ CallbackCount()

static std::size_t profinet::AlarmListenerTestAccess::CallbackCount ( const AlarmListener &  listener)
inlinestatic

Return the number of callbacks registered with the listener.

Parameters
listenerAlarmListener under test.
Returns
Number of registered callbacks.

Definition at line 65 of file alarmListenerTestAccess.h.

References profinet::AlarmListener::alarmNotificationCallbacks.

Referenced by profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), profinet::TEST_F(), and profinet::TEST_F().

+ Here is the caller graph for this function:

◆ ControllerMac()

static const MacAddress & profinet::AlarmListenerTestAccess::ControllerMac ( const AlarmListener &  listener)
inlinestatic

Return the listener's configured controller MAC address.

Parameters
listenerAlarmListener under test.
Returns
Configured controller MAC address.

Definition at line 75 of file alarmListenerTestAccess.h.

References profinet::AlarmListener::controllerMac.

Referenced by profinet::TEST_F(), and profinet::TEST_F().

+ Here is the caller graph for this function:

◆ HandleLayer2Frame()

static void profinet::AlarmListenerTestAccess::HandleLayer2Frame ( AlarmListener &  listener)
inlinestatic

Receive and process one Layer 2 RTA frame.

Parameters
listenerAlarmListener under test.

Definition at line 56 of file alarmListenerTestAccess.h.

References profinet::AlarmListener::HandleLayer2Frame().

Referenced by profinet::AlarmListenerRtaTest::Feed(), profinet::AlarmListenerRtaIntegrationTest::Feed(), and profinet::AlarmListenerCallbackTest::Feed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetSock()

static void profinet::AlarmListenerTestAccess::SetSock ( AlarmListener &  listener,
std::unique_ptr< IRawEthernetSocket >  sock 
)
inlinestatic

Set the Layer 2 Ethernet socket used by the listener.

Transfers ownership of the supplied socket to AlarmListener.

Parameters
listenerAlarmListener under test.
sockNew Layer 2 Ethernet socket.

Definition at line 46 of file alarmListenerTestAccess.h.

References profinet::AlarmListener::l2Sock.

Referenced by profinet::AlarmListenerRtaTest::SetUp(), profinet::AlarmListenerRtaIntegrationTest::SetUp(), and profinet::AlarmListenerCallbackTest::SetUp().

+ Here is the caller graph for this function:

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