ChimeraTK-DeviceAccess  03.18.00
ChimeraTK::TransferElementTestAccessor< UserType > Class Template Reference

Special accessor used to test the behaviour of the TransferElement base class and the TransferGroup. More...

#include <TransferElementTestAccessor.h>

+ Inheritance diagram for ChimeraTK::TransferElementTestAccessor< UserType >:
+ Collaboration diagram for ChimeraTK::TransferElementTestAccessor< UserType >:

Public Member Functions

 TransferElementTestAccessor (AccessModeFlags flags)
 
 ~TransferElementTestAccessor () override
 
void doPreRead (TransferType type) override
 
void doPreWrite (TransferType type, VersionNumber versionNumber) override
 
void doReadTransferSynchronously () override
 
bool doWriteTransfer (ChimeraTK::VersionNumber versionNumber) override
 
bool doWriteTransferDestructively (ChimeraTK::VersionNumber versionNumber) override
 
void doPostRead (TransferType type, bool updateDataBuffer) override
 
void doPostWrite (TransferType type, VersionNumber versionNumber) override
 
bool mayReplaceOther (const boost::shared_ptr< TransferElement const > &other) const override
 
std::vector< boost::shared_ptr< TransferElement > > getHardwareAccessingElements () override
 
std::list< boost::shared_ptr< TransferElement > > getInternalElements () override
 
void replaceTransferElement (boost::shared_ptr< TransferElement > newElement) override
 
bool isReadOnly () const override
 
bool isReadable () const override
 
bool isWriteable () const override
 
void interrupt () override
 
void resetCounters ()
 
void putRuntimeErrorOnQueue ()
 
void putDiscardValueOnQueue ()
 
bool push ()
 
- Public Member Functions inherited from ChimeraTK::NDRegisterAccessor< UserType >
 NDRegisterAccessor (std::string const &name, AccessModeFlags accessModeFlags, std::string const &unit=std::string(TransferElement::unitNotSet), std::string const &description=std::string())
 Creates an NDRegisterAccessor with the specified name (passed on to the transfer element). More...
 
UserType & accessData (size_t sample)
 Get or set register accessor's buffer content (1D version). More...
 
const UserType & accessData (size_t sample) const
 
UserType & accessData (unsigned int channel, unsigned int sample)
 Get or set register accessor's buffer content (2D version). More...
 
const UserType & accessData (unsigned int channel, unsigned int sample) const
 
std::vector< UserType > & accessChannel (unsigned int channel)
 Get or set register accessor's channel vector. More...
 
const std::vector< UserType > & accessChannel (unsigned int channel) const
 
std::vector< std::vector< UserType > > & accessChannels ()
 Get or set register accessor's 2D channel vector. More...
 
const std::vector< std::vector< UserType > > & accessChannels () const
 
unsigned int getNumberOfSamples () const
 Return number of elements per channel. More...
 
unsigned int getNumberOfChannels () const
 Return number of channels. More...
 
const std::type_info & getValueType () const override
 
template<typename COOKED_TYPE >
COOKED_TYPE getAsCooked (unsigned int channel, unsigned int sample) const
 
 DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE (getAsCooked_impl, T const(unsigned int, unsigned int))
 
template<typename COOKED_TYPE >
COOKED_TYPE getAsCooked_impl (unsigned int channel, unsigned int sample) const
 
template<typename COOKED_TYPE >
void setAsCooked (unsigned int channel, unsigned int sample, COOKED_TYPE value)
 
 DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE (setAsCooked_impl, void(unsigned int, unsigned int, T))
 
template<typename COOKED_TYPE >
void setAsCooked_impl (unsigned int channel, unsigned int sample, COOKED_TYPE value)
 
boost::shared_ptr< TransferElementmakeCopyRegisterDecorator () override
 

Public Attributes

bool _writeable {true}
 
bool _readable {true}
 
size_t _preRead_counter {0}
 
size_t _preWrite_counter {0}
 
size_t _readTransfer_counter {0}
 
size_t _writeTransfer_counter {0}
 
size_t _writeTransferDestructively_counter {0}
 
size_t _postRead_counter {0}
 
size_t _postWrite_counter {0}
 
size_t _preIndex {999999}
 
size_t _transferIndex {999999}
 
size_t _postIndex {999999}
 
TransferType _transferType_pre
 
TransferType _transferType_post
 
bool _updateDataBuffer
 
VersionNumber _preWrite_version {nullptr}
 
VersionNumber _writeTransfer_version {nullptr}
 
VersionNumber _postWrite_version {nullptr}
 
std::exception_ptr _seenActiveException {nullptr}
 
