00001 /*========================================================================= 00002 00003 Program: F.R.E.E. - flexible registration evaluation engine 00004 Version: v.1.0.0 00005 Date: $Date: 2006/09/01 12:00:00 $ 00006 Module: $RCSfile: freXMLCollectionBase.h,v $ 00007 Language: C++ 00008 00009 00010 00011 Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics, 00012 Institute for Medical Biometry and Informatics, University of Heidelberg, 00013 Germany). All rights reserved. 00014 See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm 00015 for details. 00016 00017 This software is distributed WITHOUT ANY WARRANTY; without even 00018 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00019 PURPOSE. See the above copyright notices for more information. 00020 00021 =========================================================================*/ 00022 00023 #ifndef __freXMLCollectionBase_h 00024 #define __freXMLCollectionBase_h 00025 00026 #include "freElementals.h" 00027 #include "freExceptions.h" 00028 #include "freXMLStreamObject.h" 00029 #include "freSmartCollectionBase.h" 00030 00031 namespace FREE 00032 { 00033 00046 template <class TXMLElement> 00047 class XMLCollectionBase : public XMLStreamObject, public SmartCollectionBase<TXMLElement> 00048 { 00049 public: 00050 itkTypeMacro(XMLCollectionBase, XMLStreamObject); 00051 00052 typedef SmartCollectionBase<TXMLElement> Superclass; 00053 typedef typename Superclass::ElementType ElementType; 00054 typedef typename Superclass::ElementVectorType ElementVectorType; 00055 typedef typename Superclass::ElementsCountType ElementsCountType; 00056 00057 00059 XMLCollectionBase(const std::string& sXMLTag = cXML_Collection):XMLStreamObject(sXMLTag) 00060 {}; 00061 00063 XMLCollectionBase( const XMLCollectionBase<ElementType>& rCollection ):XMLStreamObject(rCollection.GetXMLTag()) 00064 { 00065 *this = rCollection; 00066 }; 00067 00068 virtual ~XMLCollectionBase() 00069 { 00070 Reset(); 00071 }; 00072 00074 virtual void Reset(); 00075 00078 XMLCollectionBase& operator = (const XMLCollectionBase& rCollection); 00079 00081 XMLCollectionBase& operator + (const XMLCollectionBase& rCollection); 00082 00083 protected: 00085 virtual std::string SaveData(const unsigned int& iDepth, bool& bHasSubElements) const; 00086 }; 00087 00088 }//end of namespace FREE 00089 00090 00091 #ifndef ITK_MANUAL_INSTANTIATION 00092 #include "freXMLCollectionBase.txx" 00093 #endif 00094 00095 #endif
1.5.3 written by Dimitri van Heesch,
© 1997-2000