QhullError e= checkRunId(); // Check for qhRunId after libqhull returns. For convenience, ought to be at end of libqhull try block
if(e.isDefined()){
e.logError();
}
}//maybeThrowQhullMessage
#//Helpers
//! Return QhullError for maybeThrowFromDestructor()
QhullError UsingLibQhull::
checkRunId() const
{
// Predeclaring QhullError results in four copy constructors, none used here
#if qh_QHpointer
if(qh_qh){ // 0 if ~Qhull
if(my_qhull->qhull_run_id!=qh run_id){
return QhullError(10047, "Qhull internal error: Global state (qh_qh, run_id %d) changed. Should be runId %d. Another thread?", qh run_id, my_qhull->qhull_run_id);
return QhullError(10048, "Qhull internal error: Global state (qh_qh, run_id %d) changed. Should be runId %d. Another thread?", qh run_id, my_qhull->qhull_run_id);
}
#endif
return QhullError();
}//checkRunId
//! Can not embed UsingLibQhull. Otherwise allocated a C++ object missed by qh_errexit
void UsingLibQhull::
checkUsingLibQhull() const
{
if(s_using_libqhull){
if(s_qhull_output){
throw QhullError(10049, "Qhull error: UsingLibQhull already in use by QhullQh.runId %d", s_qhull_output->qhull_run_id);
}else{
throw QhullError(10050, "Qhull error: UsingLibQhull already in use. No s_qhull_output");