MIRA
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
ChannelReadCopy< DerivedContainer > Class Template Reference

A special base class creating and keeping a copy of the channel slot instead of managing access and locking of the original slot. More...

#include <fw/ChannelReadWrite.h>

Public Types

typedef ChannelReadWriteTraits< DerivedContainer >::ChannelType ChannelType
 
typedef ChannelReadWriteTraits< DerivedContainer >::SlotType Slot
 
typedef ChannelReadWriteTraits< DerivedContainer >::ValueType ValueType
 
typedef ChannelTypeChannelTypePtr
 

Public Member Functions

 ChannelReadCopy (ChannelTypePtr iChannel, ChannelBufferBase::Slot *iSlot)
 

Public Attributes

ChannelTypePtr channel
 pointer to the channel our data/slot belongs to More...
 
std::unique_ptr< ChannelBufferBase::SlotslotHolder
 we are the unique owner of this slot copy More...
 
ChannelBufferBase::Slotslot
 
MockLock lock
 

Detailed Description

template<typename DerivedContainer>
class mira::ChannelReadCopy< DerivedContainer >

A special base class creating and keeping a copy of the channel slot instead of managing access and locking of the original slot.

Use of this base for read access will remove the potential for dead-locks between a channel writer and a channel multi-reader competing for the same slot. (see ticket #941) Obviously, this only makes sense if the slot data is cheap to copy.

Member Typedef Documentation

◆ ChannelType

typedef ChannelReadWriteTraits<DerivedContainer>::ChannelType ChannelType

◆ Slot

typedef ChannelReadWriteTraits<DerivedContainer>::SlotType Slot

◆ ValueType

typedef ChannelReadWriteTraits<DerivedContainer>::ValueType ValueType

◆ ChannelTypePtr

Constructor & Destructor Documentation

◆ ChannelReadCopy()

ChannelReadCopy ( ChannelTypePtr  iChannel,
ChannelBufferBase::Slot iSlot 
)
inline

Member Data Documentation

◆ channel

ChannelTypePtr channel

pointer to the channel our data/slot belongs to

◆ slotHolder

std::unique_ptr<ChannelBufferBase::Slot> slotHolder

we are the unique owner of this slot copy

◆ slot

◆ lock

MockLock lock

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