ChimeraTK-DeviceAccess  03.18.00
ChimeraTK::DummyRegisterRawAccessor Class Reference

Accessor for raw 32 bit integer access to the underlying memory space. More...

#include <DummyRegisterAccessor.h>

+ Collaboration diagram for ChimeraTK::DummyRegisterRawAccessor:

Public Member Functions

 operator int32_t & ()
 Implicit type conversion to int32_t. More...
 
 DummyRegisterRawAccessor (boost::shared_ptr< DeviceBackend > const &backend, std::string const &module, std::string const &name)
 
 DummyRegisterRawAccessor (const DummyRegisterRawAccessor &)=default
 
void operator= (const DummyRegisterRawAccessor &rightHandSide) const =delete
 remove assignment operator since it will be confusing More...
 
DummyRegisterRawAccessoroperator= (int32_t rhs)
 
int32_t & operator[] (unsigned int index)
 Get or set register content by [] operator. More...
 
unsigned int getNumberOfElements () const
 return number of elements More...
 
std::unique_lock< std::mutex > getBufferLock ()
 Get a lock to safely modify the buffer. More...
 

Protected Attributes

boost::shared_ptr< DummyBackend_backend
 pointer to dummy backend More...
 
NumericAddressedRegisterInfo registerInfo
 register map information More...
 
int32_t * buffer
 raw buffer of this accessor More...
 

Detailed Description

Accessor for raw 32 bit integer access to the underlying memory space.

Usually you want the interpreted version, but for debugging the converters themselves and functionality of the NumericAddressedBackendRegisterAccessor we directly want to write to the registers, without having to mess with absolute addresses (we still depend on the map file parser, but the whole dummy does. The address translation is re-done in the dummy, we are not using the one from the regular accessors.)

WARNING: You must not touch any data content of the accessor without holding a lock to the memory mutex for the internal data buffer (see getBufferLock()).

Definition at line 324 of file DummyRegisterAccessor.h.

Constructor & Destructor Documentation

◆ DummyRegisterRawAccessor() [1/2]

ChimeraTK::DummyRegisterRawAccessor::DummyRegisterRawAccessor ( boost::shared_ptr< DeviceBackend > const &  backend,
std::string const &  module,
std::string const &  name 
)
inline

Definition at line 331 of file DummyRegisterAccessor.h.

◆ DummyRegisterRawAccessor() [2/2]

ChimeraTK::DummyRegisterRawAccessor::DummyRegisterRawAccessor ( const DummyRegisterRawAccessor )
default

Member Function Documentation

◆ getBufferLock()

std::unique_lock<std::mutex> ChimeraTK::DummyRegisterRawAccessor::getBufferLock ( )
inline

Get a lock to safely modify the buffer.

You have to release it as soon as possible because it will block all other functionality of the Dummy. This is a really low low level debugging interface!

Definition at line 363 of file DummyRegisterAccessor.h.

◆ getNumberOfElements()

unsigned int ChimeraTK::DummyRegisterRawAccessor::getNumberOfElements ( ) const
inline

return number of elements

Definition at line 358 of file DummyRegisterAccessor.h.

◆ operator int32_t &()

ChimeraTK::DummyRegisterRawAccessor::operator int32_t & ( )
inline

Implicit type conversion to int32_t.

This basically covers all operators for single integers.

Definition at line 329 of file DummyRegisterAccessor.h.

◆ operator=() [1/2]

void ChimeraTK::DummyRegisterRawAccessor::operator= ( const DummyRegisterRawAccessor rightHandSide) const
delete

remove assignment operator since it will be confusing

◆ operator=() [2/2]

DummyRegisterRawAccessor& ChimeraTK::DummyRegisterRawAccessor::operator= ( int32_t  rhs)
inline

Definition at line 349 of file DummyRegisterAccessor.h.

◆ operator[]()

int32_t& ChimeraTK::DummyRegisterRawAccessor::operator[] ( unsigned int  index)
inline

Get or set register content by [] operator.

Definition at line 355 of file DummyRegisterAccessor.h.

Member Data Documentation

◆ _backend

boost::shared_ptr<DummyBackend> ChimeraTK::DummyRegisterRawAccessor::_backend
protected

pointer to dummy backend

Definition at line 367 of file DummyRegisterAccessor.h.

◆ buffer

int32_t* ChimeraTK::DummyRegisterRawAccessor::buffer
protected

raw buffer of this accessor

Definition at line 373 of file DummyRegisterAccessor.h.

◆ registerInfo

NumericAddressedRegisterInfo ChimeraTK::DummyRegisterRawAccessor::registerInfo
protected

register map information

Definition at line 370 of file DummyRegisterAccessor.h.


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