From 03eb920f2286e355c3b1ad9f908123fef3fa9b0c Mon Sep 17 00:00:00 2001 From: Martyn Gigg Date: Mon, 10 Feb 2014 20:55:11 +0000 Subject: [PATCH] Remove WorkspaceIterator code Refs #8983 --- Code/Mantid/Framework/API/CMakeLists.txt | 8 - .../Framework/API/inc/MantidAPI/IDataItem.h | 52 ---- .../API/inc/MantidAPI/ILocatedData.h | 55 ---- .../API/inc/MantidAPI/LocatedDataRef.h | 77 ----- .../API/inc/MantidAPI/LocatedDataValue.h | 78 ----- .../API/inc/MantidAPI/WorkspaceIterator.h | 230 -------------- .../API/inc/MantidAPI/WorkspaceIteratorCode.h | 282 ------------------ .../Framework/API/src/IEventWorkspace.cpp | 8 +- .../Framework/API/src/LocatedDataRef.cpp | 226 -------------- .../Framework/API/src/LocatedDataValue.cpp | 234 --------------- .../src/ManagedRawFileWorkspace2D.cpp | 3 - .../DataObjects/src/EventWorkspace.cpp | 1 - .../Framework/DataObjects/src/Workspace2D.cpp | 6 - .../DataObjects/src/WorkspaceSingleValue.cpp | 5 - 14 files changed, 1 insertion(+), 1264 deletions(-) delete mode 100644 Code/Mantid/Framework/API/inc/MantidAPI/IDataItem.h delete mode 100644 Code/Mantid/Framework/API/inc/MantidAPI/ILocatedData.h delete mode 100644 Code/Mantid/Framework/API/inc/MantidAPI/LocatedDataRef.h delete mode 100644 Code/Mantid/Framework/API/inc/MantidAPI/LocatedDataValue.h delete mode 100644 Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceIterator.h delete mode 100644 Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceIteratorCode.h delete mode 100644 Code/Mantid/Framework/API/src/LocatedDataRef.cpp delete mode 100644 Code/Mantid/Framework/API/src/LocatedDataValue.cpp diff --git a/Code/Mantid/Framework/API/CMakeLists.txt b/Code/Mantid/Framework/API/CMakeLists.txt index fd1c917fb591..0f37b0be4e40 100644 --- a/Code/Mantid/Framework/API/CMakeLists.txt +++ b/Code/Mantid/Framework/API/CMakeLists.txt @@ -69,8 +69,6 @@ set ( SRC_FILES src/JointDomain.cpp src/LinearScale.cpp src/LiveListenerFactory.cpp - src/LocatedDataRef.cpp - src/LocatedDataValue.cpp src/LogManager.cpp src/LogarithmScale.cpp src/MDGeometry.cpp @@ -174,7 +172,6 @@ set ( INC_FILES inc/MantidAPI/ICatalogInfoService.h inc/MantidAPI/IConstraint.h inc/MantidAPI/ICostFunction.h - inc/MantidAPI/IDataItem.h inc/MantidAPI/IDomainCreator.h inc/MantidAPI/IEventList.h inc/MantidAPI/IEventWorkspace.h @@ -187,7 +184,6 @@ set ( INC_FILES inc/MantidAPI/IFunctionValues.h inc/MantidAPI/IFunctionWithLocation.h inc/MantidAPI/ILiveListener.h - inc/MantidAPI/ILocatedData.h inc/MantidAPI/IMDEventWorkspace.h inc/MantidAPI/IMDHistoWorkspace.h inc/MantidAPI/IMDIterator.h @@ -217,8 +213,6 @@ set ( INC_FILES inc/MantidAPI/JointDomain.h inc/MantidAPI/LinearScale.h inc/MantidAPI/LiveListenerFactory.h - inc/MantidAPI/LocatedDataRef.h - inc/MantidAPI/LocatedDataValue.h inc/MantidAPI/LogManager.h inc/MantidAPI/LogarithmScale.h inc/MantidAPI/MDGeometry.h @@ -260,8 +254,6 @@ set ( INC_FILES inc/MantidAPI/WorkspaceFactory.h inc/MantidAPI/WorkspaceGroup.h inc/MantidAPI/WorkspaceHistory.h - inc/MantidAPI/WorkspaceIterator.h - inc/MantidAPI/WorkspaceIteratorCode.h inc/MantidAPI/WorkspaceOpOverloads.h inc/MantidAPI/WorkspaceProperty.h inc/MantidAPI/WorkspaceValidators.h diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/IDataItem.h b/Code/Mantid/Framework/API/inc/MantidAPI/IDataItem.h deleted file mode 100644 index 7c7391cbf46f..000000000000 --- a/Code/Mantid/Framework/API/inc/MantidAPI/IDataItem.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef MANTIDAPI_IDATAITEM_H -#define MANTIDAPI_IDATAITEM_H - -#include "MantidAPI/DllConfig.h" - -namespace Mantid -{ -namespace API -{ -/** - Interface IDataItem of a Y and error value. - - \author N. Draper - - Copyright © 2007-8 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory - - This file is part of Mantid. - - Mantid is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - Mantid is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - File change history is stored at: -*/ -class MANTID_API_DLL IDataItem -{ - public: - virtual const double& Y() const =0; ///< Returns the Y value - virtual const double& E() const =0; ///< Returns the E value - - virtual double& Y() =0; ///< Returns the Y value - virtual double& E() =0; ///< Returns the E value - - ///virtual destructor - virtual ~IDataItem() - {} -}; - -} // NAMESPACE API - -} // NAMESPACE Mantid - -#endif //MANTIDAPI_IDATAITEM_H diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/ILocatedData.h b/Code/Mantid/Framework/API/inc/MantidAPI/ILocatedData.h deleted file mode 100644 index 818c1f42a172..000000000000 --- a/Code/Mantid/Framework/API/inc/MantidAPI/ILocatedData.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef MANTIDAPI_ILOCATEDDATA_H -#define MANTIDAPI_ILOCATEDDATA_H - -#include "MantidAPI/DllConfig.h" -#include "MantidAPI/IDataItem.h" - -namespace Mantid -{ -namespace API -{ -/** - Interface ILocatedData describes a single data item of a point data dataset. - - \author N. Draper - - Copyright © 2007-8 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory - - This file is part of Mantid. - - Mantid is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - Mantid is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - File change history is stored at: -*/ - class MANTID_API_DLL ILocatedData : public IDataItem -{ - public: - - virtual const double& X() const =0; ///< Returns the X value - virtual double& X() =0; ///< Returns the X value - - virtual const double& X2() const =0; ///< Returns the X value of the end of the histogram bin - virtual double& X2() =0; ///< Returns the X value of the end of the histogram bin - - virtual bool isHistogram() const =0; ///. - - File change history is stored at: -*/ - class MANTID_API_DLL LocatedDataRef : public ILocatedData -{ - public: - const double& X() const; - const double& E() const; - - double& X(); - double& E(); - - const double& Y() const; - double& Y(); - - const double& X2() const; ///< Returns the X value of the end of the histogram bin - double& X2(); ///< Returns the X value of the end of the histogram bin - - bool isHistogram() const; ///(const LocatedDataRef&) const; - int operator==(const LocatedDataRef&) const; - int operator!=(const LocatedDataRef&) const; -}; - -} // NAMESPACE API - -} // NAMESPACE Mantid - -#endif //MANTIDAPI_LOCATEDDATAREF_H diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/LocatedDataValue.h b/Code/Mantid/Framework/API/inc/MantidAPI/LocatedDataValue.h deleted file mode 100644 index a622861bd4ba..000000000000 --- a/Code/Mantid/Framework/API/inc/MantidAPI/LocatedDataValue.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef MANTIDAPI_LOCATEDDATAVALUE_H -#define MANTIDAPI_LOCATEDDATAVALUE_H - -#include "MantidAPI/DllConfig.h" -#include "MantidAPI/ILocatedData.h" - -namespace Mantid -{ - namespace API - { - /** - IDataItem of a Y and error value, together with a pointer to an ErrorHelper. - - \author N. Draper - - Copyright © 2007-8 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory - - This file is part of Mantid. - - Mantid is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - Mantid is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - File change history is stored at: - */ - class MANTID_API_DLL LocatedDataValue : public ILocatedData - { - public: - - const double& X() const; - const double& E() const; - - double& X(); - double& E(); - - const double& Y() const; - double& Y(); - - double xValue; ///< value of X - double yValue; ///< value of Y - double eValue; ///< value of E - - const double& X2() const; - double& X2(); - - bool isHistogram() const; ///(const LocatedDataValue&) const; - int operator==(const LocatedDataValue&) const; - int operator!=(const LocatedDataValue&) const; - private: - bool _isHistogram; ///< True if the data is a histogram - }; - - } // NAMESPACE API - -} // NAMESPACE Mantid - -#endif //MANTIDAPI_LOCATEDDATAVALUE_H diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceIterator.h b/Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceIterator.h deleted file mode 100644 index 8dce81b2e4a3..000000000000 --- a/Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceIterator.h +++ /dev/null @@ -1,230 +0,0 @@ -#ifndef MANTIDAPI_WORKSPACE_ITERATOR_H -#define MANTIDAPI_WORKSPACE_ITERATOR_H - -#include -#include "MantidAPI/DllConfig.h" -#include "MantidAPI/LocatedDataRef.h" - -namespace Mantid -{ -namespace API -{ -/** - workspace_iterator iterates over a workspace providing values as TripleRefs - - \class workspace_iterator - \author S. Ansell - \date November 2007 - \version 1.0 - - Copyright © 2007-8 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory - - This file is part of Mantid. - - Mantid is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - Mantid is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - File change history is stored at: . - Code Documentation is available at: -*/ -template -class DLLExport workspace_iterator -{ -private: - ///internal workspace pointer - _Container * const m_workspace; - /// pointer to a TripleRef of doubles - LocatedDataRef m_CPoint; - - ///The number of times this iterator should loop before ending - int m_loopCount; - ///The number of times this iterator should loop before ending - const unsigned int m_loopOrientation; - /// internal index of location within the workspace - std::size_t m_index; - ///Internal cache of the workspace size - std::size_t m_wsSize; - ///Internal cache of the workspace blocksize - std::size_t m_blocksize; - - ///Internal cache of the current datablock index - std::size_t m_dataBlockIndex; - ///Internal cache of the current datablock index minimum value - std::size_t m_blockMin; - ///Internal cache of the current datablock index maximum value - std::size_t m_blockMax; - ///Internal flag to indicate if the X2 value is present - bool m_IsX2Present; - - /// @cond - template - struct internal_iterator_type {}; - - template - struct internal_iterator_type - { - typedef std::vector::iterator iterator_type; - }; - - template - struct internal_iterator_type - { - typedef std::vector::const_iterator iterator_type; - }; - /// @endcond - - /// Makes the underlying std::vector iterator be const or not according to whether the workspace_iterator is (or not). - typedef typename internal_iterator_type<_Iterator*>::iterator_type iterator_type; - - ///Internal cache of X iterator for current datablock - iterator_type it_dataX; - ///Internal cache of Y iterator for current datablock - iterator_type it_dataY; - ///Internal cache of E iterator for current datablock - iterator_type it_dataE; - - ///Validates the index and updates the current m_CPoint - void validateIndex(); - - ///Validates the index and updates the current m_CPoint - bool isWorkspaceHistogram(); - -public: - /// @cond - typedef typename std::iterator_traits<_Iterator*>::iterator_category iterator_category; - typedef typename std::iterator_traits<_Iterator*>::value_type value_type; - typedef typename std::iterator_traits<_Iterator*>::difference_type difference_type; - typedef typename std::iterator_traits<_Iterator*>::reference reference; - typedef typename std::iterator_traits<_Iterator*>::pointer pointer; - /// @endcond - - workspace_iterator(); - workspace_iterator(_Container&); - workspace_iterator(_Container&, int loopCount); - workspace_iterator(_Container&, int loopCount, const unsigned int loopOrientation); - workspace_iterator(const workspace_iterator&); - - reference operator*() { return m_CPoint; } ///< Base Accessor - pointer operator->() { return &m_CPoint; } ///< Base Pointer accessor - /// Random accessor - reference operator[](const difference_type& N) - { - m_index=N; - validateIndex(); - return m_CPoint; - } - - workspace_iterator& operator++(); - workspace_iterator operator++(int); - workspace_iterator& operator--(); - workspace_iterator operator--(int); - workspace_iterator& operator+=(difference_type); - workspace_iterator& operator-=(difference_type); - workspace_iterator operator+(difference_type) const; - workspace_iterator operator-(difference_type) const; - difference_type operator-(const workspace_iterator&) const; - - /** - lessthan operator - @param A :: Iterator to compare - @return status - */ - bool operator<(const workspace_iterator& A) const - { - if (!m_workspace) - return 0; - if (!A.m_workspace) - return 1; - return (m_index -#include - -#include "MantidAPI/LocatedDataRef.h" - -namespace Mantid -{ - namespace API - { - /** - Null constructor - */ - template - workspace_iterator<_Iterator, _Container>::workspace_iterator() : - m_workspace(0),m_CPoint(),m_loopCount(1),m_loopOrientation(1), - m_index(0),m_wsSize(0),m_blocksize(0),m_blockMin((std::size_t)-1), - m_blockMax((std::size_t)-1),m_IsX2Present(false) - {} - - /** - Workspace based constructor - @param WA :: Workspace to take pointer - */ - template - workspace_iterator<_Iterator, _Container>::workspace_iterator(_Container& WA) : - m_workspace(&WA),m_CPoint(),m_loopCount(1),m_loopOrientation(0),m_index(0), - m_wsSize(m_workspace->size()),m_blocksize(m_workspace->blocksize()), - m_blockMin((std::size_t)-1),m_blockMax((std::size_t)-1),m_IsX2Present(false) - { - - m_IsX2Present = isWorkspaceHistogram(); - validateIndex(); - } - - /** - Multiple loop workspace based constructor - @param WA :: Workspace to take pointer - @param loopCount :: The number of time this iterator should loop over the same data before stopping. - */ - template - workspace_iterator<_Iterator, _Container>::workspace_iterator(_Container& WA, int loopCount) : - m_workspace(&WA),m_CPoint(),m_loopCount(loopCount),m_loopOrientation(0),m_index(0), - m_wsSize(m_workspace->size()),m_blocksize(m_workspace->blocksize()),m_blockMin((std::size_t)-1), - m_blockMax((std::size_t)-1),m_IsX2Present(false) - { - - m_IsX2Present = isWorkspaceHistogram(); - //pretend that the container is longer than it is by multiplying its size by the loopcount - m_wsSize *= m_loopCount; - validateIndex(); - } - - /** - Multiple loop workspace based constructor also specifying the loop orientation - @param WA :: Workspace to take pointer - @param loopCount :: The number of time this iterator should loop over the same data before stopping. - @param loopOrientation :: true = vertical, false = horizontal. - */ - template - workspace_iterator<_Iterator, _Container>::workspace_iterator(_Container& WA, int loopCount, const unsigned int loopOrientation) : - m_workspace(&WA),m_CPoint(),m_loopCount(loopCount),m_loopOrientation(loopOrientation),m_index(0), - m_wsSize(m_workspace->size()),m_blocksize(m_workspace->blocksize()),m_blockMin((std::size_t)-1), - m_blockMax((std::size_t)-1),m_IsX2Present(false) - { - - m_IsX2Present = isWorkspaceHistogram(); - //pretend that the container is longer than it is by multiplying its size by the loopcount - m_wsSize *= m_loopCount; - validateIndex(); - } - - /** - Copy constructor - @param A :: workspace_iterator to copy - */ - template - workspace_iterator<_Iterator, _Container>::workspace_iterator(const workspace_iterator<_Iterator, _Container>& A) : - m_workspace(A.m_workspace),m_CPoint(A.m_CPoint),m_loopCount(A.m_loopCount),m_loopOrientation(A.m_loopOrientation), - m_index(A.m_index),m_wsSize(A.m_wsSize),m_blocksize(A.m_blocksize),m_blockMin(A.m_blockMin),m_blockMax(A.m_blockMax), - m_IsX2Present(A.m_IsX2Present),it_dataX(A.it_dataX),it_dataY(A.it_dataY),it_dataE(A.it_dataE) - { - validateIndex(); - } - - /** - Validate the index - */ - template - void workspace_iterator<_Iterator, _Container>::validateIndex() - { - if (!m_workspace) - m_index=0; - else if (m_index>m_wsSize) - m_index=m_wsSize; - if (!m_workspace) - { - return; - } - - if (m_index != m_wsSize ) - { - if (m_index > m_blockMax || m_index < m_blockMin ) - { - m_dataBlockIndex = m_index/m_blocksize; - m_blockMin = m_index - (m_index % m_blocksize); - m_blockMax = m_blockMin + m_blocksize -1; - - //make sure you get the right block if you are looping multiple times - if (m_loopCount != 1) - { - if (m_loopOrientation) - { - //vertical Orientation we want to loop over each index value loopcount times. - m_dataBlockIndex = m_index/(m_blocksize*m_loopCount); - m_blockMin = m_index - (m_index % (m_blocksize*m_loopCount)); - m_blockMax = m_blockMin + (m_blocksize*m_loopCount) -1; - } - else - { - //Horizontal Orientation we want to loop over the same datablock loopcount times. - std::size_t realWsSize = m_wsSize/m_loopCount; - m_dataBlockIndex = (m_index % realWsSize)/m_blocksize; - } - } - - //get cached block level data objects - it_dataX = m_workspace->dataX(m_dataBlockIndex).begin(); - it_dataY = m_workspace->dataY(m_dataBlockIndex).begin(); - it_dataE = m_workspace->dataE(m_dataBlockIndex).begin(); - } - size_t iteratorPos; - if ((m_loopCount != 1) && (m_loopOrientation)) - { - //vertical Orientation we want to loop over each index value loopcount times. - // and never change the blockindex - iteratorPos = (m_index-m_blockMin)/m_loopCount; - } - else - { - iteratorPos = m_index-m_blockMin; - } - // const_cast is needed for the const_iterator (does nothing otherwise) - m_CPoint.xPointer = const_cast(&(it_dataX[iteratorPos])); - m_CPoint.yPointer = const_cast(&(it_dataY[iteratorPos])); - m_CPoint.ePointer = const_cast(&(it_dataE[iteratorPos])); - if(m_IsX2Present) - { - m_CPoint.x2Pointer = const_cast(&(it_dataX[iteratorPos+1])); - } - } - } - - /** - Addition to index - @param N :: Number to add - @return Iterator advanced by N - */ - template - workspace_iterator<_Iterator, _Container> workspace_iterator<_Iterator, _Container>::operator+(difference_type N) const - { - workspace_iterator<_Iterator, _Container> Out(*this); - Out+=N; - return Out; - } - - /** - Negation to index - @param N :: Number to subtract - @return Iterator decreased by N - */ - template - workspace_iterator<_Iterator, _Container> workspace_iterator<_Iterator, _Container>::operator-(difference_type N) const - { - workspace_iterator<_Iterator, _Container> Out(*this); - Out-=N; - return Out; - } - - /** - Addition to self by N - @param N :: Number to add to index - @return *this - */ - template - workspace_iterator<_Iterator, _Container>& workspace_iterator<_Iterator, _Container>::operator+=(difference_type N) - { - m_index+=N; - validateIndex(); - return *this; - } - - /** - Negation to self by N - @param N :: Number to subtract - @return *this - */ - template - workspace_iterator<_Iterator, _Container>& workspace_iterator<_Iterator, _Container>::operator-=(difference_type N) - { - m_index-=N; - validateIndex(); - return *this; - } - - /** - Increment iterator (pre) - @return Iterator - */ - template - workspace_iterator<_Iterator, _Container>& workspace_iterator<_Iterator, _Container>::operator++() - { - ++m_index; - validateIndex(); - return *this; - } - - /** - Decrement iterator (pre) - @return Iterator - */ - template - workspace_iterator<_Iterator, _Container>& workspace_iterator<_Iterator, _Container>::operator--() - { - --m_index; - validateIndex(); - return *this; - } - - /** - Increment iterator (post) - @return Iterator before increment - */ - template - workspace_iterator<_Iterator, _Container> workspace_iterator<_Iterator, _Container>::operator++(int) - { - workspace_iterator<_Iterator, _Container> Out(*this); - this->operator++(); - return Out; - } - - /** - Negation iterator (post) - @return Iterator before decrement - */ - template - workspace_iterator<_Iterator, _Container> workspace_iterator<_Iterator, _Container>::operator--(int) - { - workspace_iterator<_Iterator, _Container> Out(*this); - this->operator--(); - return Out; - } - - /** - Difference iterator - @return difference (as a non-inclusive count) - */ - template - typename std::iterator_traits<_Iterator*>::difference_type workspace_iterator<_Iterator, _Container>::operator-(const workspace_iterator<_Iterator, _Container>& A) const - { - if (!m_workspace && !A.m_workspace) - return 0; - if (!m_workspace) /// This effectively an end - return A.m_wsSize-A.m_index; - if (!A.m_workspace) /// A effectively an end - return m_index-m_wsSize; - return A.m_index-m_index; - } - - template - bool workspace_iterator<_Iterator, _Container>::isWorkspaceHistogram() - { - if (m_wsSize > 0) - { - return (m_workspace->dataX(0).size() > m_workspace->dataY(0).size()); - } - return false; - } - - - } // NAMESPACE API - -} // NAMESPACE Mantid diff --git a/Code/Mantid/Framework/API/src/IEventWorkspace.cpp b/Code/Mantid/Framework/API/src/IEventWorkspace.cpp index b0c78ec47085..9dc619305ac3 100644 --- a/Code/Mantid/Framework/API/src/IEventWorkspace.cpp +++ b/Code/Mantid/Framework/API/src/IEventWorkspace.cpp @@ -2,13 +2,6 @@ // Includes //------------------------------------------------------ #include "MantidAPI/IEventWorkspace.h" -#include "MantidAPI/LocatedDataRef.h" -#include "MantidAPI/WorkspaceIterator.h" -#include "MantidAPI/WorkspaceIteratorCode.h" - -///\cond TEMPLATE -template MANTID_API_DLL class Mantid::API::workspace_iterator; -template MANTID_API_DLL class Mantid::API::workspace_iterator; namespace Mantid { @@ -41,6 +34,7 @@ const std::string IEventWorkspace::toString() const } +///\cond TEMPLATE /* * In order to be able to cast PropertyWithValue classes correctly a definition for the PropertyWithValue is required * diff --git a/Code/Mantid/Framework/API/src/LocatedDataRef.cpp b/Code/Mantid/Framework/API/src/LocatedDataRef.cpp deleted file mode 100644 index d515db54fae7..000000000000 --- a/Code/Mantid/Framework/API/src/LocatedDataRef.cpp +++ /dev/null @@ -1,226 +0,0 @@ -#include "MantidAPI/LocatedDataRef.h" -#include "MantidKernel/Exception.h" -namespace Mantid -{ - - namespace API - { - - /** - Standard Copy Constructor - @param A :: LocatedDataRef Item to copy - */ - LocatedDataRef::LocatedDataRef(const LocatedDataRef& A) : ILocatedData(), - xPointer(A.xPointer),x2Pointer(A.x2Pointer),yPointer(A.yPointer),ePointer(A.ePointer) - {} - - /// Default constructor - LocatedDataRef::LocatedDataRef(): ILocatedData(), - xPointer(0),x2Pointer(0),yPointer(0),ePointer(0) - {} - - /** - Standard Assignment Constructor - @param A :: LocatedDataRef Item to copy - @return *this - */ - LocatedDataRef& LocatedDataRef::operator=(const LocatedDataRef& A) - { - if (this!=&A) - { - *xPointer= *A.xPointer; - *yPointer= *A.yPointer; - *ePointer= *A.ePointer; - if (A.x2Pointer) - { - *x2Pointer= *A.x2Pointer; - } - } - return *this; - } - - /** - Standard Assignment Constructor - @param A :: ILocatedData Item to copy - @return *this - */ - LocatedDataRef& LocatedDataRef::operator=(const ILocatedData& A) - { - if (this!=&A) - { - *xPointer= A.X(); - *yPointer= A.Y(); - *ePointer= A.E(); - if(x2Pointer) - { - *x2Pointer= A.X2(); - } - } - return *this; - } - - /** - Standard Destructor - */ - LocatedDataRef::~LocatedDataRef() - { - //do not delete the contents as they are managed by the collection. - } - - - /** - Operator== all components must be equal - @param A :: Other object to compare - */ - int LocatedDataRef::operator==(const LocatedDataRef& A) const - { - return (*xPointer!=*A.xPointer || *yPointer!=*A.yPointer || - *ePointer!=*A.ePointer) ? 0 : 1; - } - - /** - Operator!= any component is not equal - @param A :: Other object to compare - @return this!=A - */ - int LocatedDataRef::operator!=(const LocatedDataRef& A) const - { - return (*xPointer==*A.xPointer && *yPointer == *A.yPointer && - *ePointer== *A.ePointer) ? 0 : 1; - } - - /** - Operator< takes xPointer to last precidence. - @param A :: LocatedDataRef to compare - @return this < A - */ - int LocatedDataRef::operator<(const LocatedDataRef& A) const - { - if (&A!=this) - { - if (*xPointer> *A.xPointer) - return 0; - if (*xPointer< *A.xPointer) - return 1; - if (*yPointer> *A.yPointer) - return 0; - if (*yPointer< *A.yPointer) - return 1; - if (*ePointer > *A.ePointer) - return 0; - if (*yPointer< *A.yPointer) - return 1; - } - return 0; - } - - /** - Operator> takes xPointer to last precidence. - Uses operator< to obtain value. - Note it does not uses 1-(A A - */ - int LocatedDataRef::operator>(const LocatedDataRef& A) const - { - return !(this->operator<(A)); - } - - /** Const Accessor for X value - @return The X value - */ - const double& LocatedDataRef::X() const - { - return *xPointer; - } - - /** Accessor for X value - @return The X value - */ - double& LocatedDataRef::X() - { - return *xPointer; - } - - /** Const Accessor for Y value - @return The Y value - */ - const double& LocatedDataRef::Y() const - { - return *yPointer; - } - - /** Accessor for Y value - @return The Y value - */ - double& LocatedDataRef::Y() - { - return *yPointer; - } - - /** Const Accessor for E value - @return The E value - */ - const double& LocatedDataRef::E() const - { - return *ePointer; - } - - /** Accessor for E value - @return The E value - */ - double& LocatedDataRef::E() - { - return *ePointer; - } - - /** Const Accessor for X2 value, this should only be used if isHistogram() == true - @return The X2 value - */ - const double& LocatedDataRef::X2() const - { - if (isHistogram()) - { - return *x2Pointer; - } - else - { - throw Kernel::Exception::NotFoundError("X2 value is not set, check isHistogram() before accessing X2","X2"); - } - } - - /** Accessor for X2 value, this should only be used if isHistogram() == true - @return The X2 value - */ - double& LocatedDataRef::X2() - { - if (isHistogram()) - { - return *x2Pointer; - } - else - { - throw Kernel::Exception::NotFoundError("X2 value is not set, check isHistogram() before accessing X2","X2"); - } - } - - /** Returns true if the data point is hastogram data and therefore has an X2. - @returns true if the X2 value is present - */ - bool LocatedDataRef::isHistogram() const - { - return (x2Pointer!=0); - } - - - /** Clone method - * Make a copy of the LocatedDataRef - * @return new(*this) - */ - LocatedDataRef* LocatedDataRef::clone() const - { - return new LocatedDataRef(*this); - } - } // NAMESPACE API - -} // NAMESPACE Mantid diff --git a/Code/Mantid/Framework/API/src/LocatedDataValue.cpp b/Code/Mantid/Framework/API/src/LocatedDataValue.cpp deleted file mode 100644 index 490dd7c002fe..000000000000 --- a/Code/Mantid/Framework/API/src/LocatedDataValue.cpp +++ /dev/null @@ -1,234 +0,0 @@ -#include "MantidAPI/LocatedDataValue.h" -#include "MantidKernel/Exception.h" - -namespace Mantid -{ - - namespace API - { - - /** - Standard Copy Constructor - @param A :: LocatedDataValue Item to copy - */ - LocatedDataValue::LocatedDataValue(const LocatedDataValue& A) : ILocatedData(), - xValue(A.xValue),yValue(A.yValue),eValue(A.eValue), - x2Value(A.x2Value),_isHistogram(A._isHistogram) - {} - - /** - Standard Copy Constructor - @param A :: LocatedDataValue Item to copy - */ - LocatedDataValue::LocatedDataValue(const ILocatedData& A) : ILocatedData(), - xValue(A.X()),yValue(A.Y()),eValue(A.E()), - x2Value(0),_isHistogram(A.isHistogram()) - { - if (isHistogram()) - { - x2Value = A.X2(); - } - } - - /// Default constructor - LocatedDataValue::LocatedDataValue(): ILocatedData(), - xValue(0),yValue(0),eValue(0) - {} - - /** - Standard Assignment Constructor - @param A :: LocatedDataValue Item to copy - @return *this - */ - LocatedDataValue& LocatedDataValue::operator=(const LocatedDataValue& A) - { - if (this!=&A) - { - xValue= A.xValue; - x2Value= A.x2Value; - yValue= A.yValue; - eValue= A.eValue; - _isHistogram = A._isHistogram; - } - return *this; - } - - /** - Standard Assignment Constructor - @param A :: ILocatedData Item to copy - @return *this - */ - LocatedDataValue& LocatedDataValue::operator=(const ILocatedData& A) - { - if (this!=&A) - { - xValue= A.X(); - _isHistogram = A.isHistogram(); - if (_isHistogram) - { - x2Value= A.X2(); - } - - yValue= A.Y(); - eValue= A.E(); - } - return *this; - } - - /** - Standard Destructor - */ - LocatedDataValue::~LocatedDataValue() - { - } - - - /** - Operator== all components must be equal - @param A :: Other object to compare - */ - int LocatedDataValue::operator==(const LocatedDataValue& A) const - { - return (xValue!=A.xValue || x2Value!=A.x2Value || yValue!=A.yValue || - eValue!=A.eValue) ? 0 : 1; - } - - /** - Operator!= any component is not equal - @param A :: Other object to compare - @return this!=A - */ - int LocatedDataValue::operator!=(const LocatedDataValue& A) const - { - return (xValue==A.xValue && x2Value==A.x2Value && yValue == A.yValue && - eValue== A.eValue) ? 0 : 1; - } - - /** - Operator< takes xValue to last precidence. - @param A :: LocatedDataValue to compare - @return this < A - */ - int LocatedDataValue::operator<(const LocatedDataValue& A) const - { - if (&A!=this) - { - if (xValue> A.xValue) - return 0; - if (xValue< A.xValue) - return 1; - if (x2Value> A.x2Value) - return 0; - if (x2Value< A.x2Value) - return 1; - if (yValue> A.yValue) - return 0; - if (yValue< A.yValue) - return 1; - if (eValue > A.eValue) - return 0; - if (yValue< A.yValue) - return 1; - } - return 0; - } - - /** - Operator> takes xValue to last precidence. - Uses operator< to obtain value. - Note it does not uses 1-(A A - */ - int LocatedDataValue::operator>(const LocatedDataValue& A) const - { - return !(this->operator<(A)); - } - - /** Const accessor for X2 - @return The value of X2 - */ - const double& LocatedDataValue::X2() const - { - if (isHistogram()) - { - return x2Value; - } - else - { - throw Kernel::Exception::NotFoundError("X2 value is not set, check isHistogram() before accessing X2","X2"); - } - } - - /** Accessor for X2 - @return The value of X2 - */ - double& LocatedDataValue::X2() - { - if (isHistogram()) - { - return x2Value; - } - else - { - throw Kernel::Exception::NotFoundError("X2 value is not set, check isHistogram() before accessing X2","X2"); - } - } - - /** Const Accessor for X value - @return The X value - */ - const double& LocatedDataValue::X() const - { - return xValue; - } - - /** Accessor for X value - @return The X value - */ - double& LocatedDataValue::X() - { - return xValue; - } - - /** Const Accessor for Y value - @return The Y value - */ - const double& LocatedDataValue::Y() const - { - return yValue; - } - - /** Accessor for Y value - @return The Y value - */ - double& LocatedDataValue::Y() - { - return yValue; - } - - /** Const Accessor for E value - @return The E value - */ - const double& LocatedDataValue::E() const - { - return eValue; - } - - /** Accessor for E value - @return The E value - */ - double& LocatedDataValue::E() - { - return eValue; - } - - bool LocatedDataValue::isHistogram() const - { - return _isHistogram; - } - - - } // NAMESPACE API - -} // NAMESPACE Mantid diff --git a/Code/Mantid/Framework/DataHandling/src/ManagedRawFileWorkspace2D.cpp b/Code/Mantid/Framework/DataHandling/src/ManagedRawFileWorkspace2D.cpp index b628b103b512..616cf12fd40e 100644 --- a/Code/Mantid/Framework/DataHandling/src/ManagedRawFileWorkspace2D.cpp +++ b/Code/Mantid/Framework/DataHandling/src/ManagedRawFileWorkspace2D.cpp @@ -1,9 +1,6 @@ #include "MantidDataHandling/ManagedRawFileWorkspace2D.h" #include "MantidKernel/Exception.h" #include "MantidAPI/RefAxis.h" -#include "MantidAPI/LocatedDataRef.h" -#include "MantidAPI/WorkspaceIterator.h" -#include "MantidAPI/WorkspaceIteratorCode.h" #include "MantidAPI/WorkspaceProperty.h" #include "MantidAPI/WorkspaceFactory.h" #include "MantidKernel/UnitFactory.h" diff --git a/Code/Mantid/Framework/DataObjects/src/EventWorkspace.cpp b/Code/Mantid/Framework/DataObjects/src/EventWorkspace.cpp index f5e476f15f4e..3723b5f602ba 100644 --- a/Code/Mantid/Framework/DataObjects/src/EventWorkspace.cpp +++ b/Code/Mantid/Framework/DataObjects/src/EventWorkspace.cpp @@ -1,6 +1,5 @@ #include "MantidAPI/RefAxis.h" #include "MantidAPI/SpectraAxis.h" -#include "MantidAPI/LocatedDataRef.h" #include "MantidAPI/MemoryManager.h" #include "MantidAPI/Progress.h" #include "MantidAPI/WorkspaceProperty.h" diff --git a/Code/Mantid/Framework/DataObjects/src/Workspace2D.cpp b/Code/Mantid/Framework/DataObjects/src/Workspace2D.cpp index 71ff7479c046..618090214a8b 100644 --- a/Code/Mantid/Framework/DataObjects/src/Workspace2D.cpp +++ b/Code/Mantid/Framework/DataObjects/src/Workspace2D.cpp @@ -2,9 +2,6 @@ #include "MantidKernel/Exception.h" #include "MantidAPI/RefAxis.h" #include "MantidAPI/SpectraAxis.h" -#include "MantidAPI/LocatedDataRef.h" -#include "MantidAPI/WorkspaceIterator.h" -#include "MantidAPI/WorkspaceIteratorCode.h" #include "MantidAPI/WorkspaceProperty.h" #include "MantidAPI/WorkspaceFactory.h" #include "MantidAPI/ISpectrum.h" @@ -178,9 +175,6 @@ namespace Mantid ///\cond TEMPLATE -template DLLExport class Mantid::API::workspace_iterator; -template DLLExport class Mantid::API::workspace_iterator; - template DLLExport class Mantid::API::WorkspaceProperty; namespace Mantid diff --git a/Code/Mantid/Framework/DataObjects/src/WorkspaceSingleValue.cpp b/Code/Mantid/Framework/DataObjects/src/WorkspaceSingleValue.cpp index 41ead4e8655b..022c07fbdd78 100644 --- a/Code/Mantid/Framework/DataObjects/src/WorkspaceSingleValue.cpp +++ b/Code/Mantid/Framework/DataObjects/src/WorkspaceSingleValue.cpp @@ -1,7 +1,4 @@ #include "MantidDataObjects/WorkspaceSingleValue.h" -#include "MantidAPI/LocatedDataRef.h" -#include "MantidAPI/WorkspaceIterator.h" -#include "MantidAPI/WorkspaceIteratorCode.h" #include "MantidAPI/WorkspaceProperty.h" #include "MantidAPI/WorkspaceFactory.h" @@ -73,8 +70,6 @@ namespace Mantid } // namespace Mantid ///\cond TEMPLATE -template DLLExport class Mantid::API::workspace_iterator; -template DLLExport class Mantid::API::workspace_iterator; template DLLExport class Mantid::API::WorkspaceProperty;