std::exception_ptr _thrownException {nullptr}
 
bool _previousDataLost {false}
 
bool _throwLogicErr {false}
 
bool _throwRuntimeErrInTransfer {false}
 
bool _throwRuntimeErrInPre {false}
 
bool _throwRuntimeErrInPreconditions {false}
 
bool _throwNumericCast {false}
 
VersionNumber _setPostReadVersion {nullptr}
 
UserType _setPostReadData {UserType()}
 
std::list< TransferElementID_listReplacementElements
 
std::vector< boost::shared_ptr< TransferElementTestAccessor< UserType > > > _internalElements
 
std::vector< boost::shared_ptr< TransferElement > > _hardwareAccessingElements
 
std::set< TransferElementID_listMayReplaceElements
 
std::exception_ptr _activeException
 Exception to be rethrown in postXXX() in case hasSeenException == true Can be set via setActiveException(). More...
 
cppext::future_queue< void > _readQueue
 The queue for asynchronous read transfers. More...
 
AccessModeFlags _accessModeFlags
 The access mode flags for this transfer element. More...
 

Static Public Attributes

static std::atomic< size_t > _currentIndex
 

Additional Inherited Members

- Protected Member Functions inherited from ChimeraTK::NDRegisterAccessor< UserType >
 DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER (NDRegisterAccessor< UserType >, getAsCooked_impl, 2)
 
 DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER (NDRegisterAccessor< UserType >, setAsCooked_impl, 3)
 
- Protected Attributes inherited from ChimeraTK::NDRegisterAccessor< UserType >
std::vector< std::vector< UserType > > buffer_2D
 Buffer of converted data elements. More...
 

Detailed Description

template<typename UserType>
class ChimeraTK::TransferElementTestAccessor< UserType >

Special accessor used to test the behaviour of the TransferElement base class and the TransferGroup.

Definition at line 11 of file TransferElementTestAccessor.h.

Constructor & Destructor Documentation

◆ TransferElementTestAccessor()

template<typename UserType >
ChimeraTK::TransferElementTestAccessor< UserType >::TransferElementTestAccessor ( AccessModeFlags  flags)
inline

Definition at line 13 of file TransferElementTestAccessor.h.

◆ ~TransferElementTestAccessor()

template<typename UserType >
ChimeraTK::TransferElementTestAccessor< UserType >::~TransferElementTestAccessor ( )
inlineoverride

Definition at line 20 of file TransferElementTestAccessor.h.

Member Function Documentation

◆ doPostRead()

template<typename UserType >
void ChimeraTK::TransferElementTestAccessor< UserType >::doPostRead ( TransferType  type,
bool  updateDataBuffer 
)
inlineoverride

Definition at line 97 of file TransferElementTestAccessor.h.

◆ doPostWrite()

template<typename UserType >
void ChimeraTK::TransferElementTestAccessor< UserType >::doPostWrite ( TransferType  type,
VersionNumber  versionNumber 
)
inlineoverride

Definition at line 123 of file TransferElementTestAccessor.h.

◆ doPreRead()

template<typename UserType >
void ChimeraTK::TransferElementTestAccessor< UserType >::doPreRead ( TransferType  type)
inlineoverride

Definition at line 22 of file TransferElementTestAccessor.h.

◆ doPreWrite()

template<typename UserType >
void ChimeraTK::TransferElementTestAccessor< UserType >::doPreWrite ( TransferType  type,
VersionNumber  versionNumber 
)
inlineoverride

Definition at line 37 of file TransferElementTestAccessor.h.

◆ doReadTransferSynchronously()

template<typename UserType >
void ChimeraTK::TransferElementTestAccessor< UserType >::doReadTransferSynchronously ( )
inlineoverride

Definition at line 54 of file TransferElementTestAccessor.h.

◆ doWriteTransfer()

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::doWriteTransfer ( ChimeraTK::VersionNumber  versionNumber)
inlineoverride

Definition at line 67 of file TransferElementTestAccessor.h.

◆ doWriteTransferDestructively()

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::doWriteTransferDestructively ( ChimeraTK::VersionNumber  versionNumber)
inlineoverride

Definition at line 82 of file TransferElementTestAccessor.h.

◆ getHardwareAccessingElements()

template<typename UserType >
std::vector<boost::shared_ptr<TransferElement> > ChimeraTK::TransferElementTestAccessor< UserType >::getHardwareAccessingElements ( )
inlineoverride

Definition at line 135 of file TransferElementTestAccessor.h.

◆ getInternalElements()

template<typename UserType >
std::list<boost::shared_ptr<TransferElement> > ChimeraTK::TransferElementTestAccessor< UserType >::getInternalElements ( )
inlineoverride

