PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
profinet::cyclic::test::LifetimeTrackingRawEthernetSocket Class Referencefinal

#include <cyclic_raw_ethernet_socket_stub.h>

+ Inheritance diagram for profinet::cyclic::test::LifetimeTrackingRawEthernetSocket:
+ Collaboration diagram for profinet::cyclic::test::LifetimeTrackingRawEthernetSocket:

Public Member Functions

 LifetimeTrackingRawEthernetSocket (std::shared_ptr< LifetimeTrackingSocketState > state)
 
 ~LifetimeTrackingRawEthernetSocket () override
 
void Send (const Bytes &) override
 Send one complete raw Ethernet frame.
 
Bytes Recv () override
 Receive one raw Ethernet frame.
 
void SetTimeout (std::chrono::milliseconds) override
 Set the receive timeout.
 
void WaitUntilReceiveEntered ()
 
void WaitUntilReceiveExited ()
 
void ReleaseReceive ()
 
- Public Member Functions inherited from profinet::IRawEthernetSocket
virtual ~IRawEthernetSocket ()=default
 Virtual destructor for polymorphic use.
 

Private Attributes

std::shared_ptr< LifetimeTrackingSocketState > state
 

Detailed Description

Definition at line 263 of file cyclic_raw_ethernet_socket_stub.h.

Constructor & Destructor Documentation

◆ LifetimeTrackingRawEthernetSocket()

profinet::cyclic::test::LifetimeTrackingRawEthernetSocket::LifetimeTrackingRawEthernetSocket ( std::shared_ptr< LifetimeTrackingSocketState >  state)
inlineexplicit

Definition at line 266 of file cyclic_raw_ethernet_socket_stub.h.

◆ ~LifetimeTrackingRawEthernetSocket()

profinet::cyclic::test::LifetimeTrackingRawEthernetSocket::~LifetimeTrackingRawEthernetSocket ( )
inlineoverride

Definition at line 272 of file cyclic_raw_ethernet_socket_stub.h.

References state.

Member Function Documentation

◆ Recv()

Bytes profinet::cyclic::test::LifetimeTrackingRawEthernetSocket::Recv ( )
inlineoverridevirtual

Receive one raw Ethernet frame.

Waits for and returns a complete Ethernet frame received from the underlying raw socket.

The returned frame starts at the first byte of the Ethernet header. VLAN tags, when present, remain part of the returned frame and are therefore available to the PROFINET parser.

Returns
Received Ethernet frame.
Exceptions
std::system_errorWhen the underlying socket reports a receive error.
Note
The exact blocking, timeout, and cancellation behavior is defined by the concrete implementation.

Implements profinet::IRawEthernetSocket.

Definition at line 287 of file cyclic_raw_ethernet_socket_stub.h.

References state.

◆ ReleaseReceive()

void profinet::cyclic::test::LifetimeTrackingRawEthernetSocket::ReleaseReceive ( )
inline

Definition at line 342 of file cyclic_raw_ethernet_socket_stub.h.

References state.

◆ Send()

void profinet::cyclic::test::LifetimeTrackingRawEthernetSocket::Send ( const Bytes &  frame)
inlineoverridevirtual

Send one complete raw Ethernet frame.

Transmits the complete Ethernet frame supplied by the caller. The frame includes all Ethernet-level headers and protocol payload.

Depending on the caller, this may include:

  • Destination MAC address.
  • Source MAC address.
  • One or more VLAN tags.
  • Ethernet EtherType.
  • PROFINET RT or RTA payload.
Parameters
frameComplete Ethernet frame to transmit.
Exceptions
std::system_errorWhen the underlying socket reports a transmission error, if the concrete implementation uses exception-based error reporting.

Implements profinet::IRawEthernetSocket.

Definition at line 283 of file cyclic_raw_ethernet_socket_stub.h.

◆ SetTimeout()

void profinet::cyclic::test::LifetimeTrackingRawEthernetSocket::SetTimeout ( std::chrono::milliseconds  timeout)
inlineoverridevirtual

Set the receive timeout.

Parameters
timeoutMaximum time that Recv() waits for a matching frame. Zero means wait indefinitely.

The timeout is an abstraction-level receive timeout. The concrete transport is responsible for implementing the timeout using its underlying packet-access mechanism.

Implements profinet::IRawEthernetSocket.

Definition at line 318 of file cyclic_raw_ethernet_socket_stub.h.

◆ WaitUntilReceiveEntered()

void profinet::cyclic::test::LifetimeTrackingRawEthernetSocket::WaitUntilReceiveEntered ( )
inline

Definition at line 322 of file cyclic_raw_ethernet_socket_stub.h.

References state.

◆ WaitUntilReceiveExited()

void profinet::cyclic::test::LifetimeTrackingRawEthernetSocket::WaitUntilReceiveExited ( )
inline

Definition at line 332 of file cyclic_raw_ethernet_socket_stub.h.

References state.

Member Data Documentation

◆ state

std::shared_ptr<LifetimeTrackingSocketState> profinet::cyclic::test::LifetimeTrackingRawEthernetSocket::state
private

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