mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
Merge branch 'refactor' into address
This commit is contained in:
commit
45fd35b243
@ -168,6 +168,14 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
std::vector<RT> parallelCall(RT (slsDetector::*somefunc)(CT...) const,
|
||||
typename NonDeduced<CT>::type... Args) const;
|
||||
|
||||
|
||||
template <typename... CT>
|
||||
void parallelCall(void (slsDetector::*somefunc)(CT...), typename NonDeduced<CT>::type... Args);
|
||||
|
||||
template <typename... CT>
|
||||
void parallelCall(void (slsDetector::*somefunc)(CT...) const, typename NonDeduced<CT>::type... Args) const;
|
||||
|
||||
|
||||
/**
|
||||
* Decodes which detector and the corresponding channel numbers for it
|
||||
* Mainly useful in a multi detector setROI (Gotthard, Mythen?)
|
||||
|
@ -98,6 +98,33 @@ std::vector<RT> multiSlsDetector::parallelCall(RT (slsDetector::*somefunc)(CT...
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename... CT>
|
||||
void multiSlsDetector::parallelCall(void (slsDetector::*somefunc)(CT...),
|
||||
typename NonDeduced<CT>::type... Args) {
|
||||
std::vector<std::future<void>> futures;
|
||||
for (auto &d : detectors) {
|
||||
futures.push_back(std::async(std::launch::async, somefunc, d.get(), Args...));
|
||||
}
|
||||
for (auto &i : futures) {
|
||||
i.get();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
template <typename... CT>
|
||||
void multiSlsDetector::parallelCall(void (slsDetector::*somefunc)(CT...) const,
|
||||
typename NonDeduced<CT>::type... Args) const{
|
||||
std::vector<std::future<void>> futures;
|
||||
for (auto &d : detectors) {
|
||||
futures.push_back(std::async(std::launch::async, somefunc, d.get(), Args...));
|
||||
}
|
||||
for (auto &i : futures) {
|
||||
i.get();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int multiSlsDetector::decodeNChannel(int offsetX, int offsetY, int &channelX, int &channelY) {
|
||||
channelX = -1;
|
||||
channelY = -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user