![]() |
ChimeraTK-DeviceAccess 03.20.00
|
Base class for register accessors which can be part of a TransferGroup. More...
#include <TransferElement.h>
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 | |
TransferElement & | operator= (const TransferElement &other)=delete |
TransferElement & | operator= (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< DeviceBackend > | getExceptionBackend () |
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< TransferElement > | getHighLevelImplElement () |
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< TransferElement > | makeCopyRegisterDecorator ()=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. | |
ReadAnyGroup * | getReadAnyGroup () 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 |
Base class for register accessors which can be part of a TransferGroup.
Definition at line 68 of file TransferElement.h.
using ChimeraTK::TransferElement::SharedPtr = boost::shared_ptr<TransferElement> |
A typedef for more compact syntax.
Definition at line 86 of file TransferElement.h.
|
inline |
Creates a transfer element with the specified name.
Definition at line 71 of file TransferElement.h.
|
delete |
Copying and moving is not allowed.
|
delete |
|
virtualdefault |
Abstract base classes need a virtual destructor.
|
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.
|
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:
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.
|
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.
|
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.
|
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.
|
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:
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 >.
|
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:
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 >.
|
inlineprotectedvirtual |
Implementation version of writeTransferDestructively().
This function must be implemented by the backend. For the functional description read the documentation of writeTransfer().
Implementation notes:
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.
|
inline |
Return the AccessModeFlags for this TransferElement.
Definition at line 104 of file TransferElement.h.
|
inline |
Returns the description of this variable/register.
Definition at line 96 of file TransferElement.h.
|
inline |
Return the exception backend.
Needed by decorators to set their _exceptionBackend to the target's.
Definition at line 302 of file TransferElement.h.
|
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 >.
|
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.
|
inline |
Obtain unique ID for this TransferElement, see TransferElementID for details.
Definition at line 764 of file TransferElement.h.
|
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 >.
|
inline |
Returns the name that identifies the process variable.
Definition at line 89 of file TransferElement.h.
|
inline |
Obtain the ReadAnyGroup this TransferElement is part of, or nullptr if not in a ReadAnyGroup.
Definition at line 805 of file TransferElement.h.
|
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.
|
inline |
Returns the engineering unit.
If none was specified, it will default to "n./a."
Definition at line 93 of file TransferElement.h.
|
pure virtual |
Returns the std::type_info
for the value type of this transfer element.
This can be used to determine the type at runtime.
Implemented in ChimeraTK::NDRegisterAccessor< UserType >, ChimeraTK::NDRegisterAccessor< ChimeraTK::Void >, ChimeraTK::NDRegisterAccessor< int32_t >, ChimeraTK::NDRegisterAccessor< std::string >, ChimeraTK::NDRegisterAccessor< T >, ChimeraTK::NDRegisterAccessor< TargetUserType >, and ChimeraTK::NumericAddressedLowLevelTransferElement.
|
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.
|
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.
|
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.
|
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 >.
|
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 >.
|
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.
|
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 >.
|
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.
|
pure virtual |
Create a CopyRegisterDecorator of the right type decorating this TransferElement.
This is used by TransferElementAbstractor::replaceTransferElement() to decouple two accessors which are replaced on the abstractor level.
Implemented in ChimeraTK::NDRegisterAccessor< UserType >, ChimeraTK::NDRegisterAccessor< ChimeraTK::Void >, ChimeraTK::NDRegisterAccessor< int32_t >, ChimeraTK::NDRegisterAccessor< std::string >, ChimeraTK::NDRegisterAccessor< T >, ChimeraTK::NDRegisterAccessor< TargetUserType >, and ChimeraTK::NumericAddressedLowLevelTransferElement.
|
inlineprotected |
Allow generating a unique ID from derived classes.
Definition at line 824 of file TransferElement.h.
|
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.
|
delete |
|
delete |
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
inlinevirtual |
Search for all underlying TransferElements which are considered identical (see sameRegister()) with the given TransferElement.
These TransferElements are then replaced with the new element. If no underlying element matches the new element, this function has no effect.
Reimplemented in ChimeraTK::LNMBackendBitAccessor< UserType >, ChimeraTK::LNMBackendChannelAccessor< UserType >, ChimeraTK::SubdeviceRegisterAccessor, ChimeraTK::NumericAddressedBackendASCIIAccessor, ChimeraTK::NumericAddressedBackendRegisterAccessor< UserType, DataConverterType, isRaw >, DecoratorTestAccessor< UserType >, CountingDecorator< T >, ChimeraTK::TransferElementTestAccessor< UserType >, ChimeraTK::LNMBackendVariableAccessor< UserType >, ChimeraTK::async::AsyncNDRegisterAccessor< UserType >, ChimeraTK::NumericAddressedBackendMuxedRegisterAccessor< UserType, ConverterType >, and ChimeraTK::NumericAddressedLowLevelTransferElement.
Definition at line 734 of file TransferElement.h.
|
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.
|
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.
|
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.
|
inlinevirtual |
Set the ReadAnyGroup of which this TransferElement is part of.
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 808 of file TransferElement.h.
|
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)
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.
|
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.
|
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.
|
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.
|
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.
|
friend |
Definition at line 841 of file TransferElement.h.
|
friend |
Definition at line 840 of file TransferElement.h.
|
protected |
The access mode flags for this transfer element.
Definition at line 838 of file TransferElement.h.
|
protected |
Exception to be rethrown in postXXX() in case hasSeenException == true Can be set via setActiveException().
Definition at line 871 of file TransferElement.h.
|
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.
|
protected |
Description of this variable/register.
Definition at line 818 of file TransferElement.h.
|
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.
|
protected |
The ID of this TransferElement.
Definition at line 821 of file TransferElement.h.
|
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.
|
protected |
Flag whether this TransferElement has been added to a TransferGroup or not.
Definition at line 828 of file TransferElement.h.
|
protected |
Identifier uniquely identifying the TransferElement.
Definition at line 812 of file TransferElement.h.
|
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.
|
protected |
Engineering unit.
Defaults to "n./a.", if none was specified
Definition at line 815 of file TransferElement.h.
|
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.
|
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.