Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
mm::node::ObjectAddress< T > Struct Template Reference

The address of one object-dictionary entry, carrying the type that entry holds. More...

#include <device_parameter.h>

Public Attributes

uint16_t index {}
 CoE object index.
 
uint8_t subindex {}
 CoE object subindex.
 

Detailed Description

template<typename T>
struct mm::node::ObjectAddress< T >

The address of one object-dictionary entry, carrying the type that entry holds.

The typed counterpart of makeParameterKey: an index and a subindex, plus the C++ type the object's declared ETG.1020 data type maps to. It names a location in any dictionary — it holds no device and no pointer, which is why it is an address rather than a reference or a handle.

Its point is that the three things easiest to get wrong about an object — its index, its type, and (in the trailing comment beside each generated constant) its unit — travel together instead of being retyped at every call site. Device's overloads take one in place of an index/subindex pair, so the type argument disappears from the call:

device.value(somanet::objects::kDriveTemperatureMeasuredTemperature); // std::optional<int32_t>
expected<std::string,…>
constexpr ObjectAddress< std::string > kManufacturerSoftwareVersion
Manufacturer software version — ro.
Definition profile_device_objects.h:58
constexpr ObjectAddress< int32_t > kDriveTemperatureMeasuredTemperature
Drive temperature / Measured temperature — ro, m°C.
Definition somanet_drive_objects.h:472

A whole dictionary's worth of these is generated from a vendor's ESI — see cia402_drive_objects.h and its siblings — but there is nothing generated about the type itself: writing one by hand for an object you care about is a one-liner.

Member Data Documentation

◆ index

template<typename T >
uint16_t mm::node::ObjectAddress< T >::index {}

CoE object index.

◆ subindex

template<typename T >
uint8_t mm::node::ObjectAddress< T >::subindex {}

CoE object subindex.


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