compareRetrun.. to minusOneIf..

This commit is contained in:
Erik Frojdh 2018-05-28 11:55:11 +02:00
parent 5be2979fff
commit 06f84585af
2 changed files with 7 additions and 5 deletions

View File

@ -17,6 +17,8 @@ ID: $Id$
#include "slsDetector.h"
#include "usersFunctions.h"
#include <iostream>
#include <rapidjson/document.h> //json header in zmq stream
#include <string>
@ -3305,7 +3307,7 @@ int multiSlsDetector::exitServer()
return ival;
}
int multiSlsDetector::compareReturnValues(const std::vector<int>& return_values)
int multiSlsDetector::minusOneIfDifferent(const std::vector<int>& return_values)
{
int ret = -100;
for (int idet = 0; idet < thisMultiDetector->numberOfDetectors; ++idet) {
@ -3397,7 +3399,7 @@ int multiSlsDetector::parallelCallDetectorMember(int (slsDetector::*somefunc)(in
}
threadpool->startExecuting();
threadpool->wait_for_tasks_to_complete();
return compareReturnValues(return_values);
return minusOneIfDifferent(return_values);
}
}
@ -3417,7 +3419,7 @@ int multiSlsDetector::parallelCallDetectorMember(int (slsDetector::*somefunc)(in
}
threadpool->startExecuting();
threadpool->wait_for_tasks_to_complete();
return compareReturnValues(return_values);
return minusOneIfDifferent(return_values);
}
}
@ -3437,7 +3439,7 @@ int multiSlsDetector::parallelCallDetectorMember(int (slsDetector::*somefunc)())
}
threadpool->startExecuting();
threadpool->wait_for_tasks_to_complete();
return compareReturnValues(return_values);
return minusOneIfDifferent(return_values);
}
}

View File

@ -1050,7 +1050,7 @@ class multiSlsDetector : public slsDetectorUtils {
int parallelCallDetectorMember(int (slsDetector::*somefunc)());
int parallelCallDetectorMember(int (slsDetector::*somefunc)(int), int value); //Should probably be templated
int parallelCallDetectorMember(int (slsDetector::*somefunc)(int, int, int), int v0, int v1, int v2); //Should probably be templated
int compareReturnValues(const std::vector<int>&);
int minusOneIfDifferent(const std::vector<int>&);
/** returns the detector trimbit/settings directory \sa sharedSlsDetector */
std::string getSettingsDir();