Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
canopen::ObjectStorage Class Reference

#include <objdict.h>

Classes

class  Data
 
struct  DataType
 
struct  DataType< ObjectDict::DEFTYPE_DOMAIN >
 
struct  DataType< ObjectDict::DEFTYPE_INTEGER16 >
 
struct  DataType< ObjectDict::DEFTYPE_INTEGER32 >
 
struct  DataType< ObjectDict::DEFTYPE_INTEGER64 >
 
struct  DataType< ObjectDict::DEFTYPE_INTEGER8 >
 
struct  DataType< ObjectDict::DEFTYPE_OCTET_STRING >
 
struct  DataType< ObjectDict::DEFTYPE_REAL32 >
 
struct  DataType< ObjectDict::DEFTYPE_REAL64 >
 
struct  DataType< ObjectDict::DEFTYPE_UNICODE_STRING >
 
struct  DataType< ObjectDict::DEFTYPE_UNSIGNED16 >
 
struct  DataType< ObjectDict::DEFTYPE_UNSIGNED32 >
 
struct  DataType< ObjectDict::DEFTYPE_UNSIGNED64 >
 
struct  DataType< ObjectDict::DEFTYPE_UNSIGNED8 >
 
struct  DataType< ObjectDict::DEFTYPE_VISIBLE_STRING >
 
class  Entry
 

Public Types

typedef std::shared_ptr< ObjectStorageObjectStorageSharedPtr
 
using ReadDelegate = can::DelegateHelper< ReadFunc >
 
using ReadFunc = std::function< void(const ObjectDict::Entry &, String &)>
 
typedef std::function< std::string()> ReadStringFuncType
 
using WriteDelegate = can::DelegateHelper< WriteFunc >
 
using WriteFunc = std::function< void(const ObjectDict::Entry &, const String &)>
 
typedef std::function< void(const std::string &)> WriteStringFuncType
 

Public Member Functions

template<typename T >
Entry< T > entry (const ObjectDict::Key &key)
 
template<typename T >
bool entry (Entry< T > &e, const ObjectDict::Key &k)
 
template<typename T >
void entry (Entry< T > &e, uint16_t index)
 
template<typename T >
void entry (Entry< T > &e, uint16_t index, uint8_t sub_index)
 
template<typename T >
Entry< T > entry (uint16_t index)
 
template<typename T >
Entry< T > entry (uint16_t index, uint8_t sub_index)
 
ReadStringFuncType getStringReader (const ObjectDict::Key &key, bool cached=false)
 
WriteStringFuncType getStringWriter (const ObjectDict::Key &key, bool cached=false)
 
void init (const ObjectDict::Key &key)
 
void init_all ()
 
size_t map (uint16_t index, uint8_t sub_index, const ReadFunc &read_delegate, const WriteFunc &write_delegate)
 
 ObjectStorage (ObjectDictConstSharedPtr dict, uint8_t node_id, ReadFunc read_delegate, WriteFunc write_delegate)
 
void reset ()
 

Public Attributes

const ObjectDictConstSharedPtr dict_
 
const uint8_t node_id_
 

Protected Types

typedef std::shared_ptr< DataDataSharedPtr
 
typedef std::unordered_map< ObjectDict::Key, DataSharedPtr, ObjectDict::KeyHashObjectStorageMap
 

Protected Member Functions

void init_nolock (const ObjectDict::Key &key, const ObjectDict::EntryConstSharedPtr &entry)
 
size_t map (const ObjectDict::EntryConstSharedPtr &e, const ObjectDict::Key &key, const ReadFunc &read_delegate, const WriteFunc &write_delegate)
 

Protected Attributes

boost::mutex mutex_
 
ReadFunc read_delegate_
 
ObjectStorageMap storage_
 
WriteFunc write_delegate_
 

Detailed Description

Definition at line 278 of file objdict.h.

Member Typedef Documentation

◆ DataSharedPtr

typedef std::shared_ptr<Data> canopen::ObjectStorage::DataSharedPtr
protected

Definition at line 383 of file objdict.h.

◆ ObjectStorageMap

Definition at line 459 of file objdict.h.

◆ ObjectStorageSharedPtr

Definition at line 286 of file objdict.h.

◆ ReadDelegate

Definition at line 281 of file objdict.h.

◆ ReadFunc

using canopen::ObjectStorage::ReadFunc = std::function<void(const ObjectDict::Entry&, String &)>

Definition at line 280 of file objdict.h.

◆ ReadStringFuncType

