freXMLCollectionBase.txx

Go to the documentation of this file.
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.txx,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_txx
00024 #define __freXMLCollectionBase_txx
00025 
00026 #include "freXMLCollectionBase.h"
00027 
00028 namespace FREE
00029 {
00030 
00032         template <class TXMLElement>
00033                 void
00034                 XMLCollectionBase< TXMLElement>::Reset()
00035         {
00036                 XMLStreamObject::Reset();
00037     SmartCollectionBase<TXMLElement>::Reset();
00038         };
00039 
00040         template <class TXMLElement>
00041                 XMLCollectionBase< TXMLElement>& 
00042                 XMLCollectionBase< TXMLElement>::
00043 		operator = (const XMLCollectionBase& rCollection)
00044         {
00045                 if ( this == &rCollection) return *this;
00046 
00047                 this->LoadFromString(rCollection.SaveToString());
00048                 return *this;
00049         };
00050 
00052         template <class TXMLElement>
00053                 XMLCollectionBase< TXMLElement>& 
00054                 XMLCollectionBase< TXMLElement>::
00055     operator + (const XMLCollectionBase& rCollection)
00056         {
00057     return CollectionBase<TXMLElement>::operator + (rCollection);
00058         };
00059 
00060         template <class TXMLElement>
00061                 std::string 
00062                 XMLCollectionBase< TXMLElement>::
00063 		SaveData(const unsigned int& iDepth, bool& bHasSubElements) const
00064         {
00065                 std::string result;
00066                 for (typename ElementVectorType::const_iterator pos = this->m_Elements.begin(); pos!=this->m_Elements.end(); pos++)
00067                 {
00068                         AddSubElement(result,(*pos),iDepth);
00069                 };
00070 
00071                 bHasSubElements = this->m_Elements.size()!=0;
00072 
00073                 return result;
00074         };
00075 
00076 }//end of namespace FREE
00077 
00078 #endif

Generated at Sat Oct 13 18:13:55 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000