ChimeraTK-DeviceAccess
03.18.00
|
N-dimensional register accessor. More...
#include <ForwardDeclarations.h>
Classes | |
struct | Buffer |
Data type to create individual buffers. More... | |
Public Member Functions | |
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< TransferElement > | makeCopyRegisterDecorator () override |
Protected Member Functions | |
DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER (NDRegisterAccessor< UserType >, getAsCooked_impl, 2) | |
DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER (NDRegisterAccessor< UserType >, setAsCooked_impl, 3) | |
Protected Attributes | |
std::vector< std::vector< UserType > > | buffer_2D |
Buffer of converted data elements. More... | |
Friends | |
class | MultiplexedDataAccessor< UserType > |
the compatibility layers need access to the buffer_2D More... | |
class | RegisterAccessor |
N-dimensional register accessor.
Base class for all register accessor implementations. The user frontend classes BufferingRegisterAccessor and TwoDRegisterAccessor are using implementations based on this class to perform the actual IO.
Definition at line 17 of file ForwardDeclarations.h.
|
inline |
Creates an NDRegisterAccessor with the specified name (passed on to the transfer element).
Definition at line 24 of file NDRegisterAccessor.h.
|
inline |
Get or set register accessor's channel vector.
Definition at line 49 of file NDRegisterAccessor.h.
|
inline |
Definition at line 50 of file NDRegisterAccessor.h.
|
inline |
Get or set register accessor's 2D channel vector.
Definition at line 53 of file NDRegisterAccessor.h.
|
inline |
Definition at line 54 of file NDRegisterAccessor.h.
|
inline |
Get or set register accessor's buffer content (1D version).
Definition at line 36 of file NDRegisterAccessor.h.
|
inline |
Definition at line 37 of file NDRegisterAccessor.h.
|
inline |
Get or set register accessor's buffer content (2D version).
Definition at line 43 of file NDRegisterAccessor.h.
|
inline |
Definition at line 44 of file NDRegisterAccessor.h.
ChimeraTK::NDRegisterAccessor< UserType >::DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE | ( | getAsCooked_impl | , |
T const | unsigned int, unsigned int | ||
) |
ChimeraTK::NDRegisterAccessor< UserType >::DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE | ( | setAsCooked_impl | , |
void(unsigned int, unsigned int, T) | |||
) |
|
protected |
|
protected |
COOKED_TYPE ChimeraTK::NDRegisterAccessor< UserType >::getAsCooked | ( | unsigned int | channel, |
unsigned int | sample | ||
) | const |
Definition at line 136 of file NDRegisterAccessor.h.
COOKED_TYPE ChimeraTK::NDRegisterAccessor< UserType >::getAsCooked_impl | ( | unsigned int | channel, |
unsigned int | sample | ||
) | const |
|
inline |
Return number of channels.
Definition at line 60 of file NDRegisterAccessor.h.
|
inline |
Return number of elements per channel.
Definition at line 57 of file NDRegisterAccessor.h.
|
inlineoverride |
Definition at line 62 of file NDRegisterAccessor.h.
|
override |
Definition at line 11 of file NDRegisterAccessor.cc.
void ChimeraTK::NDRegisterAccessor< UserType >::setAsCooked | ( | unsigned int | channel, |
unsigned int | sample, | ||
COOKED_TYPE | value | ||
) |
Definition at line 148 of file NDRegisterAccessor.h.
void ChimeraTK::NDRegisterAccessor< UserType >::setAsCooked_impl | ( | unsigned int | channel, |
unsigned int | sample, | ||
COOKED_TYPE | value | ||
) |
|
friend |
the compatibility layers need access to the buffer_2D
Definition at line 127 of file NDRegisterAccessor.h.
|
friend |
Definition at line 128 of file NDRegisterAccessor.h.
|
protected |
Buffer of converted data elements.
The buffer is always two dimensional. If a register with a single dimension should be accessed, the outer vector has only a single element. For a scalar register, only a single element is present in total (buffer_2D[0][0]). This has a negligible performance impact when optimisations are enabled, but allows a coherent interface for all accessors independent of their dimension.
Implementation note: The buffer must be created with the right number of elements in the constructor!
Definition at line 123 of file NDRegisterAccessor.h.