Lely core libraries 2.3.4
lely::canopen::BasicSlave::ConstSubObject Class Reference

An accessor providing read-only access to a CANopen sub-object in a local object dictionary. More...

#include <slave.hpp>

Public Member Functions

template<class T >
 operator T () const
 Returns a copy of the value of the sub-object.
 
const ::std::type_info & Type () const
 Returns the type of the sub-object.
 
const ::std::type_info & Type (::std::error_code &ec) const
 Returns the type of the sub-object.
 
template<class T >
Get () const
 Reads the value of the sub-object.
 
template<class T >
Get (::std::error_code &ec) const noexcept
 Reads the value of the sub-object.
 

Detailed Description

An accessor providing read-only access to a CANopen sub-object in a local object dictionary.

Definition at line 331 of file slave.hpp.

Member Function Documentation

◆ operator T()

template<class T >
lely::canopen::BasicSlave::ConstSubObject::operator T ( ) const
inline

Returns a copy of the value of the sub-object.

Exceptions
lely::canopen::SdoErrorif the sub-object does not exist or the type does not match.
See also
Get()

Definition at line 345 of file slave.hpp.

◆ Type() [1/2]

const ::std::type_info & lely::canopen::BasicSlave::ConstSubObject::Type ( ) const
inline

Returns the type of the sub-object.

Returns
a reference to an std::type_info object representing the type, or typeid(void) if unknown.
Exceptions
lely::canopen::SdoErrorif the sub-object does not exist.
See also
Device::Type(uint16_t idx, uint8_t subidx) const

Definition at line 360 of file slave.hpp.

◆ Type() [2/2]

const ::std::type_info & lely::canopen::BasicSlave::ConstSubObject::Type ( ::std::error_code &  ec) const
inline

Returns the type of the sub-object.

Parameters
ecif the sub-object does not exist, the SDO abort code is stored in ec.
Returns
a reference to an std::type_info object representing the type, or typeid(void) if unknown.
See also
Device::Type(uint16_t idx, uint8_t subidx, ::std::error_code& ec) const

Definition at line 377 of file slave.hpp.

◆ Get() [1/2]

template<class T >
T lely::canopen::BasicSlave::ConstSubObject::Get ( ) const
inline

Reads the value of the sub-object.

Returns
a copy of the value of the sub-object.
Exceptions
lely::canopen::SdoErrorif the sub-object does not exist or the type does not match.
See also
Device::Get(uint16_t idx, uint8_t subidx) const
Device::RpdoGet(uint8_t id, uint16_t idx, uint8_t subidx) const
Device::TpdoGet(uint8_t id, uint16_t idx, uint8_t subidx) const

Definition at line 395 of file slave.hpp.

◆ Get() [2/2]

template<class T >
T lely::canopen::BasicSlave::ConstSubObject::Get ( ::std::error_code &  ec) const
inlinenoexcept

Reads the value of the sub-object.

Parameters
ecif the sub-object does not exist or the type does not match, the SDO abort code is stored in ec.
Returns
a copy of the value of the sub-object, or an empty value on error.
See also
Device::Get(uint16_t idx, uint8_t subidx, ::std::error_code& ec) const
Device::RpdoGet(uint8_t id, uint16_t idx, uint8_t subidx, ::std::error_code& ec) const
Device::TpdoGet(uint8_t id, uint16_t idx, uint8_t subidx, ::std::error_code& ec) const

Definition at line 416 of file slave.hpp.


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