typedef std::function<std::string()> canopen::ObjectStorage::ReadStringFuncType

Definition at line 524 of file objdict.h.

◆ WriteDelegate

Definition at line 284 of file objdict.h.

◆ WriteFunc

using canopen::ObjectStorage::WriteFunc = std::function<void(const ObjectDict::Entry&, const String &)>

Definition at line 283 of file objdict.h.

◆ WriteStringFuncType

typedef std::function<void(const std::string &)> canopen::ObjectStorage::WriteStringFuncType

Definition at line 526 of file objdict.h.

Constructor & Destructor Documentation

◆ ObjectStorage()

ObjectStorage::ObjectStorage ( ObjectDictConstSharedPtr  dict,
uint8_t  node_id,
ReadFunc  read_delegate,
WriteFunc  write_delegate 
)

Definition at line 383 of file objdict.cpp.

Member Function Documentation

◆ entry() [1/6]

template<typename T >
Entry<T> canopen::ObjectStorage::entry ( const ObjectDict::Key key)
inline

Definition at line 469 of file objdict.h.

◆ entry() [2/6]

template<typename T >
bool canopen::ObjectStorage::entry ( Entry< T > &  e,
const ObjectDict::Key k 
)
inline

Definition at line 516 of file objdict.h.

◆ entry() [3/6]

template<typename T >
void canopen::ObjectStorage::entry ( Entry< T > &  e,
uint16_t  index 
)
inline

Definition at line 510 of file objdict.h.

◆ entry() [4/6]

template<typename T >
void canopen::ObjectStorage::entry ( Entry< T > &  e,
uint16_t  index,
uint8_t  sub_index 
)
inline

Definition at line 513 of file objdict.h.

◆ entry() [5/6]

template<typename T >
Entry<T> canopen::ObjectStorage::entry ( uint16_t  index)
inline

Definition at line 503 of file objdict.h.

◆ entry() [6/6]

template<typename T >
Entry<T> canopen::ObjectStorage::entry ( uint16_t  index,
uint8_t  sub_index 
)
inline

Definition at line 506 of file objdict.h.

◆ getStringReader()

ObjectStorage::ReadStringFuncType ObjectStorage::getStringReader ( const ObjectDict::Key key,
bool  cached = false 
)

Definition at line 449 of file objdict.cpp.

◆ getStringWriter()

ObjectStorage::WriteStringFuncType ObjectStorage::getStringWriter ( const ObjectDict::Key key,
bool  cached = false 
)

Definition at line 476 of file objdict.cpp.

◆ init()

void ObjectStorage::init ( const ObjectDict::Key key)

Definition at line 406 of file objdict.cpp.

◆ init_all()

void ObjectStorage::init_all ( )

Definition at line 410 of file objdict.cpp.

◆ init_nolock()

void ObjectStorage::init_nolock ( const ObjectDict::Key key,
const ObjectDict::EntryConstSharedPtr entry 
)
protected

Definition at line 390 of file objdict.cpp.

◆ map() [1/2]

size_t ObjectStorage::map ( const ObjectDict::EntryConstSharedPtr e,
const ObjectDict::Key key,
const ReadFunc read_delegate,
const WriteFunc write_delegate 
)
protected

Definition at line 333 of file objdict.cpp.

◆ map() [2/2]

size_t ObjectStorage::map ( uint16_t  index,
uint8_t  sub_index,
const ReadFunc read_delegate,
const WriteFunc write_delegate 
)

Definition at line 366 of file objdict.cpp.

◆ reset()

void ObjectStorage::reset ( )

Definition at line 419 of file objdict.cpp.

Member Data Documentation

◆ dict_

const ObjectDictConstSharedPtr canopen::ObjectStorage::dict_

Definition at line 529 of file objdict.h.

◆ mutex_

boost::mutex canopen::ObjectStorage::mutex_
protected

Definition at line 461 of file objdict.h.

◆ node_id_

const uint8_t canopen::ObjectStorage::node_id_

Definition at line 530 of file objdict.h.

◆ read_delegate_

ReadFunc canopen::ObjectStorage::read_delegate_
protected

Definition at line 465 of file objdict.h.

◆ storage_

ObjectStorageMap canopen::ObjectStorage::storage_
protected

Definition at line 460 of file objdict.h.

◆ write_delegate_

WriteFunc canopen::ObjectStorage::write_delegate_
protected

Definition at line 466 of file objdict.h.


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


canopen_master
Author(s): Mathias Lüdtke
autogenerated on Wed Mar 2 2022 00:52:26