Registers can have more than one value, so they are a one-dimensional "array" of data.
Like the ScalarRegisterAccessor, the OneDRegisterAccessor is a buffering accessor which is synchronised via read() and write() with the hardware. Access to data member works like a std::vector, incl. [] operator and iterators.
#include <ChimeraTK/Device.h>
#include <ChimeraTK/Utilities.h>
#include <iostream>
myDevice.open();
std::cout <<
"The clocks register has " << clocks.
getNElements() <<
" elements." << std::endl;
clocks[i] = 42 + i;
}
std::cout << "Clocks are";
for(auto clockValue : clocks) {
std::cout << " " << clockValue;
}
std::cout << std::endl;
myDevice.close();
return 0;
}
Class allows to read/write registers from device.
Accessor class to read and write registers transparently by using the accessor object like a vector o...
unsigned int getNElements()
Return number of elements/samples in the register.
bool write(ChimeraTK::VersionNumber versionNumber={})
Write the data to device.
void read()
Read the data from the device.
void setDMapFilePath(std::string dmapFilePath)
Set the location of the dmap file.
Next topic: 2D Register Accessors