YARP CiA-402 EtherCAT Device 0.6.0
YARP device plugin for EtherCAT CiA-402 drives
Loading...
Searching...
No Matches
CiA402::TxView Class Reference

Lightweight view over a slave's TxPDO image. More...

#include <CiA402/EthercatManager.h>

Public Member Functions

 TxView (const uint8_t *base, const std::unordered_map< TxField, FieldInfo > *map)
 Construct a view.
 
bool has (TxField f) const
 Check if a given field is available in the current mapping.
 
template<typename T>
get (TxField f, T fallback={}) const
 Read a field from the TxPDO image with a typed accessor.
 

Detailed Description

Lightweight view over a slave's TxPDO image.

Provides presence checks and typed accessors to values mapped into the device TxPDO. Lifetime note: this is a non-owning view, valid as long as the underlying process image buffer remains alive and unmoved.

Definition at line 88 of file EthercatManager.h.

Constructor & Destructor Documentation

◆ TxView()

CiA402::TxView::TxView ( const uint8_t * base,
const std::unordered_map< TxField, FieldInfo > * map )
inline

Construct a view.

Parameters
basePointer to the beginning of the raw TxPDO buffer for a slave.
mapPointer to the field map describing where each entry is.

Definition at line 96 of file EthercatManager.h.

Member Function Documentation

◆ get()

template<typename T>
T CiA402::TxView::get ( TxField f,
T fallback = {} ) const
inline

Read a field from the TxPDO image with a typed accessor.

Supports any trivially copyable type whose size matches the mapped field (commonly 8/16/32-bit integers or IEEE-754 REALs coming from the drive). If the field is not present or the size does not match, the fallback is returned.

Definition at line 117 of file EthercatManager.h.

◆ has()

bool CiA402::TxView::has ( TxField f) const
inline

Check if a given field is available in the current mapping.

Definition at line 105 of file EthercatManager.h.


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