Skip to content
Snippets Groups Projects
Commit c61643c4 authored by whooie's avatar whooie
Browse files

consistent void* return type for data buffers

parent b521560d
No related branches found
No related tags found
No related merge requests found
......@@ -265,7 +265,7 @@ double ArrayWaveform::setMovingSegment(
return nextPhase;
}
std::pair<int16_t*, int64_t> ArrayWaveform::getStaticWaveform() {
std::pair<void*, int64_t> ArrayWaveform::getStaticWaveform() {
auto minSampleLen = 2 * this->wfmParam.samplingRate
/ std::gcd(
this->wfmParam.samplingRate,
......@@ -283,13 +283,13 @@ std::pair<int16_t*, int64_t> ArrayWaveform::getStaticWaveform() {
+ this->wfmParam.phases.array())
).array().colwise() * this->wfmParam.amplitudes.array();
bindBuffer(minSampleLen * 2); // bytes
auto pData = (int16_t*) this->pDataBuffer;
auto pData = (void*) this->pDataBuffer;
Eigen::Map<EigenVectorXi16> dataMap(pData, minSampleLen);
dataMap = wfmMatrixrix.colwise().sum().cast<int16_t>();
return std::pair(pData, int64_t(minSampleLen));
}
std::pair<int16_t*, int64_t> ArrayWaveform::getTrickWaveform(
std::pair<void*, int64_t> ArrayWaveform::getTrickWaveform(
std::set<int> siteIndex,
double df,
double tauMove,
......@@ -354,7 +354,7 @@ std::pair<int16_t*, int64_t> ArrayWaveform::getTrickWaveform(
}
}
bindBuffer(sampleLen * 2);
auto pData = (int16_t*) this->pDataBuffer;
auto pData = (void*) this->pDataBuffer;
Eigen::Map<EigenVectorXi16> dataMap(pData, sampleLen);
dataMap = wfmMatrix.rowwise().sum().cast<int16_t> ();
return std::pair(pData, int64_t(sampleLen));
......
......@@ -225,7 +225,7 @@ class ArrayWaveform {
*
* @return std::pair(pDataBuffer: int16_t*, dataLength: int64_t)
*/
std::pair<int16_t*, int64_t> getStaticWaveform();
std::pair<void*, int64_t> getStaticWaveform();
/**
* @brief generate a tricky-trick waveform from current set of
......@@ -237,7 +237,7 @@ class ArrayWaveform {
* @param tauStay wait time (s)
* @return std::pair(pDataBuffer: int16_t*, dataLength: int64_t)
*/
std::pair<int16_t*, int64_t> getTrickWaveform(
std::pair<void*, int64_t> getTrickWaveform(
std::set<int> siteIndex,
double df,
double tauMove=0,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment