ethercatcpp
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ethercatcpp::coe::ObjectDictionary Class Reference

represent the CoE dictionnary of a device More...

#include <coe_utilities.h>

Inheritance diagram for ethercatcpp::coe::ObjectDictionary:
Inheritance graph

Classes

struct  DictionaryEntry
 Entry of a dictionnary. More...
 

Public Types

using entry = DictionaryEntry
 

Public Member Functions

 ObjectDictionary ()=default
 
 ~ObjectDictionary ()=default
 
 ObjectDictionary (std::initializer_list< std::pair< std::string_view, entry >>)
 Construct a new Object Dictionary object from a list of entries. More...
 
uint32_t mapped_pdo_object (std::string_view name) const
 Get the compact specification of a given entry. More...
 
uint16_t addr (std::string_view name) const
 Get address of a given entry. More...
 
size_t size (std::string_view name) const
 Get size of a given entry. More...
 
std::tuple< uint16_t, uint8_t, uint8_t > object (std::string_view name) const
 Get uncompressed specification of a given entry. More...
 
void add_entry (std::string_view name, const DictionaryEntry &object)
 Add en entry to the dictionary. More...
 
void add_entries (std::initializer_list< std::pair< std::string_view, entry >> entries)
 Add en entry to the dictionary. More...
 

Static Public Member Functions

static std::tuple< uint16_t, uint8_t, uint8_t > pdo_object_specs (uint32_t full_spec)
 Get uncompressed specification from a compact object specification. More...
 

Private Member Functions

const ObjectDictionary::DictionaryEntry & get_entry_safe (std::string_view name, std::string_view caller) const
 

Private Attributes

std::map< uint64_t, DictionaryEntry > dictionary_
 

Detailed Description

represent the CoE dictionnary of a device

Member Typedef Documentation

◆ entry

Constructor & Destructor Documentation

◆ ObjectDictionary() [1/2]

ethercatcpp::coe::ObjectDictionary::ObjectDictionary ( )
default

◆ ~ObjectDictionary()

ethercatcpp::coe::ObjectDictionary::~ObjectDictionary ( )
default

◆ ObjectDictionary() [2/2]

ethercatcpp::coe::ObjectDictionary::ObjectDictionary ( std::initializer_list< std::pair< std::string_view, entry >>  )
explicit

Construct a new Object Dictionary object from a list of entries.

Parameters
initializerlist that describe dictionary content

Member Function Documentation

◆ add_entries()

void ethercatcpp::coe::ObjectDictionary::add_entries ( std::initializer_list< std::pair< std::string_view, entry >>  entries)

Add en entry to the dictionary.

Parameters
entriesa list of entries to be added

◆ add_entry()

void ethercatcpp::coe::ObjectDictionary::add_entry ( std::string_view  name,
const DictionaryEntry &  object 
)

Add en entry to the dictionary.

Parameters
namethe objectname
objectthe corresponding entry specification

◆ addr()

uint16_t ethercatcpp::coe::ObjectDictionary::addr ( std::string_view  name) const

Get address of a given entry.

Parameters
namethe object name
Returns
uint16_t the address of the entry in dictionnary memory

◆ get_entry_safe()

const ObjectDictionary::DictionaryEntry& ethercatcpp::coe::ObjectDictionary::get_entry_safe ( std::string_view  name,
std::string_view  caller 
) const
private

◆ mapped_pdo_object()

uint32_t ethercatcpp::coe::ObjectDictionary::mapped_pdo_object ( std::string_view  name) const

Get the compact specification of a given entry.

Parameters
namethe object name
Returns
uint32_t the compact CoE representation of the entry

◆ object()

std::tuple<uint16_t, uint8_t, uint8_t> ethercatcpp::coe::ObjectDictionary::object ( std::string_view  name) const

Get uncompressed specification of a given entry.

Parameters
namethe object name
Returns
std::tuple<uint16_t, uint8_t, uint8_t> the specification of the entry (address, sub index, size in bits)

◆ pdo_object_specs()

static std::tuple<uint16_t, uint8_t, uint8_t> ethercatcpp::coe::ObjectDictionary::pdo_object_specs ( uint32_t  full_spec)
static

Get uncompressed specification from a compact object specification.

Parameters
full_specthe compact object specification
Returns
std::tuple<uint16_t, uint8_t, uint8_t> the specification of the entry (address, sub index, size in bits)

◆ size()

size_t ethercatcpp::coe::ObjectDictionary::size ( std::string_view  name) const

Get size of a given entry.

Parameters
namethe object name
Returns
the size of the object in bytes

Member Data Documentation

◆ dictionary_

std::map<uint64_t, DictionaryEntry> ethercatcpp::coe::ObjectDictionary::dictionary_
private

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