ChimeraTK-DeviceAccess 03.25.00
Loading...
Searching...
No Matches
ChimeraTK::TwoDRegisterAccessor< UserType > Class Template Reference

Accessor class to read and write 2D registers. More...

#include <TwoDRegisterAccessor.h>

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

Public Member Functions

 TwoDRegisterAccessor (boost::shared_ptr< NDRegisterAccessor< UserType > > _accessor)
 Do not use this constructor directly.
 
 TwoDRegisterAccessor ()
 Placeholder constructer, to allow late initialisation of the accessor, e.g.
 
std::vector< UserType > & operator[] (size_t channel)
 Operator to access individual sequences/channels.
 
const std::vector< UserType > & operator[] (size_t channel) const
 Const operator to access individual sequences/channels.
 
TwoDRegisterAccessor< UserType > & operator= (const std::vector< std::vector< UserType > > &other)
 Assignment operator to assign the entire 2D array.
 
size_t getNChannels () const
 Return the number of channels (formerly called sequences)
 
size_t getNElementsPerChannel () const
 Return number of elements/samples per channel.
 
template<typename COOKED_TYPE >
COOKED_TYPE getAsCooked (unsigned int channel, unsigned int sample) const
 Get the cooked values in case the accessor is a raw accessor (which does not do data conversion).
 
template<typename COOKED_TYPE >
void setAsCooked (unsigned int channel, unsigned int sample, COOKED_TYPE value)
 Set the cooked values in case the accessor is a raw accessor (which does not do data conversion).
 
- Public Member Functions inherited from ChimeraTK::NDRegisterAccessorAbstractor< UserType >
 NDRegisterAccessorAbstractor ()=default
 Create an uninitialised abstractor - just for late initialisation.
 
 NDRegisterAccessorAbstractor (const NDRegisterAccessorAbstractor &)=default
 Declare that we want the default copy constructor although we delete the assigmnent operator.
 
void replace (const NDRegisterAccessorAbstractor< UserType > &newAccessor)
 Assign a new accessor to this NDRegisterAccessorAbstractor.
 
void replace (boost::shared_ptr< NDRegisterAccessor< UserType > > newImpl)
 Alternative signature of replace() with the same functionality, used when a pointer to the implementation has been obtained directly (instead of a NDRegisterAccessorAbstractor).
 
const NDRegisterAccessorAbstractoroperator= (const NDRegisterAccessorAbstractor &rightHandSide) const =delete
 Prevent copying by operator=, since it will be confusing (operator= may also be overloaded to access the content of the buffer!)
 
boost::shared_ptr< NDRegisterAccessor< UserType > > getImpl ()
 
- Public Member Functions inherited from ChimeraTK::TransferElementAbstractor
 TransferElementAbstractor (boost::shared_ptr< TransferElement > impl)
 Construct from TransferElement implementation.
 
 TransferElementAbstractor ()=default
 Create an uninitialised abstractor - just for late initialisation.
 
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.
 
const std::type_info & getValueType () const
 Returns the std::type_info for the value type of this transfer element.
 
AccessModeFlags getAccessModeFlags () const
 Return the AccessModeFlags for this TransferElement.
 
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.
 