Definition at line 142 of file TransferElementTestAccessor.h.

◆ interrupt()

template<typename UserType >
void ChimeraTK::TransferElementTestAccessor< UserType >::interrupt ( )
inlineoverride

Definition at line 166 of file TransferElementTestAccessor.h.

◆ isReadable()

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::isReadable ( ) const
inlineoverride

Definition at line 156 of file TransferElementTestAccessor.h.

◆ isReadOnly()

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::isReadOnly ( ) const
inlineoverride

Definition at line 151 of file TransferElementTestAccessor.h.

◆ isWriteable()

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::isWriteable ( ) const
inlineoverride

Definition at line 161 of file TransferElementTestAccessor.h.

◆ mayReplaceOther()

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::mayReplaceOther ( const boost::shared_ptr< TransferElement const > &  other) const
inlineoverride

Definition at line 132 of file TransferElementTestAccessor.h.

◆ push()

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::push ( )
inline

Definition at line 262 of file TransferElementTestAccessor.h.

+ Here is the caller graph for this function:

◆ putDiscardValueOnQueue()

template<typename UserType >
void ChimeraTK::TransferElementTestAccessor< UserType >::putDiscardValueOnQueue ( )
inline

Definition at line 252 of file TransferElementTestAccessor.h.

◆ putRuntimeErrorOnQueue()

template<typename UserType >
void ChimeraTK::TransferElementTestAccessor< UserType >::putRuntimeErrorOnQueue ( )
inline

Definition at line 243 of file TransferElementTestAccessor.h.

◆ replaceTransferElement()

template<typename UserType >
void ChimeraTK::TransferElementTestAccessor< UserType >::replaceTransferElement ( boost::shared_ptr< TransferElement newElement)
inlineoverride

Definition at line 147 of file TransferElementTestAccessor.h.

◆ resetCounters()

template<typename UserType >
void ChimeraTK::TransferElementTestAccessor< UserType >::resetCounters ( )
inline

Definition at line 212 of file TransferElementTestAccessor.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _accessModeFlags

template<typename UserType >
AccessModeFlags ChimeraTK::TransferElement::_accessModeFlags

The access mode flags for this transfer element.

Definition at line 826 of file TransferElement.h.

◆ _activeException

template<typename UserType >
std::exception_ptr ChimeraTK::TransferElement::_activeException

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

Definition at line 859 of file TransferElement.h.

◆ _currentIndex

template<typename T >
std::atomic< size_t > ChimeraTK::TransferElementTestAccessor< T >::_currentIndex
static

Definition at line 182 of file TransferElementTestAccessor.h.

◆ _hardwareAccessingElements

template<typename UserType >
std::vector<boost::shared_ptr<TransferElement> > ChimeraTK::TransferElementTestAccessor< UserType >::_hardwareAccessingElements

Definition at line 207 of file TransferElementTestAccessor.h.

◆ _internalElements

template<typename UserType >
std::vector<boost::shared_ptr<TransferElementTestAccessor<UserType> > > ChimeraTK::TransferElementTestAccessor< UserType >::_internalElements

Definition at line 205 of file TransferElementTestAccessor.h.

◆ _listMayReplaceElements

template<typename UserType >
std::set<TransferElementID> ChimeraTK::TransferElementTestAccessor< UserType >::_listMayReplaceElements

Definition at line 209 of file TransferElementTestAccessor.h.

◆ _listReplacementElements

template<typename UserType >
std::list<TransferElementID> ChimeraTK::TransferElementTestAccessor< UserType >::_listReplacementElements

Definition at line 204 of file TransferElementTestAccessor.h.

◆ _postIndex

template<typename UserType >
size_t ChimeraTK::TransferElementTestAccessor< UserType >::_postIndex {999999}

Definition at line 181 of file TransferElementTestAccessor.h.

◆ _postRead_counter

template<typename UserType >
size_t ChimeraTK::TransferElementTestAccessor< UserType >::_postRead_counter {0}

Definition at line 177 of file TransferElementTestAccessor.h.

◆ _postWrite_counter

template<typename UserType >
size_t ChimeraTK::TransferElementTestAccessor< UserType >::_postWrite_counter {0}

Definition at line 178 of file TransferElementTestAccessor.h.

◆ _postWrite_version

template<typename UserType >
VersionNumber ChimeraTK::TransferElementTestAccessor< UserType >::_postWrite_version {nullptr}

Definition at line 189 of file TransferElementTestAccessor.h.

◆ _preIndex

template<typename UserType >
size_t ChimeraTK::TransferElementTestAccessor< UserType >::_preIndex {999999}

