ChimeraTK-DeviceAccess 03.20.00
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ChimeraTK::TransferElement Class Referenceabstract

Base class for register accessors which can be part of a TransferGroup. More...

#include <TransferElement.h>

+ Inheritance diagram for ChimeraTK::TransferElement:
+ Collaboration diagram for ChimeraTK::TransferElement:

Public Types

using SharedPtr = boost::shared_ptr< TransferElement >
 A typedef for more compact syntax.
 

Public Member Functions

 TransferElement (std::string name, AccessModeFlags accessModeFlags, std::string unit=std::string(unitNotSet), std::string description=std::string())
 Creates a transfer element with the specified name.
 
 TransferElement (const TransferElement &other)=delete
 Copying and moving is not allowed.
 
 TransferElement (TransferElement &&other)=delete
 
TransferElementoperator= (const TransferElement &other)=delete
 
TransferElementoperator= (TransferElement &&other)=delete
 
virtual ~TransferElement ()=default
 Abstract base classes need a virtual destructor.
 
const std::string & getName () const
 Returns the name that identifies the process variable.
 
const std::string & getUnit () const
 Returns the engineering unit.
 
const std::string & getDescription () const
 Returns the description of this variable/register.
 
virtual const std::type_info & getValueType () const =0
 Returns the std::type_info for the value type of this transfer element.
 
AccessModeFlags getAccessModeFlags () const
 Return the AccessModeFlags for this TransferElement.
 
void setDataValidity (DataValidity validity=DataValidity::ok)
 Set the current DataValidity for this TransferElement.
 
DataValidity dataValidity () const
 Return current validity of the data.
 
void read ()
 Read the data from the device.
 
bool readNonBlocking ()
 Read the next value, if available in the input buffer.
 
bool readLatest ()
 Read the latest value, discarding any other update since the last read if present.
 
bool write (ChimeraTK::VersionNumber versionNumber={})
 Write the data to device.
 
bool writeDestructively (ChimeraTK::VersionNumber versionNumber={})
 Just like write(), but allows the implementation to destroy the content of the user buffer in the process.
 
ChimeraTK::VersionNumber getVersionNumber () const
 Returns the version number that is associated with the last transfer (i.e.
 
virtual bool isReadOnly () const =0
 Check if transfer element is read only, i.e.
 
virtual bool isReadable () const =0
 Check if transfer element is readable.
 
virtual bool isWriteable () const =0
 Check if transfer element is writeable.
 
void setActiveException (std::exception_ptr &setThisException)
 Set an active exception.
 
virtual void setExceptionBackend (boost::shared_ptr< DeviceBackend > exceptionBackend)
 Set the backend to which the exception has to be reported.
 
boost::shared_ptr< DeviceBackendgetExceptionBackend ()
 Return the exception backend.
 
cppext::future_queue< void > getReadQueue ()
 Function to get a copy of the read queue.
 
void readTransfer ()
 Read the data from the device but do not fill it into the user buffer of this TransferElement.
 
bool readTransferNonBlocking ()
 Read the data from the device but do not fill it into the user buffer of this TransferElement.
 
void preRead (TransferType type)
 Perform any pre-read tasks if necessary.
 
void postRead (TransferType type, bool updateDataBuffer)
 Transfer the data from the device receive buffer into the user buffer, while converting the data into the user data format if needed.
 
void preWrite (TransferType type, ChimeraTK::VersionNumber versionNumber)
 Transfer the data from the user buffer into the device send buffer, while converting the data from then user data format if needed.
 
void postWrite (TransferType type, VersionNumber versionNumber)
 Perform any post-write clean-ups if necessary.
 
bool writeTransfer (ChimeraTK::VersionNumber versionNumber)
 Write the data to the device.
 
bool writeTransferDestructively (ChimeraTK::VersionNumber versionNumber)
 Write the data to the device.
 
virtual bool mayReplaceOther (const boost::shared_ptr< TransferElement const > &other) const
 Check whether the TransferElement can be used in places where the TransferElement "other" is currently used, e.g.
 
virtual std::vector< boost::shared_ptr< TransferElement > > getHardwareAccessingElements ()=0
 Obtain the underlying TransferElements with actual hardware access.
 
virtual std::list< boost::shared_ptr< TransferElement > > getInternalElements ()=0
 Obtain the full list of TransferElements internally used by this TransferElement.
 
virtual boost::shared_ptr< TransferElementgetHighLevelImplElement ()
 Obtain the highest level implementation TransferElement.
 
virtual void replaceTransferElement (boost::shared_ptr< TransferElement > newElement)
 Search for all underlying TransferElements which are considered identical (see sameRegister()) with the given TransferElement.
 
virtual boost::shared_ptr< TransferElementmakeCopyRegisterDecorator ()=0
 Create a CopyRegisterDecorator of the right type decorating this TransferElement.
 
virtual void setPersistentDataStorage (boost::shared_ptr< ChimeraTK::PersistentDataStorage >)
 Associate a persistent data storage object to be updated on each write operation of this ProcessArray.
 
TransferElementID getId () const
 Obtain unique ID for this TransferElement, see TransferElementID for details.
 
virtual void interrupt ()
 Return from a blocking read immediately and throw boost::thread_interrupted.
 
template<typename QUEUE_TYPE >
void interrupt_impl (QUEUE_TYPE &dataTransportQueue)
 Implementation of interrupt()
 
bool isReadTransactionInProgress () const
 Check whether a read transaction is in progress, i.e.
 
bool isWriteTransactionInProgress () const
 Check whether a write transaction is in progress, i.e.
 
ReadAnyGroupgetReadAnyGroup () const
 Obtain the ReadAnyGroup this TransferElement is part of, or nullptr if not in a ReadAnyGroup.
 
virtual void setInReadAnyGroup (ReadAnyGroup *rag)
 Set the ReadAnyGroup of which this TransferElement is part of.
 

Static Public Attributes

static constexpr char unitNotSet [] = "n./a."
 Constant string to be used as a unit when the unit is not provided or known.
 

Protected Member Functions

virtual void doReadTransferSynchronously ()=0
 Implementation version of readTransfer() for synchronous reads.
 
virtual void doPreRead (TransferType)
 Backend specific implementation of preRead().
 
virtual void doPostRead (TransferType, bool)
 Backend specific implementation of postRead().
 
virtual void doPreWrite (TransferType, VersionNumber)
 Backend specific implementation of preWrite().
 
virtual void doPostWrite (TransferType, VersionNumber)
 Backend specific implementation of postWrite().
 
virtual bool doWriteTransfer (ChimeraTK::VersionNumber versionNumber)=0
 Implementation version of writeTransfer().
 
virtual bool doWriteTransferDestructively (ChimeraTK::VersionNumber versionNumber)
 Implementation version of writeTransferDestructively().
 
void makeUniqueId ()
 Allow generating a unique ID from derived classes.
 

Protected Attributes

boost::shared_ptr< DeviceBackend_exceptionBackend
 The backend to which the runtime_errors are reported via DeviceBackend::setException().
 
std::string _name
 Identifier uniquely identifying the TransferElement.
 
std::string _unit
 Engineering unit.
 
std::string _description
 Description of this variable/register.
 
TransferElementID _id
 The ID of this TransferElement.
 
bool _isInTransferGroup {false}
 Flag whether this TransferElement has been added to a TransferGroup or not.
 
ReadAnyGroup_inReadAnyGroup {nullptr}
 ReadAnyGroup this TransferElement has been added to, nullptr if not in a ReadAnyGroup.
 
AccessModeFlags _accessModeFlags
 The access mode flags for this transfer element.
 
cppext::future_queue< void > _readQueue
 The queue for asynchronous read transfers.
 
VersionNumber _versionNumber {nullptr}
 The version number of the last successful transfer.
 
DataValidity _dataValidity {DataValidity::ok}
 The validity of the data in the application buffer.
 
std::exception_ptr _activeException {nullptr}
 Exception to be rethrown in postXXX() in case hasSeenException == true Can be set via setActiveException().
 

Friends

class TransferGroup
 
class ReadAnyGroup
 

Detailed Description

Base class for register accessors which can be part of a TransferGroup.

Definition at line 68 of file TransferElement.h.

Member Typedef Documentation

◆ SharedPtr

A typedef for more compact syntax.

Definition at line 86 of file TransferElement.h.

Constructor & Destructor Documentation

◆ TransferElement() [1/3]

ChimeraTK::TransferElement::TransferElement ( std::string  name,
AccessModeFlags  accessModeFlags,
std::string  unit = std::string(unitNotSet),
std::string  description = std::string() 
)
inline

Creates a transfer element with the specified name.

Definition at line 71 of file TransferElement.h.

◆ TransferElement() [2/3]

ChimeraTK::TransferElement::TransferElement ( const TransferElement other)
delete

Copying and moving is not allowed.

◆ TransferElement() [3/3]

ChimeraTK::TransferElement::TransferElement ( TransferElement &&  other)
delete

◆ ~TransferElement()

virtual ChimeraTK::TransferElement::~TransferElement ( )
virtualdefault

Abstract base classes need a virtual destructor.

Member Function Documentation

◆ dataValidity()

DataValidity ChimeraTK::TransferElement::dataValidity ( ) const
inline

Return current validity of the data.

Will always return DataValidity::ok if the backend does not support it

Definition at line 112 of file TransferElement.h.

◆ doPostRead()

virtual void ChimeraTK::TransferElement::doPostRead ( TransferType  ,
bool   
)
inlineprotectedvirtual

Backend specific implementation of postRead().

postRead() will call this function, but it will make sure that it gets called only once per transfer.

No actual communication may be done. Hence, no runtime_error exception may be thrown by this function. Also it must be acceptable to call this function while the device is closed or not functional (see isFunctional()) and no exception is thrown.

Notes for backend implementations:

  • If the flag updateDataBuffer is false, the data buffer must stay unaltered. Full implementations (backends) must also leave the meta data (version number and data validity) unchanged. Decorators are allowed to change the meta data (for instance set the DataValidity::faulty).

Reimplemented in ChimeraTK::TypeChangingDecorator< T, IMPL_T >, ChimeraTK::TypeChangingDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::TypeChangingDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::TypeChangingDecorator< ChimeraTK::Void, std::string >, ChimeraTK::TypeChangingDecorator< std::string, ChimeraTK::Void >, ChimeraTK::TypeChangingDecorator< std::string, IMPL_T >, ChimeraTK::TypeChangingDecorator< T, ChimeraTK::Void >, ChimeraTK::TypeChangingDecorator< T, std::string >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::LNMBackend::DoubleBufferAccessorDecorator< UserType >, ChimeraTK::LNMBackend::BitRangeAccessPluginDecorator< UserType, TargetType >, ChimeraTK::LNMBackend::MathPluginDecorator< UserType >, ChimeraTK::LNMBackend::MultiplierPluginDecorator< UserType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::FixedPointConvertingDecorator< UserType, TargetUserType >, ChimeraTK::CopyRegisterDecorator< T >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendMuxedRegisterAccessor< UserType, ConverterType >, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, CountingDecorator< T >, ChimeraTK::ExceptionDummyPollDecorator< UserType >, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::DataConsistencyDecorator< UserType >, DecoratorTestAccessor< UserType >, ChimeraTK::TransferElementTestAccessor< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::NumericAddressedLowLevelTransferElement, AsyncTestDummy::Accessor< UserType >, ChimeraTK::ExceptionDummyPushDecorator< UserType >, ChimeraTK::LNMBackend::MonostableTriggerPluginDecorator< UserType >, and Accessor< UserType >.

Definition at line 504 of file TransferElement.h.

◆ doPostWrite()

virtual void ChimeraTK::TransferElement::doPostWrite ( TransferType  ,
VersionNumber   
)
inlineprotectedvirtual

Backend specific implementation of postWrite().

postWrite() will call this function, but it will make sure that it gets called only once per transfer.

No actual communication may be done. Hence, no runtime_error exception may be thrown by this function. Also it must be acceptable to call this function while the device is closed or not functional (see isFunctional()) and no exception is thrown.

Reimplemented in ChimeraTK::TypeChangingDecorator< T, IMPL_T >, ChimeraTK::TypeChangingDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::TypeChangingDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::TypeChangingDecorator< ChimeraTK::Void, std::string >, ChimeraTK::TypeChangingDecorator< std::string, ChimeraTK::Void >, ChimeraTK::TypeChangingDecorator< std::string, IMPL_T >, ChimeraTK::TypeChangingDecorator< T, ChimeraTK::Void >, ChimeraTK::TypeChangingDecorator< T, std::string >, ChimeraTK::LNMBackend::MultiplierPluginDecorator< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::LNMBackend::MathPluginDecorator< UserType >, ChimeraTK::FixedPointConvertingDecorator< UserType, TargetUserType >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, DecoratorTestAccessor< UserType >, CountingDecorator< T >, ChimeraTK::TransferElementTestAccessor< UserType >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackend::BitRangeAccessPluginDecorator< UserType, TargetType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::LNMBackend::MonostableTriggerPluginDecorator< UserType >, ChimeraTK::LNMBackend::DoubleBufferAccessorDecorator< UserType >, ChimeraTK::LNMBackend::ForceReadOnlyPluginDecorator< UserType >, ChimeraTK::NumericAddressedLowLevelTransferElement, AsyncTestDummy::Accessor< UserType >, and Accessor< UserType >.

Definition at line 601 of file TransferElement.h.

◆ doPreRead()

virtual void ChimeraTK::TransferElement::doPreRead ( TransferType  )
inlineprotectedvirtual

Backend specific implementation of preRead().

preRead() will call this function, but it will make sure that it gets called only once per transfer.

No actual communication may be done. Hence, no runtime_error exception may be thrown by this function. Also it must be acceptable to call this function while the device is closed or not functional (see isFunctional()) and no exception is thrown.

Reimplemented in ChimeraTK::TypeChangingDecorator< T, IMPL_T >, ChimeraTK::TypeChangingDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::TypeChangingDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::TypeChangingDecorator< ChimeraTK::Void, std::string >, ChimeraTK::TypeChangingDecorator< std::string, ChimeraTK::Void >, ChimeraTK::TypeChangingDecorator< std::string, IMPL_T >, ChimeraTK::TypeChangingDecorator< T, ChimeraTK::Void >, ChimeraTK::TypeChangingDecorator< T, std::string >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::LNMBackend::DoubleBufferAccessorDecorator< UserType >, ChimeraTK::LNMBackend::BitRangeAccessPluginDecorator< UserType, TargetType >, ChimeraTK::LNMBackend::MathPluginDecorator< UserType >, ChimeraTK::LNMBackend::MultiplierPluginDecorator< UserType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::FixedPointConvertingDecorator< UserType, TargetUserType >, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::DataConsistencyDecorator< UserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, std::string >, ChimeraTK::NDRegisterAccessorDecorator< std::string, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< std::string, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< T, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< T, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T, std::string >, ChimeraTK::NDRegisterAccessorDecorator< TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, double >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, uint32_t >, ChimeraTK::NDRegisterAccessorDecorator< UserType, UserType >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, DecoratorTestAccessor< UserType >, CountingDecorator< T >, ChimeraTK::TransferElementTestAccessor< UserType >, ChimeraTK::DummyInterruptTriggerAccessor< UserType >, ChimeraTK::ExceptionDummyPushDecorator< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::LNMBackend::MonostableTriggerPluginDecorator< UserType >, ChimeraTK::NumericAddressedBackendMuxedRegisterAccessor< UserType, ConverterType >, AsyncTestDummy::Accessor< UserType >, and Accessor< UserType >.

Definition at line 449 of file TransferElement.h.

◆ doPreWrite()

virtual void ChimeraTK::TransferElement::doPreWrite ( TransferType  ,
VersionNumber   
)
inlineprotectedvirtual

Backend specific implementation of preWrite().

preWrite() will call this function, but it will make sure that it gets called only once per transfer.

No actual communication may be done. Hence, no runtime_error exception may be thrown by this function. Also it must be acceptable to call this function while the device is closed or not functional (see isFunctional()) and no exception is thrown.

Reimplemented in ChimeraTK::TypeChangingDecorator< T, IMPL_T >, ChimeraTK::TypeChangingDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::TypeChangingDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::TypeChangingDecorator< ChimeraTK::Void, std::string >, ChimeraTK::TypeChangingDecorator< std::string, ChimeraTK::Void >, ChimeraTK::TypeChangingDecorator< std::string, IMPL_T >, ChimeraTK::TypeChangingDecorator< T, ChimeraTK::Void >, ChimeraTK::TypeChangingDecorator< T, std::string >, ChimeraTK::LNMBackend::BitRangeAccessPluginDecorator< UserType, TargetType >, ChimeraTK::LNMBackend::MathPluginDecorator< UserType >, ChimeraTK::FixedPointConvertingDecorator< UserType, TargetUserType >, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendMuxedRegisterAccessor< UserType, ConverterType >, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, DecoratorTestAccessor< UserType >, CountingDecorator< T >, ChimeraTK::TransferElementTestAccessor< UserType >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::LNMBackend::MultiplierPluginDecorator< UserType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::LNMBackend::MonostableTriggerPluginDecorator< UserType >, ChimeraTK::DummyInterruptTriggerAccessor< UserType >, ChimeraTK::LNMBackend::DoubleBufferAccessorDecorator< UserType >, ChimeraTK::LNMBackend::ForceReadOnlyPluginDecorator< UserType >, ChimeraTK::CopyRegisterDecorator< T >, ChimeraTK::NumericAddressedLowLevelTransferElement, AsyncTestDummy::Accessor< UserType >, and Accessor< UserType >.

Definition at line 551 of file TransferElement.h.

◆ doReadTransferSynchronously()

virtual void ChimeraTK::TransferElement::doReadTransferSynchronously ( )
protectedpure virtual

Implementation version of readTransfer() for synchronous reads.

This function must be implemented by the backend. For the functional description read the documentation of readTransfer().

Implementation notes:

  • This function must return within ~1 second after both boost::thread::interrupt() (on the thread calling this function) and TransferElement::interrupt() have been called (reliable termination requires both calls; implementation needs to react to one of the call only).
  • Decorators must delegate the call to readTransfer() of the decorated target.
  • Delegations within the same object should go to the "do" version, e.g. to BaseClass::doReadTransferSynchronously()

Implemented in ChimeraTK::DummyInterruptTriggerAccessor< UserType >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::LNMBackend::DoubleBufferAccessorDecorator< UserType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, std::string >, ChimeraTK::NDRegisterAccessorDecorator< std::string, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< std::string, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< T, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< T, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T, std::string >, ChimeraTK::NDRegisterAccessorDecorator< TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, double >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, uint32_t >, ChimeraTK::NDRegisterAccessorDecorator< UserType, UserType >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendMuxedRegisterAccessor< UserType, ConverterType >, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, ChimeraTK::NumericAddressedLowLevelTransferElement, AsyncTestDummy::Accessor< UserType >, Accessor< UserType >, DecoratorTestAccessor< UserType >, CountingDecorator< T >, and ChimeraTK::TransferElementTestAccessor< UserType >.

◆ doWriteTransfer()

virtual bool ChimeraTK::TransferElement::doWriteTransfer ( ChimeraTK::VersionNumber  versionNumber)
protectedpure virtual

Implementation version of writeTransfer().

This function must be implemented by the backend. For the functional description read the documentation of writeTransfer().

Implementation notes:

  • Decorators must delegate the call to writeTransfer() of the decorated target.

Implemented in ChimeraTK::LNMBackend::MonostableTriggerPluginDecorator< UserType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, std::string >, ChimeraTK::NDRegisterAccessorDecorator< std::string, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< std::string, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< T, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< T, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T, std::string >, ChimeraTK::NDRegisterAccessorDecorator< TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, double >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, uint32_t >, ChimeraTK::NDRegisterAccessorDecorator< UserType, UserType >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendMuxedRegisterAccessor< UserType, ConverterType >, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, DecoratorTestAccessor< UserType >, CountingDecorator< T >, ChimeraTK::TransferElementTestAccessor< UserType >, ChimeraTK::DummyInterruptTriggerAccessor< UserType >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::LNMBackend::MathPluginDecorator< UserType >, ChimeraTK::NumericAddressedLowLevelTransferElement, AsyncTestDummy::Accessor< UserType >, and Accessor< UserType >.

◆ doWriteTransferDestructively()

virtual bool ChimeraTK::TransferElement::doWriteTransferDestructively ( ChimeraTK::VersionNumber  versionNumber)
inlineprotectedvirtual

Implementation version of writeTransferDestructively().

This function must be implemented by the backend. For the functional description read the documentation of writeTransfer().

Implementation notes:

  • Decorators must delegate the call to writeTransfer() of the decorated target.
  • Delegations within the same object should go to the "do" version, e.g. to this->doWriteTransfer()
  • The implementation may destroy the content of the user buffer in the process. This is an optional optimisation, hence there is a default implementation which just calls the normal doWriteTransfer().

Reimplemented in ChimeraTK::LNMBackend::MonostableTriggerPluginDecorator< UserType >, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, std::string >, ChimeraTK::NDRegisterAccessorDecorator< std::string, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< std::string, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< T, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< T, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T, std::string >, ChimeraTK::NDRegisterAccessorDecorator< TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, double >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, uint32_t >, ChimeraTK::NDRegisterAccessorDecorator< UserType, UserType >, DecoratorTestAccessor< UserType >, ChimeraTK::TransferElementTestAccessor< UserType >, and ChimeraTK::LNMBackend::MathPluginDecorator< UserType >.

Definition at line 651 of file TransferElement.h.

◆ getAccessModeFlags()

AccessModeFlags ChimeraTK::TransferElement::getAccessModeFlags ( ) const
inline

Return the AccessModeFlags for this TransferElement.

Definition at line 104 of file TransferElement.h.

◆ getDescription()

const std::string & ChimeraTK::TransferElement::getDescription ( ) const
inline

Returns the description of this variable/register.

Definition at line 96 of file TransferElement.h.

◆ getExceptionBackend()

boost::shared_ptr< DeviceBackend > ChimeraTK::TransferElement::getExceptionBackend ( )
inline

Return the exception backend.

Needed by decorators to set their _exceptionBackend to the target's.

Definition at line 302 of file TransferElement.h.

◆ getHardwareAccessingElements()

virtual std::vector< boost::shared_ptr< TransferElement > > ChimeraTK::TransferElement::getHardwareAccessingElements ( )
pure virtual

Obtain the underlying TransferElements with actual hardware access.

If this transfer element is directly reading from / writing to the hardware, it will return a list just containing a shared pointer of itself.

Note: Avoid using this in application code, since it will break the abstraction!

Implemented in ChimeraTK::DummyInterruptTriggerAccessor< UserType >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::LNMBackend::DoubleBufferAccessorDecorator< UserType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, std::string >, ChimeraTK::NDRegisterAccessorDecorator< std::string, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< std::string, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< T, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< T, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T, std::string >, ChimeraTK::NDRegisterAccessorDecorator< TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, double >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, uint32_t >, ChimeraTK::NDRegisterAccessorDecorator< UserType, UserType >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendMuxedRegisterAccessor< UserType, ConverterType >, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, ChimeraTK::NumericAddressedLowLevelTransferElement, AsyncTestDummy::Accessor< UserType >, Accessor< UserType >, DecoratorTestAccessor< UserType >, CountingDecorator< T >, and ChimeraTK::TransferElementTestAccessor< UserType >.

◆ getHighLevelImplElement()

virtual boost::shared_ptr< TransferElement > ChimeraTK::TransferElement::getHighLevelImplElement ( )
inlinevirtual

Obtain the highest level implementation TransferElement.

For TransferElements which are itself an implementation this will directly return a shared pointer to this. If this TransferElement is a user frontend, the pointer to the internal implementation is returned.

Note: Avoid using this in application code, since it will break the abstraction!

Definition at line 724 of file TransferElement.h.

◆ getId()

TransferElementID ChimeraTK::TransferElement::getId ( ) const
inline

Obtain unique ID for this TransferElement, see TransferElementID for details.

Definition at line 764 of file TransferElement.h.

◆ getInternalElements()

virtual std::list< boost::shared_ptr< TransferElement > > ChimeraTK::TransferElement::getInternalElements ( )
pure virtual

Obtain the full list of TransferElements internally used by this TransferElement.

The function is recursive, i.e. elements used by the elements returned by this function are also added to the list. It is guaranteed that the directly used elements are first in the list and the result from recursion is appended to the list.

Example: A decorator would return a list with its target TransferElement followed by the result of getInternalElements() called on its target TransferElement.

If this TransferElement is not using any other element, it should return an empty vector. Thus those elements which return a list just containing themselves in getHardwareAccessingElements() will return an empty list here in getInternalElements().

Note: Avoid using this in application code, since it will break the abstraction!

Implemented in ChimeraTK::DummyInterruptTriggerAccessor< UserType >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::LNMBackend::DoubleBufferAccessorDecorator< UserType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, std::string >, ChimeraTK::NDRegisterAccessorDecorator< std::string, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< std::string, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< T, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< T, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T, std::string >, ChimeraTK::NDRegisterAccessorDecorator< TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, double >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, uint32_t >, ChimeraTK::NDRegisterAccessorDecorator< UserType, UserType >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendMuxedRegisterAccessor< UserType, ConverterType >, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, ChimeraTK::NumericAddressedLowLevelTransferElement, AsyncTestDummy::Accessor< UserType >, Accessor< UserType >, DecoratorTestAccessor< UserType >, CountingDecorator< T >, and ChimeraTK::TransferElementTestAccessor< UserType >.

◆ getName()

const std::string & ChimeraTK::TransferElement::getName ( ) const
inline

Returns the name that identifies the process variable.

Definition at line 89 of file TransferElement.h.

◆ getReadAnyGroup()

ReadAnyGroup * ChimeraTK::TransferElement::getReadAnyGroup ( ) const
inline

Obtain the ReadAnyGroup this TransferElement is part of, or nullptr if not in a ReadAnyGroup.

Definition at line 805 of file TransferElement.h.

◆ getReadQueue()

cppext::future_queue< void > ChimeraTK::TransferElement::getReadQueue ( )
inline

Function to get a copy of the read queue.

This functions should only be used by decorators to initialise their TransferElement::_readQueue() member.

Definition at line 307 of file TransferElement.h.

◆ getUnit()

const std::string & ChimeraTK::TransferElement::getUnit ( ) const
inline

Returns the engineering unit.

If none was specified, it will default to "n./a."

Definition at line 93 of file TransferElement.h.

◆ getValueType()

virtual const std::type_info & ChimeraTK::TransferElement::getValueType ( ) const
pure virtual

◆ getVersionNumber()

ChimeraTK::VersionNumber ChimeraTK::TransferElement::getVersionNumber ( ) const
inline

Returns the version number that is associated with the last transfer (i.e.

last read or write). See ChimeraTK::VersionNumber for details. The VersionNumber object also allows to determine the time stamp.

Implementation notes:

Reading accessors have to update the TransferElement _versionNumber variable in their doPostRead function. For TransferElements with AccessMode::wait_for_new_data it has to be created already when the data is received. It must be stored together with the payload data and only written to the application buffer (which _versionNumber is a part of) in postWrite. Accessors which rely on other accessors to obtain their data update the value from their target after a successful transfer.

Definition at line 260 of file TransferElement.h.

◆ interrupt()

virtual void ChimeraTK::TransferElement::interrupt ( )
inlinevirtual

Return from a blocking read immediately and throw boost::thread_interrupted.

This function can be used to shutdown a thread waiting on data to arrive, which might never happen because the sending part of the application is already shut down, or there is no new data at the moment.

Note that this function does not stop the sending thread. It just places a boost::thread_interrupted exception on the _TransferElement::_readQueue, so a waiting read() has something to receive and returns. If regular data is put into the queue just before the exception, this is received first. Hence it is not guaranteed that the read call that is supposed to be interrupted will actually throw an exception. But it is guaranteed that it returns immediately. Also it is guaranteed that eventually the boost::thread_interrupted exception will be received, unless more values are written to the queue and the exception is overwritten.

See Technical specification: TransferElement B.8.6

Implementation notice: This default implementation is always doing nothing. Each TransferElement implementation that supports AccessMode::wait_for_new_data (or may need to interrupt synchronous read calls) has to override it like this (unless the TransferElement has special requirements): void interrupt() override { this->interrupt_impl(this->_myDataTransportQueue); }

Reimplemented in ChimeraTK::ExceptionDummyPushDecorator< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, std::string >, ChimeraTK::NDRegisterAccessorDecorator< std::string, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< std::string, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< T, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< T, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T, std::string >, ChimeraTK::NDRegisterAccessorDecorator< TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, double >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, uint32_t >, ChimeraTK::NDRegisterAccessorDecorator< UserType, UserType >, DecoratorTestAccessor< UserType >, and ChimeraTK::TransferElementTestAccessor< UserType >.

Definition at line 785 of file TransferElement.h.

◆ interrupt_impl()

template<typename QUEUE_TYPE >
void ChimeraTK::TransferElement::interrupt_impl ( QUEUE_TYPE &  dataTransportQueue)
inline

Implementation of interrupt()

This function shall be called by backends in their interrupt() implementation as stated in its implementation note.

Definition at line 794 of file TransferElement.h.

◆ isReadable()

virtual bool ChimeraTK::TransferElement::isReadable ( ) const
pure virtual

Check if transfer element is readable.

It throws an exception if you try to read and isReadable() is not true.

Implemented in ChimeraTK::DummyInterruptTriggerAccessor< UserType >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::LNMBackend::MathPluginDecorator< UserType >, ChimeraTK::LNMBackend::MonostableTriggerPluginDecorator< UserType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, std::string >, ChimeraTK::NDRegisterAccessorDecorator< std::string, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< std::string, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< T, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< T, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T, std::string >, ChimeraTK::NDRegisterAccessorDecorator< TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, double >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, uint32_t >, ChimeraTK::NDRegisterAccessorDecorator< UserType, UserType >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendMuxedRegisterAccessor< UserType, ConverterType >, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, ChimeraTK::NumericAddressedLowLevelTransferElement, AsyncTestDummy::Accessor< UserType >, Accessor< UserType >, DecoratorTestAccessor< UserType >, and ChimeraTK::TransferElementTestAccessor< UserType >.

◆ isReadOnly()

virtual bool ChimeraTK::TransferElement::isReadOnly ( ) const
pure virtual

Check if transfer element is read only, i.e.

it is readable but not writeable.

Implemented in ChimeraTK::DummyInterruptTriggerAccessor< UserType >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::CopyRegisterDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, std::string >, ChimeraTK::NDRegisterAccessorDecorator< std::string, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< std::string, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< T, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< T, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T, std::string >, ChimeraTK::NDRegisterAccessorDecorator< TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, double >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, uint32_t >, ChimeraTK::NDRegisterAccessorDecorator< UserType, UserType >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendMuxedRegisterAccessor< UserType, ConverterType >, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, ChimeraTK::NumericAddressedLowLevelTransferElement, AsyncTestDummy::Accessor< UserType >, Accessor< UserType >, DecoratorTestAccessor< UserType >, and ChimeraTK::TransferElementTestAccessor< UserType >.

◆ isReadTransactionInProgress()

bool ChimeraTK::TransferElement::isReadTransactionInProgress ( ) const
inline

Check whether a read transaction is in progress, i.e.

preRead() has been called but not yet postRead().

Definition at line 799 of file TransferElement.h.

◆ isWriteable()

virtual bool ChimeraTK::TransferElement::isWriteable ( ) const
pure virtual

Check if transfer element is writeable.

It throws an exception if you try to write and isWriteable() is not true.

Implemented in ChimeraTK::DummyInterruptTriggerAccessor< UserType >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::LNMBackend::DoubleBufferAccessorDecorator< UserType >, ChimeraTK::LNMBackend::ForceReadOnlyPluginDecorator< UserType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::CopyRegisterDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, std::string >, ChimeraTK::NDRegisterAccessorDecorator< std::string, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< std::string, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< T, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< T, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T, std::string >, ChimeraTK::NDRegisterAccessorDecorator< TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, double >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, uint32_t >, ChimeraTK::NDRegisterAccessorDecorator< UserType, UserType >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendMuxedRegisterAccessor< UserType, ConverterType >, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, ChimeraTK::NumericAddressedLowLevelTransferElement, AsyncTestDummy::Accessor< UserType >, Accessor< UserType >, DecoratorTestAccessor< UserType >, and ChimeraTK::TransferElementTestAccessor< UserType >.

◆ isWriteTransactionInProgress()

bool ChimeraTK::TransferElement::isWriteTransactionInProgress ( ) const
inline

Check whether a write transaction is in progress, i.e.

preWrite() has been called but not yet postWrite().

Definition at line 802 of file TransferElement.h.

◆ makeCopyRegisterDecorator()

◆ makeUniqueId()

void ChimeraTK::TransferElement::makeUniqueId ( )
inlineprotected

Allow generating a unique ID from derived classes.

Definition at line 824 of file TransferElement.h.

◆ mayReplaceOther()

virtual bool ChimeraTK::TransferElement::mayReplaceOther ( const boost::shared_ptr< TransferElement const > &  other) const
inlinevirtual

Check whether the TransferElement can be used in places where the TransferElement "other" is currently used, e.g.

to merge the two transfers. This function must be used in replaceTransferElement() by implementations which use other TransferElements, to determine if a used TransferElement shall be replaced with the TransferElement "other".

The purpose of this function is not to determine if at any point in the hierarchy an replacement could be done. This function only works on a single level. It is not used by the TransferGroup to determine replaceTransferElement() whether shall be used (it is always called). Instead this function can be used by decorators etc. inside their implementation of replaceTransferElement() to determine if they might swap their implementation(s).

Note for decorators and similar implementations: This function must not be decorated. It should only return true if this should actually be replaced with other in the call to replaceTransferElement() one level up in the hierarchy. If the replacement should be done further down in the hierarchy, simply return false. It should only return if other is fully identical to this (i.e. behaves identical in all situations but might be another instance).

Reimplemented in ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::NumericAddressedLowLevelTransferElement, DecoratorTestAccessor< UserType >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::LNMBackend::DoubleBufferAccessorDecorator< UserType >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendMuxedRegisterAccessor< UserType, ConverterType >, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, CountingDecorator< T >, and ChimeraTK::TransferElementTestAccessor< UserType >.

Definition at line 679 of file TransferElement.h.

◆ operator=() [1/2]

TransferElement & ChimeraTK::TransferElement::operator= ( const TransferElement other)
delete

◆ operator=() [2/2]

TransferElement & ChimeraTK::TransferElement::operator= ( TransferElement &&  other)
delete

◆ postRead()

void ChimeraTK::TransferElement::postRead ( TransferType  type,
bool  updateDataBuffer 
)
inline

Transfer the data from the device receive buffer into the user buffer, while converting the data into the user data format if needed.

Called by read() etc. Also the TransferGroup will call this function after a read was executed directly on the underlying accessor. This function must be implemented to extract the read data from the underlying accessor and expose it to the user.

Definition at line 474 of file TransferElement.h.

◆ postWrite()

void ChimeraTK::TransferElement::postWrite ( TransferType  type,
VersionNumber  versionNumber 
)
inline

Perform any post-write clean-ups if necessary.

If during preWrite() e.g. the user data buffer was swapped away, it must be swapped back in this function so the just sent data is available again to the calling program.

Called by write(). Also the TransferGroup will call this function after a write was executed directly on the underlying accessor.

Definition at line 575 of file TransferElement.h.

◆ preRead()

void ChimeraTK::TransferElement::preRead ( TransferType  type)
inline

Perform any pre-read tasks if necessary.

Called by read() etc. Also the TransferGroup will call this function before a read is executed directly on the underlying accessor.

Definition at line 433 of file TransferElement.h.

◆ preWrite()

void ChimeraTK::TransferElement::preWrite ( TransferType  type,
ChimeraTK::VersionNumber  versionNumber 
)
inline

Transfer the data from the user buffer into the device send buffer, while converting the data from then user data format if needed.

Called by write(). Also the TransferGroup will call this function before a write will be executed directly on the underlying accessor. This function implemented be used to transfer the data to be written into the underlying accessor.

Definition at line 531 of file TransferElement.h.

◆ read()

void ChimeraTK::TransferElement::read ( )
inline

Read the data from the device.

If AccessMode::wait_for_new_data was set, this function will block until new data has arrived. Otherwise it still might block for a short time until the data transfer was complete.

Definition at line 117 of file TransferElement.h.

◆ readLatest()

bool ChimeraTK::TransferElement::readLatest ( )
inline

Read the latest value, discarding any other update since the last read if present.

Otherwise this function is identical to readNonBlocking(), i.e. it will never wait for new values and it will return whether a new value was available if AccessMode::wait_for_new_data is set.

Definition at line 186 of file TransferElement.h.

◆ readNonBlocking()

bool ChimeraTK::TransferElement::readNonBlocking ( )
inline

Read the next value, if available in the input buffer.

If AccessMode::wait_for_new_data was set, this function returns immediately and the return value indicated if a new value was available (true) or not (false).

If AccessMode::wait_for_new_data was not set, this function is identical to read(), which will still return quickly. Depending on the actual transfer implementation, the backend might need to transfer data to obtain the current value before returning. Also this function is not guaranteed to be lock free. The return value will be always true in this mode.

Definition at line 147 of file TransferElement.h.

◆ readTransfer()

void ChimeraTK::TransferElement::readTransfer ( )
inline

Read the data from the device but do not fill it into the user buffer of this TransferElement.

This function must be called after preRead() and before postRead(). If the accessor has the AccessMode::wait_for_new_data flag, the function will block until new data has been pushed by the sender.

This function internally calls doReadTransferSynchronously(), which is implemented by the backend, or waits for data on the _readQueue, depending whether AccessMode::wait_for_new_data is set. runtime_error exceptions thrown in the transfer are caught and rethrown in postRead().

Definition at line 355 of file TransferElement.h.

◆ readTransferNonBlocking()

bool ChimeraTK::TransferElement::readTransferNonBlocking ( )
inline

Read the data from the device but do not fill it into the user buffer of this TransferElement.

This function must be called after preRead() and before postRead(). Even if the accessor has the AccessMode::wait_for_new_data flag, this function will not block if no new data is available. For the meaning of the return value, see readNonBlocking().

For TransferElements with AccessMode::wait_for_new_data this function checks whether there is new data on the _readQueue. Without AccessMode::wait_for_new_data it calls doReadTransferSynchronously, which is implemented by the backend. runtime_error exceptions thrown in the transfer are caught and rethrown in postRead().

Definition at line 403 of file TransferElement.h.

◆ replaceTransferElement()

virtual void ChimeraTK::TransferElement::replaceTransferElement ( boost::shared_ptr< TransferElement newElement)
inlinevirtual

◆ setActiveException()

void ChimeraTK::TransferElement::setActiveException ( std::exception_ptr &  setThisException)
inline

Set an active exception.

This function is called by all decorator-like TransferElements to propagate exceptions to their target. The argument is passed by reference. After returning from this function, it is {nullptr}. This function must not be called with nullptr (see spec FIXME).

Definition at line 279 of file TransferElement.h.

◆ setDataValidity()

void ChimeraTK::TransferElement::setDataValidity ( DataValidity  validity = DataValidity::ok)
inline

Set the current DataValidity for this TransferElement.

Will do nothing if the backend does not support it

Definition at line 108 of file TransferElement.h.

◆ setExceptionBackend()

virtual void ChimeraTK::TransferElement::setExceptionBackend ( boost::shared_ptr< DeviceBackend exceptionBackend)
inlinevirtual

Set the backend to which the exception has to be reported.

Each backend has to do this when creating TransferElements. However, not all TransferElements will have it set, for instance ProcessArrays in the ControlSystemAdapter and Application core,# which don't have backends at all. This function is only to be called inside of DeviceBackend::getRegisterAccessor()!

It is virtual because some accessor implementations like NumericAddressedBackendRegisterAccessor have an inner layer (LowLevelTransferElement), and all layers need to know the exception backend. Hence the functions needs to be overridden in this case.

Reimplemented in ChimeraTK::ExceptionDummyPushDecorator< UserType >, ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, std::string >, ChimeraTK::NDRegisterAccessorDecorator< std::string, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< std::string, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< T, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< T, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T, std::string >, ChimeraTK::NDRegisterAccessorDecorator< TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, double >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, uint32_t >, ChimeraTK::NDRegisterAccessorDecorator< UserType, UserType >, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, and ChimeraTK::LNMBackend::MathPluginDecorator< UserType >.

Definition at line 296 of file TransferElement.h.

◆ setInReadAnyGroup()

◆ setPersistentDataStorage()

virtual void ChimeraTK::TransferElement::setPersistentDataStorage ( boost::shared_ptr< ChimeraTK::PersistentDataStorage >  )
inlinevirtual

Associate a persistent data storage object to be updated on each write operation of this ProcessArray.

If no persistent data storage as associated previously, the value from the persistent storage is read and send to the receiver.

Note: A call to this function will be ignored, if the TransferElement does not support persistent data storage (e.g. read-only variables or device registers)

Todo:
TODO does this make sense?

Reimplemented in ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< ChimeraTK::Void, std::string >, ChimeraTK::NDRegisterAccessorDecorator< std::string, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< std::string, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T >, ChimeraTK::NDRegisterAccessorDecorator< T, ChimeraTK::Void >, ChimeraTK::NDRegisterAccessorDecorator< T, IMPL_T >, ChimeraTK::NDRegisterAccessorDecorator< T, std::string >, ChimeraTK::NDRegisterAccessorDecorator< TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, double >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, TargetUserType >, ChimeraTK::NDRegisterAccessorDecorator< UserType, uint32_t >, and ChimeraTK::NDRegisterAccessorDecorator< UserType, UserType >.

Definition at line 758 of file TransferElement.h.

◆ write()

bool ChimeraTK::TransferElement::write ( ChimeraTK::VersionNumber  versionNumber = {})
inline

Write the data to device.

The return value is true, old data was lost on the write transfer (e.g. due to an buffer overflow). In case of an unbuffered write transfer, the return value will always be false.

Definition at line 205 of file TransferElement.h.

◆ writeDestructively()

bool ChimeraTK::TransferElement::writeDestructively ( ChimeraTK::VersionNumber  versionNumber = {})
inline

Just like write(), but allows the implementation to destroy the content of the user buffer in the process.

This is an optional optimisation, hence there is a default implementation which just calls the normal doWriteTransfer(). In any case, the application must expect the user buffer of the TransferElement to contain undefined data after calling this function.

Definition at line 227 of file TransferElement.h.

◆ writeTransfer()

bool ChimeraTK::TransferElement::writeTransfer ( ChimeraTK::VersionNumber  versionNumber)
inline

Write the data to the device.

This function must be called after preWrite() and before postWrite(). If the return value is true, old data was lost on the write transfer (e.g. due to an buffer overflow). In case of an unbuffered write transfer, the return value will always be false.

This function internally calls doWriteTransfer(), which is implemented by the backend. runtime_error exceptions thrown in doWriteTransfer() are caught and rethrown in postWrite().

Definition at line 612 of file TransferElement.h.

◆ writeTransferDestructively()

bool ChimeraTK::TransferElement::writeTransferDestructively ( ChimeraTK::VersionNumber  versionNumber)
inline

Write the data to the device.

The implementation is allowed to destroy the content of the user buffer in the process. This is an optional optimisation, hence the behaviour might be identical to writeTransfer().

This function must be called after preWrite() and before postWrite(). If the return value is true, old data was lost on the write transfer (e.g. due to an buffer overflow). In case of an unbuffered write transfer, the return value will always be false.

This function internally calls doWriteTransfer(), which is implemented by the backend. runtime_error exceptions thrown in doWriteTransfer() are caught and rethrown in postWrite().

Definition at line 636 of file TransferElement.h.

Friends And Related Symbol Documentation

◆ ReadAnyGroup

friend class ReadAnyGroup
friend

Definition at line 841 of file TransferElement.h.

◆ TransferGroup

friend class TransferGroup
friend

Definition at line 840 of file TransferElement.h.

Member Data Documentation

◆ _accessModeFlags

AccessModeFlags ChimeraTK::TransferElement::_accessModeFlags
protected

The access mode flags for this transfer element.

Definition at line 838 of file TransferElement.h.

◆ _activeException

std::exception_ptr ChimeraTK::TransferElement::_activeException {nullptr}
protected

Exception to be rethrown in postXXX() in case hasSeenException == true Can be set via setActiveException().

Definition at line 871 of file TransferElement.h.

◆ _dataValidity

DataValidity ChimeraTK::TransferElement::_dataValidity {DataValidity::ok}
protected

The validity of the data in the application buffer.

Part of the application buffer (see TransferElement specification A.5)

Definition at line 867 of file TransferElement.h.

◆ _description

std::string ChimeraTK::TransferElement::_description
protected

Description of this variable/register.

Definition at line 818 of file TransferElement.h.

◆ _exceptionBackend

boost::shared_ptr<DeviceBackend> ChimeraTK::TransferElement::_exceptionBackend
protected

The backend to which the runtime_errors are reported via DeviceBackend::setException().

Creating backends set it in DeviceBackend::getRegisterAccessor(). Decorators have to set it in the constructor from their target.

Definition at line 314 of file TransferElement.h.

◆ _id

TransferElementID ChimeraTK::TransferElement::_id
protected

The ID of this TransferElement.

Definition at line 821 of file TransferElement.h.

◆ _inReadAnyGroup

ReadAnyGroup* ChimeraTK::TransferElement::_inReadAnyGroup {nullptr}
protected

ReadAnyGroup this TransferElement has been added to, nullptr if not in a ReadAnyGroup.

Note: The ReadAnyGroup has an owning pointer to its member TransferElements, so using a non-owning pointer here s ok.

Definition at line 835 of file TransferElement.h.

◆ _isInTransferGroup

bool ChimeraTK::TransferElement::_isInTransferGroup {false}
protected

Flag whether this TransferElement has been added to a TransferGroup or not.

Definition at line 828 of file TransferElement.h.

◆ _name

std::string ChimeraTK::TransferElement::_name
protected

Identifier uniquely identifying the TransferElement.

Definition at line 812 of file TransferElement.h.

◆ _readQueue

cppext::future_queue<void> ChimeraTK::TransferElement::_readQueue
protected

The queue for asynchronous read transfers.

This is the void queue which is a continuation of the actual data transport queue, which is implementation dependent. With _readQueue the exception propagation and waiting for new data is implemented in TransferElement.

Definition at line 859 of file TransferElement.h.

◆ _unit

std::string ChimeraTK::TransferElement::_unit
protected

Engineering unit.

Defaults to "n./a.", if none was specified

Definition at line 815 of file TransferElement.h.

◆ _versionNumber

VersionNumber ChimeraTK::TransferElement::_versionNumber {nullptr}
protected

The version number of the last successful transfer.

Part of the application buffer (see TransferElement specification A.5)

Definition at line 863 of file TransferElement.h.

◆ unitNotSet

constexpr char ChimeraTK::TransferElement::unitNotSet[] = "n./a."
staticconstexpr

Constant string to be used as a unit when the unit is not provided or known.

Definition at line 744 of file TransferElement.h.


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