diff --git a/Code/Mantid/Geometry/Deprecated/inc/XMLcollect.h b/Code/Mantid/Geometry/Deprecated/inc/XMLcollect.h index 9391f069b281671ce8b3b01f3624811305d732a4..77d31e5f655401d73c24659031daaad7c467d0b5 100644 --- a/Code/Mantid/Geometry/Deprecated/inc/XMLcollect.h +++ b/Code/Mantid/Geometry/Deprecated/inc/XMLcollect.h @@ -27,7 +27,7 @@ class XMLcollect { private: - static Kernel::Logger& PLog; ///< The official logger + static Kernel::Logger& PLog; ///< The official logger std::string depthKey; ///< Current depth layer XMLgroup Master; ///< Master group @@ -50,54 +50,52 @@ class XMLcollect int addNumComp(const std::string&,const char*); // Non-file type One - template<template<typename T> class V,typename T> - int addNumComp(const std::string&,const V<T>&); + template<template<typename T,typename A> class V,typename T,typename A> + int addNumComp(const std::string&,const V<T,A>&); // Non-file type - template<template<typename T> class V,typename T> - int addNumComp(const std::string&, - const V<T>&,const V<T>&); + template<template<typename T,typename A> class V,typename T,typename A> + int addNumComp(const std::string&,const V<T,A>&,const V<T,A>&); - template<template<typename T> class V,typename T> + template<template<typename T,typename A> class V,typename T,typename A> int addNumComp(const std::string&, - const V<T>&,const V<T>&,const V<T>&); + const V<T,A>&,const V<T,A>&,const V<T,A>&); // file type - template<template<typename T> class V,typename T> + template<template<typename T,typename A> class V,typename T,typename A> int addNumComp(const std::string&,const std::string&, - const V<T>&,const V<T>&); + const V<T,A>&,const V<T,A>&); - template<template<typename T> class V,typename T> + template<template<typename T,typename A> class V,typename T,typename A> int addNumComp(const std::string&,const std::string&, - const V<T>&,const V<T>&,const V<T>&); - + const V<T,A>&,const V<T,A>&,const V<T,A>&); template<typename T> int addComp(const std::string&,const T&); int addComp(const std::string&,const char*); // One container - template<template<typename T> class V,typename T> - int addComp(const std::string&,const V<T>&); + template<template<typename T,typename A> class V,typename T,typename A> + int addComp(const std::string&,const V<T,A>&); // Two container - template<template<typename T> class V,typename T> - int addComp(const std::string&,const V<T>&,const V<T>&); + template<template<typename T,typename A> class V,typename T,typename A> + int addComp(const std::string&,const V<T,A>&,const V<T,A>&); // Two container + file - template<template<typename T> class V,typename T> - int addComp(const std::string&,const std::string&,const V<T>&,const V<T>&); + template<template<typename T,typename A> class V,typename T,typename A> + int addComp(const std::string&,const std::string&,const V<T,A>&,const V<T,A>&); - template<template<typename T> class V,typename T> - int addComp(const std::string&,const V<T>&,const V<T>&,const V<T>&); + template<template<typename T,typename A> class V,typename T,typename A> + int addComp(const std::string&,const V<T,A>&,const V<T,A>&,const V<T,A>&); // Three Containers + file - template<template<typename T> class V,typename T> + template<template<typename T,typename A> class V,typename T,typename A> int addComp(const std::string&,const std::string&, - const V<T>&,const V<T>&,const V<T>&); + const V<T,A>&,const V<T,A>&,const V<T,A>&); // Four Containers - template<template<typename T> class V,typename T> + template<template<typename T,typename A> class V,typename T,typename A> int addComp(const std::string&, - const V<T>&,const V<T>&,const V<T>&,const V<T>&); + const V<T,A>&,const V<T,A>&,const V<T,A>&,const V<T,A>&); // Attributes void addAttribute(const std::string&,const char*); @@ -136,11 +134,12 @@ class XMLcollect int loadXML(const std::string&,const std::string&); int loadXML(std::istream&,const std::string&, const std::vector<std::string>&); -}; +}; + } // NAMESPACE XML -} // NAMESPACE Mantid +} // NAMESPACE Mantid #endif diff --git a/Code/Mantid/Geometry/Deprecated/inc/XMLgrid.h b/Code/Mantid/Geometry/Deprecated/inc/XMLgrid.h index 74e2f3e5b79dada1b2765e2872335d2db291da2f..738e3a9a4458300f427ad90e92ad663627a737da 100644 --- a/Code/Mantid/Geometry/Deprecated/inc/XMLgrid.h +++ b/Code/Mantid/Geometry/Deprecated/inc/XMLgrid.h @@ -1,5 +1,5 @@ -#ifndef Mantid_XML_XMLgrid_h -#define Mantid_XML_XMLgrid_h +#ifndef XMLgrid_h +#define XMLgrid_h namespace Mantid { @@ -15,41 +15,42 @@ namespace XML \brief The object is to hold a set of containers */ -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> class XMLgrid : public XMLobject { private: int size; ///< Current size int empty; ///< Null value - std::vector< V<T> > Grid; ///< X values + std::vector< V<T,A> > Grid; ///< X values int contLine; public: XMLgrid(XMLobject*); XMLgrid(XMLobject*,const std::string&); - XMLgrid(const XMLgrid<V,T>&); - XMLgrid<V,T>* clone() const; - XMLgrid<V,T>& operator=(const XMLgrid<V,T>&); + XMLgrid(const XMLgrid<V,T,A>&); + XMLgrid<V,T,A>* clone() const; + XMLgrid<V,T,A>& operator=(const XMLgrid<V,T,A>&); ~XMLgrid(); void setEmpty() { empty=0; } int isEmpty() const { return empty; } int getSize() const { return (!empty) ? size : 0; } - void setContLine(const int A) { contLine=A; } + void setContLine(const int IFlag) { contLine=IFlag; } - void setComp(const int,const V<T>&); ///< Assumes copy setting + void setComp(const int,const V<T,A>&); ///< Assumes copy setting virtual void writeXML(std::ostream&) const; virtual int readObject(std::istream&); - V<T>& getGVec(const int); - const V<T>& getGVec(const int) const; + V<T,A>& getGVec(const int); + const V<T,A>& getGVec(const int) const; }; } // NAMESPACE XML -} // NAMESPACE Mantid + +} // NAMESPACE Mantid #endif diff --git a/Code/Mantid/Geometry/Deprecated/inc/XMLgridSupport.h b/Code/Mantid/Geometry/Deprecated/inc/XMLgridSupport.h index aa8b4602be81fca5845691b256d925fc3f94bc0e..856d454d2e80ed0a33d0ac2062512bed326fd7ee 100644 --- a/Code/Mantid/Geometry/Deprecated/inc/XMLgridSupport.h +++ b/Code/Mantid/Geometry/Deprecated/inc/XMLgridSupport.h @@ -1,9 +1,6 @@ #ifndef XMLGridSupport_h #define XMLGridSupport_h -namespace Mantid -{ - namespace XML { @@ -12,5 +9,4 @@ void combineDeepGrid(XML::XMLcollect&,const std::string&,const int =10); } -} #endif diff --git a/Code/Mantid/Geometry/Deprecated/inc/XMLgroup.h b/Code/Mantid/Geometry/Deprecated/inc/XMLgroup.h index 5400399b33712349dc6c90754d980d3937500f38..ba7a080d68f13f523d9b880a559aa72ce506147d 100644 --- a/Code/Mantid/Geometry/Deprecated/inc/XMLgroup.h +++ b/Code/Mantid/Geometry/Deprecated/inc/XMLgroup.h @@ -27,7 +27,7 @@ class XMLgroup : public XMLobject private: - static Kernel::Logger& PLog; ///< The official logger + static Kernel::Logger& PLog; ///< The official logger std::vector<XMLobject*> Grp; ///< Orderd list of Objects holdType Index; ///< Map for searching for an object diff --git a/Code/Mantid/Geometry/Deprecated/inc/XMLnamespace.h b/Code/Mantid/Geometry/Deprecated/inc/XMLnamespace.h index 26c63467add8cc68cfa24558bd0d57c928b38fad..359e088e685122f1d873d79a8941430e1647c33a 100644 --- a/Code/Mantid/Geometry/Deprecated/inc/XMLnamespace.h +++ b/Code/Mantid/Geometry/Deprecated/inc/XMLnamespace.h @@ -39,5 +39,5 @@ std::string procString(const std::string&); } // NAMESPACE XML -} // NAMSPACE MAntid +} // NAMSPACE Mantid #endif diff --git a/Code/Mantid/Geometry/Deprecated/inc/XMLread.h b/Code/Mantid/Geometry/Deprecated/inc/XMLread.h index c3e93e669e3751d2311c63428e93d8e37670168d..06d0e73ea937082e72a91ba0f36e1ed428a5badf 100644 --- a/Code/Mantid/Geometry/Deprecated/inc/XMLread.h +++ b/Code/Mantid/Geometry/Deprecated/inc/XMLread.h @@ -1,5 +1,5 @@ -#ifndef XMLread_h -#define XMLread_h +#ifndef XML_XMLread_h +#define XML_XMLread_h namespace Mantid { @@ -57,12 +57,12 @@ class XMLread : public XMLobject // Conversions (using StrFunc) - template<template<typename T> class V,typename T> - int convertToContainer(V<T>&) const; + template<template<typename T,typename A> class V,typename T,typename A> + int convertToContainer(V<T,A>&) const; // Containers with forgotten junk! - template<template<typename T> class V,typename T> - int convertToContainer(const int ,V<T>&,V<T>&) const; + template<template<typename T,typename A> class V,typename T,typename A> + int convertToContainer(const int ,V<T,A>&,V<T,A>&) const; template<typename T> int convertToObject(T&) const; @@ -74,8 +74,8 @@ class XMLread : public XMLobject std::ostream& operator<<(std::ostream&,const XMLread&); -} // NAMESPACE XML +} // NAMESPACE XML -} // NAMESPACE Mantid +} // NAMESPACE Mantid #endif diff --git a/Code/Mantid/Geometry/Deprecated/inc/XMLvector.h b/Code/Mantid/Geometry/Deprecated/inc/XMLvector.h index f3fc3d58b0853f0ad082bc9c7bb5f36e7f9e4afe..ff56631adac857024629dd7cff23fb2e2b334f5f 100644 --- a/Code/Mantid/Geometry/Deprecated/inc/XMLvector.h +++ b/Code/Mantid/Geometry/Deprecated/inc/XMLvector.h @@ -14,40 +14,39 @@ namespace XML \brief Holds a vector pair */ -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> class XMLvector : public XMLobject { private: int empty; ///< Null value - V<T> X; ///< X values - V<T> Y; ///< Y values + V<T,A> X; ///< X values + V<T,A> Y; ///< Y values public: XMLvector(XMLobject*); XMLvector(XMLobject*,const std::string&); - XMLvector(XMLobject*,const std::string&,const V<T>&,const V<T>&); - XMLvector(const XMLvector<V,T>&); - XMLvector<V,T>* clone() const; - XMLvector<V,T>& operator=(const XMLvector<V,T>&); + XMLvector(XMLobject*,const std::string&,const V<T,A>&,const V<T,A>&); + XMLvector(const XMLvector<V,T,A >&); + XMLvector<V,T,A>* clone() const; + XMLvector<V,T,A>& operator=(const XMLvector<V,T,A>&); ~XMLvector(); void setEmpty() { empty=0; } int isEmpty() const { return empty; } - void setComp(const V<T>&,const V<T>&); ///< Assumes copy setting + void setComp(const V<T,A>&,const V<T,A>&); ///< Assumes copy setting virtual void writeXML(std::ostream&) const; virtual int readObject(std::istream&); - V<T>& getX() { return X; } - V<T>& getY() { return Y; } - const V<T>& getX() const { return X; } - const V<T>& getY() const { return Y; } + V<T,A>& getX() { return X; } + V<T,A>& getY() { return Y; } + const V<T,A>& getX() const { return X; } + const V<T,A>& getY() const { return Y; } }; } // NAMESPACE XML } // NAMESPACE Mantid - #endif diff --git a/Code/Mantid/Geometry/Deprecated/src/XMLcollect.cpp b/Code/Mantid/Geometry/Deprecated/src/XMLcollect.cpp index 6a4fec35fc69b0da8ead1e5e50bdc79fd8a6003f..272e4e3aaa3dd56bf1d9a3d7b537cf8097f0df3c 100644 --- a/Code/Mantid/Geometry/Deprecated/src/XMLcollect.cpp +++ b/Code/Mantid/Geometry/Deprecated/src/XMLcollect.cpp @@ -155,9 +155,9 @@ XMLcollect::addNumGrp(const std::string& GK) return index; } -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> int -XMLcollect::addNumComp(const std::string& Key,const V<T>& ContX) +XMLcollect::addNumComp(const std::string& Key,const V<T,A>& ContX) /*! Adds a component with a vector of things to add \param K :: Key to used @@ -169,7 +169,7 @@ XMLcollect::addNumComp(const std::string& Key,const V<T>& ContX) cx<<Key; const int out = XML::getNumberIndex(WorkGrp->getMap(),cx.str()); cx<<out; - XMLgrid<V,T>* XG=new XMLgrid<V,T>(WorkGrp,cx.str()); + XMLgrid<V,T,A>* XG=new XMLgrid<V,T,A>(WorkGrp,cx.str()); XG->setComp(0,ContX); WorkGrp->addManagedObj(XG); return out; @@ -216,10 +216,10 @@ XMLcollect::addNumComp(const std::string& K,const std::string& V) -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> int XMLcollect::addNumComp(const std::string& Key,const std::string& Fname, - const V<T>& ContX,const V<T>& ContY) + const V<T,A>& ContX,const V<T,A>& ContY) /*! Adds a numbered component, ie K_Num, were K_Num is unique, thus allowing a group of things to be added. @@ -238,9 +238,10 @@ XMLcollect::addNumComp(const std::string& Key,const std::string& Fname, return out; } -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> int -XMLcollect::addNumComp(const std::string& Key,const V<T>& ContX,const V<T>& ContY) +XMLcollect::addNumComp(const std::string& Key,const V<T,A>& ContX, + const V<T,A>& ContY) /*! Adds a numbered component, ie K_Num, were K_Num is unique, thus allowing a group of things to be added. @@ -253,14 +254,14 @@ XMLcollect::addNumComp(const std::string& Key,const V<T>& ContX,const V<T>& Cont cx<<Key; const int out = XML::getNumberIndex(WorkGrp->getMap(),cx.str()); cx<<out; - WorkGrp->addManagedObj(new XMLvector<V,T>(WorkGrp,cx.str(),ContX,ContY)); + WorkGrp->addManagedObj(new XMLvector<V,T,A>(WorkGrp,cx.str(),ContX,ContY)); return out; } -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> int -XMLcollect::addNumComp(const std::string& Key,const V<T>& ContX, - const V<T>& ContY,const V<T>& ContZ) +XMLcollect::addNumComp(const std::string& Key,const V<T,A>& ContX, + const V<T,A>& ContY,const V<T,A>& ContZ) /*! Adds a numbered component, ie K_Num, were K_Num is unique, thus allowing a group of things to be added. @@ -276,15 +277,15 @@ XMLcollect::addNumComp(const std::string& Key,const V<T>& ContX, cx<<Key; const int out = XML::getNumberIndex(WorkGrp->getMap(),cx.str()); cx<<out; - WorkGrp->addComp(cx.str(),XMLvector<V,T>(WorkGrp,Key,ContX,ContY,ContZ)); + WorkGrp->addComp(cx.str(),XMLvector<V,T,A>(WorkGrp,Key,ContX,ContY,ContZ)); return out; } -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> int XMLcollect::addNumComp(const std::string& Key,const std::string& Fname, - const V<T>& ContX,const V<T>& ContY, - const V<T>& ContZ) + const V<T,A>& ContX,const V<T,A>& ContY, + const V<T,A>& ContZ) /*! Adds a numbered component, ie K_Num, were K_Num is unique, thus allowing a group of things to be added. @@ -307,10 +308,10 @@ XMLcollect::addNumComp(const std::string& Key,const std::string& Fname, // --------------------------- -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> int XMLcollect::addComp(const std::string& Key,const std::string& Fname, - const V<T>& ContX, const V<T>& ContY) + const V<T,A>& ContX, const V<T,A>& ContY) /*! Sophisticated container adder: It takes two names and creates a file of the data, and then puts the filename into the object. @@ -326,10 +327,11 @@ XMLcollect::addComp(const std::string& Key,const std::string& Fname, return retVal; } -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> int XMLcollect::addComp(const std::string& Key,const std::string& Fname, - const V<T>& ContX, const V<T>& ContY,const V<T>& ContZ) + const V<T,A>& ContX, const V<T,A>& ContY, + const V<T,A>& ContZ) /*! Sophisticated container adder: It takes two names and creates a file of the data, and then puts the filename into the object. @@ -352,9 +354,9 @@ XMLcollect::addComp(const std::string& Key,const std::string& Fname, // ADDCOMP // ------------------------ -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> int -XMLcollect::addComp(const std::string& Key,const V<T>& ContX) +XMLcollect::addComp(const std::string& Key,const V<T,A>& ContX) /*! Adds a component with a vector of things to add \param K :: Key to used @@ -362,16 +364,16 @@ XMLcollect::addComp(const std::string& Key,const V<T>& ContX) \retval Cnt of new object */ { - XMLgrid<V,T>* XG=new XMLgrid<V,T>(WorkGrp,Key); + XMLgrid<V,T,A>* XG=new XMLgrid<V,T,A>(WorkGrp,Key); XG->setComp(0,ContX); return WorkGrp->addManagedObj(XG); return 0; } -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> int -XMLcollect::addComp(const std::string& Key,const V<T>& ContX, - const V<T>& ContY) +XMLcollect::addComp(const std::string& Key,const V<T,A>& ContX, + const V<T,A>& ContY) /*! Adds a component with a vector of things to add \param K :: Key to used @@ -380,13 +382,13 @@ XMLcollect::addComp(const std::string& Key,const V<T>& ContX, \retval Cnt of new object */ { - return WorkGrp->addManagedObj(new XMLvector<V,T>(WorkGrp,Key,ContX,ContY)); + return WorkGrp->addManagedObj(new XMLvector<V,T,A>(WorkGrp,Key,ContX,ContY)); } -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> int -XMLcollect::addComp(const std::string& Key,const V<T>& ContX, - const V<T>& ContY,const V<T>& ContZ) +XMLcollect::addComp(const std::string& Key,const V<T,A>& ContX, + const V<T,A>& ContY,const V<T,A>& ContZ) /*! Adds a component with a vector of things to add \param K :: Key to used @@ -396,18 +398,18 @@ XMLcollect::addComp(const std::string& Key,const V<T>& ContX, \retval Cnt of new object */ { - XMLgrid<V,T>* XG=new XMLgrid<V,T>(WorkGrp,Key); + XMLgrid<V,T,A>* XG=new XMLgrid<V,T,A>(WorkGrp,Key); XG->setComp(0,ContX); XG->setComp(1,ContY); XG->setComp(2,ContZ); return WorkGrp->addManagedObj(XG); } -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> int -XMLcollect::addComp(const std::string& Key,const V<T>& ContA, - const V<T>& ContB,const V<T>& ContC, - const V<T>& ContD) +XMLcollect::addComp(const std::string& Key,const V<T,A>& ContA, + const V<T,A>& ContB,const V<T,A>& ContC, + const V<T,A>& ContD) /*! Adds a component with a vector of things to add \param K :: Key to used @@ -418,7 +420,7 @@ XMLcollect::addComp(const std::string& Key,const V<T>& ContA, \retval Cnt of new object */ { - XMLgrid<V,T>* XG=new XMLgrid<V,T>(WorkGrp,Key); + XMLgrid<V,T,A>* XG=new XMLgrid<V,T,A>(WorkGrp,Key); XG->setComp(0,ContA); XG->setComp(1,ContB); XG->setComp(2,ContC); @@ -526,9 +528,10 @@ XMLcollect::addAttribute(const std::string& Comp, } else { - std::stringstream X; - X<<"Error getting addAttribute:"+Comp <<" from Workgroup "<<*WorkGrp; - PLog.error(X.str()); + std::ostringstream cx; + cx<<"Error getting XMLcollect::addAttribute:"+Comp+ + " from Workgroup "<<*WorkGrp; + PLog.error(cx.str()); } return; } @@ -924,7 +927,7 @@ XMLcollect::writeXML(std::ostream& OX) const return; } -} // NAMESPACE XML +}; /*! \cond TEMPLATE @@ -962,9 +965,9 @@ template int XML::XMLcollect::addComp(const std::string&,const Geometry::Vec3D&) template int XML::XMLcollect::addNumComp(const std::string&,const Geometry::Vec3D&); #endif +} /*! \endcond TEMPLATE */ -} // NAMESPACE Mantid diff --git a/Code/Mantid/Geometry/Deprecated/src/XMLgrid.cpp b/Code/Mantid/Geometry/Deprecated/src/XMLgrid.cpp index 794892c3cadc37dd6e9a80321fce39e0e95c6ae8..38f9bf400cdd27a0485b6b5e60ad3276e3247b98 100644 --- a/Code/Mantid/Geometry/Deprecated/src/XMLgrid.cpp +++ b/Code/Mantid/Geometry/Deprecated/src/XMLgrid.cpp @@ -31,18 +31,18 @@ namespace XML // XMLgrid // -------------------------------------------------------- - -template<template<typename T> class V, typename T> -XMLgrid<V,T>::XMLgrid(XMLobject* B,const std::string& K) : +template<template<typename T,typename A> class V,typename T,typename A> +XMLgrid<V,T,A>::XMLgrid(XMLobject* B,const std::string& K) : XMLobject(B,K),size(0),empty(1),contLine(10) /*! Constructor with junk key (value is NOT set) + \param B :: XMLobject to used as parent \param K :: key */ {} -template<template<typename T> class V, typename T> -XMLgrid<V,T>::XMLgrid(const XMLgrid<V,T>& A) : +template<template<typename T,typename Alloc> class V,typename T,typename Alloc> +XMLgrid<V,T,Alloc>::XMLgrid(const XMLgrid<V,T,Alloc>& A) : XMLobject(A),size(A.size),empty(A.empty),Grid(A.Grid), contLine(A.contLine) /*! @@ -51,9 +51,9 @@ XMLgrid<V,T>::XMLgrid(const XMLgrid<V,T>& A) : */ {} -template<template<typename T> class V, typename T> -XMLgrid<V,T>& -XMLgrid<V,T>::operator=(const XMLgrid<V,T>& A) +template<template<typename T,typename A> class V,typename T,typename Alloc> +XMLgrid<V,T,Alloc>& +XMLgrid<V,T,Alloc>::operator=(const XMLgrid<V,T,Alloc>& A) /*! Standard assignment operator \param A :: Object to copy @@ -72,28 +72,27 @@ XMLgrid<V,T>::operator=(const XMLgrid<V,T>& A) } -template<template<typename T> class V, typename T> -XMLgrid<V,T>* -XMLgrid<V,T>::clone() const +template<template<typename T,typename A> class V,typename T,typename A> +XMLgrid<V,T,A>* +XMLgrid<V,T,A>::clone() const /*! The clone function \return new copy of this */ { - return new XMLgrid<V,T>(*this); + return new XMLgrid<V,T,A>(*this); } - -template<template<typename T> class V, typename T> -XMLgrid<V,T>::~XMLgrid() +template<template<typename T,typename A> class V,typename T,typename A> +XMLgrid<V,T,A>::~XMLgrid() /*! Standard destructor */ {} -template<template<typename T> class V, typename T> +template<template<typename T,typename A> class V,typename T,typename A> void -XMLgrid<V,T>::setComp(const int Index,const V<T>& VO) +XMLgrid<V,T,A>::setComp(const int Index,const V<T,A>& VO) /*! Set Component in Grid. \param Index :: Index number to add @@ -113,9 +112,9 @@ XMLgrid<V,T>::setComp(const int Index,const V<T>& VO) return; } -template<template<typename T> class V, typename T> -V<T>& -XMLgrid<V,T>::getGVec(const int Index) +template<template<typename T,typename A> class V,typename T,typename A> +V<T,A>& +XMLgrid<V,T,A>::getGVec(const int Index) /*! Set Component in Grid. \param Index :: Index number to add @@ -127,9 +126,9 @@ XMLgrid<V,T>::getGVec(const int Index) return Grid[Index]; } -template<template<typename T> class V, typename T> -const V<T>& -XMLgrid<V,T>::getGVec(const int Index) const +template<template<typename T,typename A> class V,typename T,typename A> +const V<T,A>& +XMLgrid<V,T,A>::getGVec(const int Index) const /*! Set Component in Grid. \param Index :: Index number to add @@ -141,9 +140,9 @@ XMLgrid<V,T>::getGVec(const int Index) const return Grid[Index]; } -template<template<typename T> class V, typename T> +template<template<typename T,typename A> class V,typename T,typename A> int -XMLgrid<V,T>::readObject(std::istream& FX) +XMLgrid<V,T,A>::readObject(std::istream& FX) /*! Generic read from a string. Assumes that size has been set. @@ -184,9 +183,9 @@ XMLgrid<V,T>::readObject(std::istream& FX) return 0; } -template<template<typename T> class V, typename T> +template<template<typename T,typename A> class V,typename T,typename A> void -XMLgrid<V,T>::writeXML(std::ostream& OX) const +XMLgrid<V,T,A>::writeXML(std::ostream& OX) const /*! Write out the object \param OX :: output stream @@ -201,11 +200,11 @@ XMLgrid<V,T>::writeXML(std::ostream& OX) const return; } - typename std::vector< V<T> >::const_iterator gc; - std::vector< typename V<T>::const_iterator > IterVec; // Vector of iterators - std::vector< typename V<T>::const_iterator > IterEnd; // Vector of iterators - typename std::vector< typename V<T>::const_iterator >::iterator ivc; // Vector of iterators - typename std::vector< typename V<T>::const_iterator >::iterator evc; // Vector of iterators + typename std::vector< V<T,A> >::const_iterator gc; + std::vector< typename V<T,A>::const_iterator > IterVec; // Vector of iterators + std::vector< typename V<T,A>::const_iterator > IterEnd; // Vector of iterators + typename std::vector< typename V<T,A>::const_iterator >::iterator ivc; // Vector of iterators + typename std::vector< typename V<T,A>::const_iterator >::iterator evc; // Vector of iterators int finished=Grid.size(); // Number of components that must be changed for(gc=Grid.begin();gc!=Grid.end();gc++) { @@ -265,10 +264,10 @@ XMLgrid<V,T>::writeXML(std::ostream& OX) const /// \cond TEMPLATE -template class XML::XMLgrid<std::vector,std::string>; -template class XML::XMLgrid<std::vector,double>; -template class XML::XMLgrid<std::vector,int>; +template class XML::XMLgrid<std::vector,std::string,std::allocator<std::string> >; +template class XML::XMLgrid<std::vector,double,std::allocator<double> >; +template class XML::XMLgrid<std::vector,int,std::allocator<int> >; /// \endcond TEMPLATE -} // NAMESPACE Mantid +} // NAMESPACE Mantid diff --git a/Code/Mantid/Geometry/Deprecated/src/XMLgridSupport.cpp b/Code/Mantid/Geometry/Deprecated/src/XMLgridSupport.cpp index 5e31b89e7a1cda1b4d898ecb15d8cbcf44c28ded..b106b2f07c301256df257a322ef3b7b7963c7d43 100644 --- a/Code/Mantid/Geometry/Deprecated/src/XMLgridSupport.cpp +++ b/Code/Mantid/Geometry/Deprecated/src/XMLgridSupport.cpp @@ -37,6 +37,8 @@ combineGrid(XML::XMLcollect& XOut, \param blockCount :: to write the time separately */ { + typedef XML::XMLgrid<std::vector,double,std::allocator<double> > xGridType; + int notValidCnt(0); // index count of items int gcnt(0); // grid object cnt @@ -47,10 +49,9 @@ combineGrid(XML::XMLcollect& XOut, (oPtr) ? dynamic_cast<XML::XMLgroup*>(oPtr->getParent()) : 0; // Get XMLgrid object - XML::XMLgrid<std::vector,double>* gPtr= - dynamic_cast<XML::XMLgrid<std::vector,double>*>(oPtr); - XML::XMLgrid<std::vector,double>* gStore(0); // Item before adding - std::vector<XML::XMLgrid<std::vector,double>*> gArray; + xGridType* gPtr=dynamic_cast<xGridType*>(oPtr); + xGridType* gStore(0); // Item before adding + std::vector<xGridType*> gArray; int sNum(0); while(oPtr) // While findind an object @@ -66,8 +67,7 @@ combineGrid(XML::XMLcollect& XOut, sNum=gcnt; gArray.push_back(gStore); } - gStore=new XML::XMLgrid<std::vector,double> - (XOut.getCurrent(),"GridCluster"); + gStore=new xGridType(XOut.getCurrent(),"GridCluster"); for(int i=0;i<gPtr->getSize();i++) gStore->setComp(i,gPtr->getGVec(i)); } @@ -85,7 +85,7 @@ combineGrid(XML::XMLcollect& XOut, notValidCnt++; } oPtr=XOut.findObj(BName,notValidCnt); - gPtr=dynamic_cast<XML::XMLgrid<std::vector,double>*>(oPtr); + gPtr=dynamic_cast<xGridType*>(oPtr); } @@ -96,7 +96,7 @@ combineGrid(XML::XMLcollect& XOut, gArray.push_back(gStore); } - std::vector<XML::XMLgrid<std::vector,double>*>::iterator vc; + std::vector<xGridType*>::iterator vc; if (groupPtr) { for(vc=gArray.begin();vc!=gArray.end();vc++) @@ -125,7 +125,7 @@ combineDeepGrid(XML::XMLcollect& XOut, \param blockCount :: to write the time separately */ { - typedef XML::XMLgrid<std::vector,double> GTYPE; + typedef XML::XMLgrid<std::vector,double,std::allocator<double> > xGridType; int objectCnt(0); // Object count int gcnt(0); // grid object cnt @@ -141,10 +141,10 @@ combineDeepGrid(XML::XMLcollect& XOut, int individualGrpCnt(0); // Get XMLgrid object - GTYPE* gPtr=oPtr->getType<GTYPE>(individualGrpCnt); + xGridType* gPtr=oPtr->getType<xGridType>(individualGrpCnt); - GTYPE* gStore(0); // Item before adding - std::vector<GTYPE*> gArray; + xGridType* gStore(0); // Item before adding + std::vector<xGridType*> gArray; int sNum(0); while(gPtr) // While finding an object @@ -158,7 +158,7 @@ combineDeepGrid(XML::XMLcollect& XOut, sNum=gcnt; gArray.push_back(gStore); } - gStore=new GTYPE(XOut.getCurrent(),"GridCluster"); + gStore=new xGridType(XOut.getCurrent(),"GridCluster"); for(int i=0;i<gPtr->getSize();i++) gStore->setComp(i,gPtr->getGVec(i)); } @@ -170,14 +170,14 @@ combineDeepGrid(XML::XMLcollect& XOut, } XOut.deleteObj(gPtr); gcnt++; - gPtr=oPtr->getType<GTYPE>(); + gPtr=oPtr->getType<xGridType>(); if (!gPtr) // New individual group needed { objectCnt++; XML::XMLgroup* oPtr=dynamic_cast<XML::XMLgroup*> (XOut.findObj(BName,objectCnt)); gPtr=(oPtr) ? - oPtr->getType<GTYPE>(individualGrpCnt) : 0; + oPtr->getType<xGridType>(individualGrpCnt) : 0; } } // Add last componenet if valid @@ -188,12 +188,13 @@ combineDeepGrid(XML::XMLcollect& XOut, gArray.push_back(gStore); } // Now add back grid objects into stream - std::vector<GTYPE*>::iterator vc; + std::vector<xGridType*>::iterator vc; for(vc=gArray.begin();vc!=gArray.end();vc++) groupPtr->addManagedObj(*vc); return; } -} // Namespace XML -} // Namespace Mantid +} // NAMESPACE XML + +} // NAMESPACE Mantid diff --git a/Code/Mantid/Geometry/Deprecated/src/XMLgroup.cpp b/Code/Mantid/Geometry/Deprecated/src/XMLgroup.cpp index 48f309d3c20334fe08700f680dc7d2af007cbbeb..6cafb492894b1ef2a2532602d51ca4a49860d4ff 100644 --- a/Code/Mantid/Geometry/Deprecated/src/XMLgroup.cpp +++ b/Code/Mantid/Geometry/Deprecated/src/XMLgroup.cpp @@ -12,7 +12,7 @@ #include <boost/bind.hpp> #include "Logger.h" -#include "Exception.h" +#include "AuxException.h" #include "RefControl.h" #include "Matrix.h" #include "Vec3D.h" @@ -570,9 +570,9 @@ template int XML::XMLgroup::addComp(const std::string&,const double&); template int XML::XMLgroup::addComp(const std::string&,const int&); template int XML::XMLgroup::addComp(const std::string&,const std::string&); template int XML::XMLgroup::addComp(const std::string&,const Geometry::Vec3D&); -template XML::XMLgrid<std::vector,double>* +template XML::XMLgrid<std::vector,double,std::allocator<double> >* XML::XMLgroup::getType(const int) const; -template XML::XMLgrid<std::vector,double>* +template XML::XMLgrid<std::vector,double,std::allocator<double> >* XML::XMLgroup::getLastType(const int) const; /// \endcond TEMPLATE diff --git a/Code/Mantid/Geometry/Deprecated/src/XMLread.cpp b/Code/Mantid/Geometry/Deprecated/src/XMLread.cpp index bb832c08221acf8019772d55d6e78ff5ae15d54c..46f6273dffb90bba296b7795061bcaefa46aafe6 100644 --- a/Code/Mantid/Geometry/Deprecated/src/XMLread.cpp +++ b/Code/Mantid/Geometry/Deprecated/src/XMLread.cpp @@ -16,14 +16,12 @@ #include "Matrix.h" #include "Vec3D.h" #include "Support.h" -// #include "SpecDataHold.h" #include "XMLnamespace.h" #include "XMLattribute.h" #include "XMLobject.h" #include "XMLgroup.h" #include "XMLread.h" - namespace Mantid { @@ -152,9 +150,10 @@ XMLread::addLine(const std::string& Line) return; } -template<template<typename T> class V,typename T> + +template<template<typename T,typename A> class V,typename T,typename A> int -XMLread::convertToContainer(V<T>& CT) const +XMLread::convertToContainer(V<T,A>& CT) const /*! Given a container of type V<T>, convert all of the lines to single objects in the system @@ -175,9 +174,9 @@ XMLread::convertToContainer(V<T>& CT) const return CT.size(); } -template<template<typename T> class V,typename T> +template<template<typename T,typename A> class V,typename T,typename A> int -XMLread::convertToContainer(const int dmp,V<T>& CA,V<T>& CB) const +XMLread::convertToContainer(const int dmp,V<T,A>& CA,V<T,A>& CB) const /*! Given a container of type V<T>, convert all of the lines to single objects in the system @@ -320,6 +319,7 @@ template int XMLread::convertToContainer(const int,std::vector<double>&, \endcond TEMPLATE */ -} // NAMESPACE XML +} // NAMESPACE XML + +} // NAMESPACE Mantid -} // NAMESPACE Mantid diff --git a/Code/Mantid/Geometry/Deprecated/src/XMLvector.cpp b/Code/Mantid/Geometry/Deprecated/src/XMLvector.cpp index 8533a450105ea99525e64520e883ca99c7e6110d..7a22bc0f7e2af7be85c05ce743054daf8b52db79 100644 --- a/Code/Mantid/Geometry/Deprecated/src/XMLvector.cpp +++ b/Code/Mantid/Geometry/Deprecated/src/XMLvector.cpp @@ -34,8 +34,13 @@ namespace XML // -------------------------------------------------------- -template<template<typename T> class V, typename T> -XMLvector<V,T>::XMLvector(XMLobject* B,const std::string& K) : +// -------------------------------------------------------- +// XMLvector +// -------------------------------------------------------- + + +template<template<typename T,typename A> class V, typename T,typename A> +XMLvector<V,T,A>::XMLvector(XMLobject* B,const std::string& K) : XMLobject(B,K),empty(1) /*! Constructor with junk key (value is NOT set) @@ -43,9 +48,9 @@ XMLvector<V,T>::XMLvector(XMLobject* B,const std::string& K) : */ {} -template<template<typename T> class V, typename T> -XMLvector<V,T>::XMLvector(XMLobject* B,const std::string& K, - const V<T>& Xvec,const V<T>& Yvec) : +template<template<typename T,typename A> class V, typename T,typename A> +XMLvector<V,T,A>::XMLvector(XMLobject* B,const std::string& K, + const V<T,A>& Xvec,const V<T,A>& Yvec) : XMLobject(B,K),empty(0),X(Xvec),Y(Yvec) /*! Constructor with Key and Value @@ -54,18 +59,20 @@ XMLvector<V,T>::XMLvector(XMLobject* B,const std::string& K, */ {} -template<template<typename T> class V, typename T> -XMLvector<V,T>::XMLvector(const XMLvector<V,T>& A) : +template<template<typename T,typename Alloc> + class V, typename T,typename Alloc> +XMLvector<V,T,Alloc>::XMLvector(const XMLvector<V,T,Alloc>& A) : XMLobject(A),empty(A.empty),X(A.X),Y(A.Y) /*! Standard copy constructor - \param A :: XMLvectory to copy + \param A :: XMLvector to copy */ {} -template<template<typename T> class V, typename T> -XMLvector<V,T>& -XMLvector<V,T>::operator=(const XMLvector<V,T>& A) +template<template<typename T,typename Alloc> + class V, typename T,typename Alloc> +XMLvector<V,T,Alloc>& +XMLvector<V,T,Alloc>::operator=(const XMLvector<V,T,Alloc>& A) /*! Standard assignment operator \param A :: Object to copy @@ -82,28 +89,27 @@ XMLvector<V,T>::operator=(const XMLvector<V,T>& A) return *this; } - -template<template<typename T> class V, typename T> -XMLvector<V,T>* -XMLvector<V,T>::clone() const +template<template<typename T,typename A> class V, typename T,typename A> +XMLvector<V,T,A>* +XMLvector<V,T,A>::clone() const /*! The clone function \return new copy of this */ { - return new XMLvector<V,T>(*this); + return new XMLvector<V,T,A>(*this); } -template<template<typename T> class V, typename T> -XMLvector<V,T>::~XMLvector() +template<template<typename T,typename A> class V, typename T,typename A> +XMLvector<V,T,A>::~XMLvector() /*! Standard destructor */ { } -template<template<typename T> class V, typename T> +template<template<typename T,typename A> class V, typename T,typename A> int -XMLvector<V,T>::readObject(std::istream& FX) +XMLvector<V,T,A>::readObject(std::istream& FX) /*! Generic read from a string \param FX :: Filestream to read from @@ -143,9 +149,9 @@ XMLvector<V,T>::readObject(std::istream& FX) return 0; } -template<template<typename T> class V, typename T> +template<template<typename T,typename A> class V, typename T,typename A> void -XMLvector<V,T>::writeXML(std::ostream& OX) const +XMLvector<V,T,A>::writeXML(std::ostream& OX) const /*! Write out the object \param OX :: output stream @@ -160,19 +166,20 @@ XMLvector<V,T>::writeXML(std::ostream& OX) const return; } OX<<"<"<<KeyOut<<Attr<<">"<<std::endl; - typename V<T>::const_iterator xc=X.begin(); - typename V<T>::const_iterator yc; + typename V<T,A>::const_iterator xc=X.begin(); + typename V<T,A>::const_iterator yc; for(yc=Y.begin();yc!=Y.end();xc++,yc++) OX<<(*xc)<<" "<<(*yc)<<std::endl; OX<<"</"<<KeyOut<<">"<<std::endl; return; } + } // NAMESPACE XML /// \cond TEMPLATE -template class XML::XMLvector<std::vector,double>; +template class XML::XMLvector<std::vector,double,std::allocator<double> >; /// \endcond TEMPLATE diff --git a/Code/Mantid/Geometry/Deprecated/src/mathSupport.cpp b/Code/Mantid/Geometry/Deprecated/src/mathSupport.cpp index 327c93810483d7a3c5faa4565db587b404bc1495..64d82988c2daef8ba38e191693657be440d7a9ae 100644 --- a/Code/Mantid/Geometry/Deprecated/src/mathSupport.cpp +++ b/Code/Mantid/Geometry/Deprecated/src/mathSupport.cpp @@ -319,7 +319,7 @@ solveQuadratic(const InputIter Coef,std::pair<std::complex<double>, } std::complex<double> CQ(-0.5*b,0); -#if __GNU__ +#ifndef __WIN32__ CQ.imag() = (b>=0) ? -0.5*sqrt(-cf) : 0.5*sqrt(-cf); #else