Definition at line 179 of file TransferElementTestAccessor.h.

◆ _preRead_counter

template<typename UserType >
size_t ChimeraTK::TransferElementTestAccessor< UserType >::_preRead_counter {0}

Definition at line 172 of file TransferElementTestAccessor.h.

◆ _previousDataLost

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::_previousDataLost {false}

Definition at line 194 of file TransferElementTestAccessor.h.

◆ _preWrite_counter

template<typename UserType >
size_t ChimeraTK::TransferElementTestAccessor< UserType >::_preWrite_counter {0}

Definition at line 173 of file TransferElementTestAccessor.h.

◆ _preWrite_version

template<typename UserType >
VersionNumber ChimeraTK::TransferElementTestAccessor< UserType >::_preWrite_version {nullptr}

Definition at line 187 of file TransferElementTestAccessor.h.

◆ _readable

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::_readable {true}

Definition at line 169 of file TransferElementTestAccessor.h.

◆ _readQueue

template<typename UserType >
cppext::future_queue<void> ChimeraTK::TransferElement::_readQueue

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 847 of file TransferElement.h.

◆ _readTransfer_counter

template<typename UserType >
size_t ChimeraTK::TransferElementTestAccessor< UserType >::_readTransfer_counter {0}

Definition at line 174 of file TransferElementTestAccessor.h.

◆ _seenActiveException

template<typename UserType >
std::exception_ptr ChimeraTK::TransferElementTestAccessor< UserType >::_seenActiveException {nullptr}

Definition at line 190 of file TransferElementTestAccessor.h.

◆ _setPostReadData

template<typename UserType >
UserType ChimeraTK::TransferElementTestAccessor< UserType >::_setPostReadData {UserType()}

Definition at line 201 of file TransferElementTestAccessor.h.

◆ _setPostReadVersion

template<typename UserType >
VersionNumber ChimeraTK::TransferElementTestAccessor< UserType >::_setPostReadVersion {nullptr}

Definition at line 200 of file TransferElementTestAccessor.h.

◆ _throwLogicErr

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::_throwLogicErr {false}

Definition at line 195 of file TransferElementTestAccessor.h.

◆ _thrownException

template<typename UserType >
std::exception_ptr ChimeraTK::TransferElementTestAccessor< UserType >::_thrownException {nullptr}

Definition at line 191 of file TransferElementTestAccessor.h.

◆ _throwNumericCast

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::_throwNumericCast {false}

Definition at line 199 of file TransferElementTestAccessor.h.

◆ _throwRuntimeErrInPre

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::_throwRuntimeErrInPre {false}

Definition at line 197 of file TransferElementTestAccessor.h.

◆ _throwRuntimeErrInPreconditions

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::_throwRuntimeErrInPreconditions {false}

Definition at line 198 of file TransferElementTestAccessor.h.

◆ _throwRuntimeErrInTransfer

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::_throwRuntimeErrInTransfer {false}

Definition at line 196 of file TransferElementTestAccessor.h.

◆ _transferIndex

template<typename UserType >
size_t ChimeraTK::TransferElementTestAccessor< UserType >::_transferIndex {999999}

Definition at line 180 of file TransferElementTestAccessor.h.

◆ _transferType_post

template<typename UserType >
TransferType ChimeraTK::TransferElementTestAccessor< UserType >::_transferType_post

Definition at line 185 of file TransferElementTestAccessor.h.

◆ _transferType_pre

template<typename UserType >
TransferType ChimeraTK::TransferElementTestAccessor< UserType >::_transferType_pre

Definition at line 185 of file TransferElementTestAccessor.h.

◆ _updateDataBuffer

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::_updateDataBuffer

Definition at line 186 of file TransferElementTestAccessor.h.

◆ _writeable

template<typename UserType >
bool ChimeraTK::TransferElementTestAccessor< UserType >::_writeable {true}

Definition at line 168 of file TransferElementTestAccessor.h.

◆ _writeTransfer_counter

template<typename UserType >
size_t ChimeraTK::TransferElementTestAccessor< UserType >::_writeTransfer_counter {0}

Definition at line 175 of file TransferElementTestAccessor.h.

◆ _writeTransfer_version

template<typename UserType >
VersionNumber ChimeraTK::TransferElementTestAccessor< UserType >::_writeTransfer_version {nullptr}

Definition at line 188 of file TransferElementTestAccessor.h.

◆ _writeTransferDestructively_counter

template<typename UserType >
size_t ChimeraTK::TransferElementTestAccessor< UserType >::_writeTransferDestructively_counter {0}

Definition at line 176 of file TransferElementTestAccessor.h.


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