Skip to content

Commit

Permalink
Boost fixes. Refs #7115
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiSavici committed May 17, 2013
1 parent 4732c32 commit 7fc2b6f
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/BoxController.h
Expand Up @@ -353,7 +353,7 @@ namespace API
// { return m_useWriteBuffer; }
/// Returns if current box controller is file backed. Assumes that BC(workspace) is fileBackd if fileIO is defined;
bool isFileBacked()const
{return m_fileIO;}
{return (m_fileIO!=0);}
/// returns the pointer to the class, responsible for fileIO operations;
IBoxControllerIO * getFileIO()
{return m_fileIO.get();}
Expand Down
Expand Up @@ -182,8 +182,8 @@ namespace Algorithms
// Get all the workspaces which are to be inspected for log proeprties.
for( auto wsName = wsNames.begin(); wsName != wsNames.end(); ++wsName )
{
WorkspaceGroup_sptr wsGroup = boost::shared_dynamic_cast<WorkspaceGroup>( AnalysisDataService::Instance().retrieve(*wsName) );
MatrixWorkspace_sptr matrixWs = boost::shared_dynamic_cast<MatrixWorkspace>( AnalysisDataService::Instance().retrieve(*wsName) );
WorkspaceGroup_sptr wsGroup = boost::dynamic_pointer_cast<WorkspaceGroup>( AnalysisDataService::Instance().retrieve(*wsName) );
MatrixWorkspace_sptr matrixWs = boost::dynamic_pointer_cast<MatrixWorkspace>( AnalysisDataService::Instance().retrieve(*wsName) );

if( wsGroup )
{
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/Algorithms/test/RebinTest.h
Expand Up @@ -214,7 +214,7 @@ class RebinTest : public CxxTest::TestSuite

MatrixWorkspace_sptr outWS;
EventWorkspace_sptr eventOutWS;
TS_ASSERT_THROWS_NOTHING( outWS = boost::shared_dynamic_cast<MatrixWorkspace>( AnalysisDataService::Instance().retrieve(outName) ));
TS_ASSERT_THROWS_NOTHING( outWS = boost::dynamic_pointer_cast<MatrixWorkspace>( AnalysisDataService::Instance().retrieve(outName) ));
TS_ASSERT( outWS );
if (!outWS) return;

Expand Down Expand Up @@ -341,7 +341,7 @@ class RebinTest : public CxxTest::TestSuite

TS_ASSERT( reb->isExecuted() );

MatrixWorkspace_sptr outWS = boost::shared_dynamic_cast<MatrixWorkspace>( AnalysisDataService::Instance().retrieve("test_RebinPointDataOutput") );
MatrixWorkspace_sptr outWS = boost::dynamic_pointer_cast<MatrixWorkspace>( AnalysisDataService::Instance().retrieve("test_RebinPointDataOutput") );

TS_ASSERT(! outWS->isHistogramData() );
TS_ASSERT_EQUALS( outWS->getNumberHistograms(), 1 );
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/Crystal/src/CentroidPeaks.cpp
Expand Up @@ -378,7 +378,7 @@ namespace Crystal
boost::shared_ptr<const IComponent> parent = Iptr->getComponentByName(bankName);
if (parent->type().compare("RectangularDetector") == 0)
{
boost::shared_ptr<const RectangularDetector> RDet = boost::shared_dynamic_cast<
boost::shared_ptr<const RectangularDetector> RDet = boost::dynamic_pointer_cast<
const RectangularDetector>(parent);

boost::shared_ptr<Detector> pixel = RDet->getAtXY(col, row);
Expand All @@ -405,7 +405,7 @@ namespace Crystal
boost::shared_ptr<const IComponent> parent = Iptr->getComponentByName(bankName);
if (parent->type().compare("RectangularDetector") == 0)
{
boost::shared_ptr<const RectangularDetector> RDet = boost::shared_dynamic_cast<
boost::shared_ptr<const RectangularDetector> RDet = boost::dynamic_pointer_cast<
const RectangularDetector>(parent);

if (col < Edge || col >= (RDet->xpixels()-Edge) || row < Edge || row >= (RDet->ypixels()-Edge)) return true;
Expand Down
Expand Up @@ -1942,7 +1942,7 @@ namespace Mantid
StatBase[ISSIxx]= -1;
return;
}
boost::shared_ptr<Workspace2D> ws = boost::shared_dynamic_cast<Workspace2D>(Data);
boost::shared_ptr<Workspace2D> ws = boost::dynamic_pointer_cast<Workspace2D>(Data);

int NBadEdges = getProperty("NBadEdgePixels");
spec_idList.clear();
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Crystal/src/MaskPeaksWorkspace.cpp
Expand Up @@ -284,7 +284,7 @@ namespace Mantid
boost::shared_ptr<const IComponent> parent = Iptr->getComponentByName(bankName);
if (parent->type().compare("RectangularDetector") == 0)
{
boost::shared_ptr<const RectangularDetector> RDet = boost::shared_dynamic_cast<
boost::shared_ptr<const RectangularDetector> RDet = boost::dynamic_pointer_cast<
const RectangularDetector>(parent);

boost::shared_ptr<Detector> pixel = RDet->getAtXY(col, row);
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp
Expand Up @@ -980,7 +980,7 @@ void LoadNexusProcessed::readInstrumentGroup(NXEntry & mtd_entry, API::MatrixWor
// Detector list contains a list of all of the detector numbers. If it not present then we can't update the spectra
// map
int ndets(-1);
boost::shared_array<int> det_list(NULL);
boost::shared_array<int> det_list(new int);
try
{
NXInt detlist_group = detgroup.openNXInt("detector_list");
Expand All @@ -1006,7 +1006,7 @@ void LoadNexusProcessed::readInstrumentGroup(NXEntry & mtd_entry, API::MatrixWor
//Spectra block - Contains spectrum numbers for each workspace index
// This might not exist so wrap and check. If it doesn't exist create a default mapping
bool have_spectra(true);
boost::shared_array<int> spectra(NULL);
boost::shared_array<int> spectra(new int);
try
{
NXInt spectra_block = detgroup.openNXInt("spectra");
Expand Down
Expand Up @@ -154,7 +154,7 @@ class ConvertToReflectometryQTest : public CxxTest::TestSuite
{
auto alg = make_standard_algorithm();
alg->execute();
auto ws = boost::shared_dynamic_cast<Mantid::API::IMDEventWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve("OutputTransformedWorkspace"));
auto ws = boost::dynamic_pointer_cast<Mantid::API::IMDEventWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve("OutputTransformedWorkspace"));
TS_ASSERT(ws != NULL);
TS_ASSERT_EQUALS(1, ws->getExperimentInfo(0)->run().getLogData().size());
}
Expand Down
Expand Up @@ -110,7 +110,7 @@ namespace
bool addColumn(ITableWorkspace &self, const std::string& type, const std::string& name)
{
// The shared pointer will be converted to a boolean automatically
return self.addColumn(type,name);
return self.addColumn(type,name)!=0;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/MantidPlot/src/Mantid/MantidMatrixCurve.cpp
Expand Up @@ -92,7 +92,7 @@ void MantidMatrixCurve::init(Graph* g,bool distr,Graph::CurveType style)
else this->setTitle(createCurveName(workspace,m_wsName,m_index));
}

Mantid::API::MatrixWorkspace_const_sptr matrixWS = boost::shared_dynamic_cast<const Mantid::API::MatrixWorkspace>(workspace);
Mantid::API::MatrixWorkspace_const_sptr matrixWS = boost::dynamic_pointer_cast<const Mantid::API::MatrixWorkspace>(workspace);
//we need to censor the data if there is a log scale because it can't deal with negative values, only the y-axis has been found to be problem so far
const bool log = g->isLog(QwtPlot::yLeft);
MantidQwtMatrixWorkspaceData data(matrixWS,m_index, log,distr);
Expand Down

0 comments on commit 7fc2b6f

Please sign in to comment.