ChimeraTK::VersionNumber getVersionNumber () const
 Returns the version number that is associated with the last transfer (i.e.
 
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.
 
bool isReadOnly () const
 Check if transfer element is read only, i.e.
 
bool isReadable () const
 Check if transfer element is readable.
 
bool isWriteable () const
 Check if transfer element is writeable.
 
std::vector< boost::shared_ptr< TransferElement > > getHardwareAccessingElements ()
 Obtain the underlying TransferElements with actual hardware access.
 
std::list< boost::shared_ptr< TransferElement > > getInternalElements ()
 Obtain the full list of TransferElements internally used by this TransferElement.
 
const boost::shared_ptr< TransferElement > & getHighLevelImplElement ()
 Obtain the highest level implementation TransferElement.
 
bool isInitialised () const
 Return if the accessor is properly initialised.
 
void replace (const TransferElementAbstractor &newAccessor)
 Assign a new accessor to this TransferElementAbstractor.
 
void replace (boost::shared_ptr< TransferElement > newImpl)
 Alternative signature of relace() with the same functionality, used when a pointer to the implementation has been obtained directly (instead of a TransferElementAbstractor).
 
void replaceTransferElement (const boost::shared_ptr< TransferElement > &newElement)
 Search for all underlying TransferElements which are considered identical (see mayReplaceOther()) with the given TransferElement.
 
void setPersistentDataStorage (boost::shared_ptr< ChimeraTK::PersistentDataStorage > storage)
 Associate a persistent data storage object to be updated on each write operation of this ProcessArray.
 
TransferElementID getId () const
 Obtain unique ID for the actual implementation of this TransferElement.
 
void setDataValidity (DataValidity valid=DataValidity::ok)
 Set the current DataValidity for this TransferElement.
 
DataValidity dataValidity () const
 Return current validity of the data.
 
void interrupt ()
 Return from a blocking read immediately and throw boost::thread_interrupted.
 
ReadAnyGroupgetReadAnyGroup () const
 Obtain the ReadAnyGroup this TransferElement is part of, or nullptr if not in a ReadAnyGroup.
 

Friends

class TransferGroup
 

Additional Inherited Members

- Public Types inherited from ChimeraTK::NDRegisterAccessorAbstractor< UserType >
using value_type = UserType
 
- Protected Member Functions inherited from ChimeraTK::NDRegisterAccessorAbstractor< UserType >
 NDRegisterAccessorAbstractor (boost::shared_ptr< NDRegisterAccessor< UserType > > impl)
 
NDRegisterAccessor< UserType > * get ()
 
const NDRegisterAccessor< UserType > * get () const
 
- Protected Attributes inherited from ChimeraTK::TransferElementAbstractor
boost::shared_ptr< TransferElement_impl
 Untyped pointer to implementation.
 

Detailed Description

template<user_type UserType>
class ChimeraTK::TwoDRegisterAccessor< UserType >

Accessor class to read and write 2D registers.

Examples
accessor2D.cpp, and accessor2D_multiplexed.cpp.

Definition at line 17 of file TwoDRegisterAccessor.h.

Constructor & Destructor Documentation

◆ TwoDRegisterAccessor() [1/2]

template<user_type UserType>
ChimeraTK::TwoDRegisterAccessor< UserType >::TwoDRegisterAccessor ( boost::shared_ptr< NDRegisterAccessor< UserType > >  _accessor)

Do not use this constructor directly.

Instead call Device::getTwoDRegisterAccessor().

Definition at line 69 of file TwoDRegisterAccessor.h.

◆ TwoDRegisterAccessor() [2/2]

template<user_type UserType>
ChimeraTK::TwoDRegisterAccessor< UserType >::TwoDRegisterAccessor ( )

Placeholder constructer, to allow late initialisation of the accessor, e.g.

in the open function.

Attention
Accessors created with this constructors will be dysfunctional, calling any member function will throw an exception (by the boost::shared_ptr)!

Definition at line 78 of file TwoDRegisterAccessor.h.

Member Function Documentation

◆ getAsCooked()

template<user_type UserType>
template<typename COOKED_TYPE >
COOKED_TYPE ChimeraTK::TwoDRegisterAccessor< UserType >::getAsCooked ( unsigned int  channel,
unsigned int  sample 
) const

Get the cooked values in case the accessor is a raw accessor (which does not do data conversion).

This returns the converted data from the use buffer. It does not do any read or write transfer.

Definition at line 96 of file TwoDRegisterAccessor.h.

◆ getNChannels()

template<user_type UserType>
size_t ChimeraTK::TwoDRegisterAccessor< UserType >::getNChannels ( ) const
inline

Return the number of channels (formerly called sequences)

Examples
accessor2D.cpp, and accessor2D_multiplexed.cpp.

Definition at line 41 of file TwoDRegisterAccessor.h.

◆ getNElementsPerChannel()

template<user_type UserType>
size_t ChimeraTK::TwoDRegisterAccessor< UserType >::getNElementsPerChannel ( ) const
inline

Return number of elements/samples per channel.

Examples
accessor2D.cpp.

Definition at line 44 of file TwoDRegisterAccessor.h.

◆ operator=()

template<user_type UserType>
TwoDRegisterAccessor< UserType > & ChimeraTK::TwoDRegisterAccessor< UserType >::operator= ( const std::vector< std::vector< UserType > > &  other)

Assignment operator to assign the entire 2D array.

Definition at line 86 of file TwoDRegisterAccessor.h.

◆ operator[]() [1/2]

template<user_type UserType>
std::vector< UserType > & ChimeraTK::TwoDRegisterAccessor< UserType >::operator[] ( size_t  channel)
inline

Operator to access individual sequences/channels.

Definition at line 32 of file TwoDRegisterAccessor.h.

◆ operator[]() [2/2]

template<user_type UserType>
const std::vector< UserType > & ChimeraTK::TwoDRegisterAccessor< UserType >::operator[] ( size_t  channel) const
inline

Const operator to access individual sequences/channels.

Definition at line 35 of file TwoDRegisterAccessor.h.

◆ setAsCooked()

template<user_type UserType>
template<typename COOKED_TYPE >
void ChimeraTK::TwoDRegisterAccessor< UserType >::setAsCooked ( unsigned int  channel,
unsigned int  sample,
COOKED_TYPE  value 
)

Set the cooked values in case the accessor is a raw accessor (which does not do data conversion).

This converts to raw and writes the data to the user buffer. It does not do any read or write transfer.

Definition at line 104 of file TwoDRegisterAccessor.h.

Friends And Related Symbol Documentation

◆ TransferGroup

template<user_type UserType>
friend class TransferGroup
friend

Definition at line 60 of file TwoDRegisterAccessor.h.


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