sls_receiver_header* in callbacks (#425)

* char* to sls_receiver_header* in receiver data call backs

* uint32_t to size_t in callbacks

* string to const std::string & for callbacks
This commit is contained in:
Dhanya Thattil
2022-04-07 10:19:47 +02:00
committed by GitHub
parent 95ed9551c0
commit 62418c1316
10 changed files with 114 additions and 141 deletions

View File

@ -79,28 +79,16 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
const fileFormat fileFormatType,
MasterAttributes *attr,
std::mutex *hdf5LibMutex);
/**
* Call back for raw data
* args to raw data ready callback are
* sls_receiver_header frame metadata
* dataPointer is the pointer to the data
* dataSize in bytes is the size of the data in bytes.
*/
void registerCallBackRawDataReady(void (*func)(char *, char *, uint32_t,
void *),
/** params: sls_receiver_header pointer, pointer to data, image size */
void registerCallBackRawDataReady(void (*func)(sls_receiver_header *,
char *, size_t, void *),
void *arg);
/**
* Call back for raw data (modified)
* args to raw data ready callback are
* sls_receiver_header frame metadata
* dataPointer is the pointer to the data
* revDatasize is the reference of data size in bytes.
* Can be modified to the new size to be written/streamed. (only smaller
* value).
*/
void registerCallBackRawDataModifyReady(void (*func)(char *, char *,
uint32_t &, void *),
/** params: sls_receiver_header pointer, pointer to data, reference to image size */
void registerCallBackRawDataModifyReady(void (*func)(sls_receiver_header *,
char *, size_t &,
void *),
void *arg);
private:
@ -195,7 +183,8 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
* dataPointer is the pointer to the data
* dataSize in bytes is the size of the data in bytes.
*/
void (*rawDataReadyCallBack)(char *, char *, uint32_t, void *) = nullptr;
void (*rawDataReadyCallBack)(sls_receiver_header *, char *, size_t,
void *) = nullptr;
/**
* Call back for raw data (modified)
@ -205,7 +194,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
* revDatasize is the reference of data size in bytes. Can be modified to
* the new size to be written/streamed. (only smaller value).
*/
void (*rawDataModifyReadyCallBack)(char *, char *, uint32_t &,
void (*rawDataModifyReadyCallBack)(sls_receiver_header *, char *, size_t &,
void *) = nullptr;
void *pRawDataReady{nullptr};