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

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

#include <ForwardDeclarations.h>

Public Member Functions

 TwoDRegisterAccessor (boost::shared_ptr< NDRegisterAccessor< UserType >> _accessor)
 Do not use this constructor directly. More...
 
 TwoDRegisterAccessor ()
 Placeholder constructer, to allow late initialisation of the accessor, e.g. More...
 
std::vector< UserType > & operator[] (size_t channel)
 Operator to access individual sequences/channels. More...
 
const std::vector< UserType > & operator[] (size_t channel) const
 Const operator to access individual sequences/channels. More...
 
TwoDRegisterAccessor< UserType > & operator= (const std::vector< std::vector< UserType >> &other)
 Assignment operator to assign the entire 2D array. More...
 
size_t getNChannels () const
 Return the number of channels (formerly called sequences) More...
 
size_t getNElementsPerChannel () const
 Return number of elements/samples per channel. More...
 
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). More...
 
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). More...
 

Friends

class TransferGroup
 

Detailed Description

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

Accessor class to read and write 2D registers.

Examples
accessor2D.cpp, and accessor2D_multiplexed.cpp.

Definition at line 20 of file ForwardDeclarations.h.

Constructor & Destructor Documentation

◆ TwoDRegisterAccessor() [1/2]

template<class 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<class 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<class 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<class UserType >
size_t ChimeraTK::TwoDRegisterAccessor< UserType >::getNChannels ( ) const
inline

Return the number of channels (formerly called sequences)

Definition at line 41 of file TwoDRegisterAccessor.h.

+ Here is the caller graph for this function:

◆ getNElementsPerChannel()

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

Return number of elements/samples per channel.

Definition at line 44 of file TwoDRegisterAccessor.h.

+ Here is the caller graph for this function:

◆ operator=()

template<class 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<class 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<class 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<class 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 Function Documentation

◆ TransferGroup

template<class UserType >
friend class TransferGroup
friend

Definition at line 60 of file TwoDRegisterAccessor.h.


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