Skip to content

Commit

Permalink
refs #4201 trying to fix MAC error
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Jan 2, 2012
1 parent d5bd3dd commit 08f6d67
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ namespace MDEvents
*/
/// vectors of strings are often used here
typedef std::vector<std::string> Strings;
// signature for an algorithm processing n-dimension event workspace
// typedef boost::function<void (ConvertToMDEvents*, API::IMDEventWorkspace *const)> pMethod;


/// signature for a function which implement void method
/// signature for a function which implement void method of this workspace
class MDEventWSWrapper;
typedef boost::function<void (MDEventWSWrapper*)> fpVoidMethod;
typedef boost::function<void () > fpVoidMethod;

class DLLExport MDEventWSWrapper
{
Expand All @@ -67,11 +64,11 @@ class DLLExport MDEventWSWrapper
//****> the methods below provide the equivalent of vftable for MDEvent workspace write interface.
// It should probably be moved to that interface if no substantial performance loss is identified (and seems there are no)
/// to access to splitBox method of multidimensional workspace
void splitBox(){boxSplitter[n_dimensions](this);}
void splitBox(){boxSplitter[n_dimensions]();}
/** returns the MDevent ws box controller for access and modifications */
Mantid::API::BoxController_sptr getBoxController(){return workspace->getBoxController();}
/// refresh cash on md event workspace
void refreshCache(){ cashRefresher[n_dimensions](this);}
void refreshCache(){ cashRefresher[n_dimensions]();}
private:
/// maximal nuber of dimensions, currently supported by the class;
static const int MAX_N_DIM=8;
Expand Down
15 changes: 8 additions & 7 deletions Code/Mantid/Framework/MDEvents/src/MDEventWSWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ MDEventWSWrapper::createEmptyMDWS(size_t n_dim, const Strings &targ_dim_names,co
this->targ_dim_units[i]= targ_dim_units[i];
}

wsCreator[n_dimensions](this);
wsCreator[n_dimensions]();

return workspace;
}
Expand All @@ -60,7 +60,7 @@ MDEventWSWrapper::addMDData(std::vector<float> &sig_err,std::vector<uint16_t> &r
this->data_size = data_size;

// run the actual addition
mdEvSummator[n_dimensions](this);
mdEvSummator[n_dimensions]();

}

Expand Down Expand Up @@ -91,25 +91,26 @@ class LOOP{
// why does it not work as one row?
//pH->wsCreator[i] = &MDEventWSWrapper::createEmptyEventWS<i>;
// fpVoidMethod fp = &MDEventWSWrapper::createEmptyEventWS<i>;
pH->wsCreator.push_back(&(MDEventWSWrapper::createEmptyEventWS<i>));
// fpVoidMethod fp = std::bind1st(std::mem_fun(&(*pH)::createEmptyEventWS<i>));
pH->wsCreator.push_back(std::bind(std::mem_fun(&MDEventWSWrapper::createEmptyEventWS<i>),pH));

// fpVoidMethod fp1 = &MDEventWSWrapper::add_MDData<i>;
pH->mdEvSummator.push_back(&(MDEventWSWrapper::add_MDData<i>));
pH->mdEvSummator.push_back(std::bind(std::mem_fun(&MDEventWSWrapper::add_MDData<i>),pH));

// vftable definition
//fpVoidMethod fp2 = &MDEventWSWrapper::split_Box<i>;
pH->boxSplitter.push_back(&(MDEventWSWrapper::split_Box<i>));// = fp2;
pH->boxSplitter.push_back(std::bind(std::mem_fun(&MDEventWSWrapper::split_Box<i>),pH));// = fp2;

//fpVoidMethod fp3 = &MDEventWSWrapper::refresh_Cache<i>;
pH->cashRefresher.push_back( &(MDEventWSWrapper::refresh_Cache<i>));
pH->cashRefresher.push_back(std::bind(std::mem_fun(&MDEventWSWrapper::refresh_Cache<i>),pH));

}
};
template<>
class LOOP<0>{
public:
static inline void EXEC(MDEventWSWrapper *pH){
fpVoidMethod fp = &MDEventWSWrapper::throwNotInitiatedError;
fpVoidMethod fp = (std::bind(std::mem_fun(&MDEventWSWrapper::throwNotInitiatedError),pH));
pH->wsCreator.push_back(fp);
pH->mdEvSummator.push_back(fp);
pH->boxSplitter.push_back(fp);
Expand Down

0 comments on commit 08f6d67

Please sign in to comment.