freXMLKeyedCollectionBase.h

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: freXMLKeyedCollectionBase.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 #ifndef __freXMLKeyedCollectionBase_h
00023 #define __freXMLKeyedCollectionBase_h
00024 
00025 #include "freXMLStreamObject.h"
00026 #include "freKeyedCollectionBase.h"
00027 
00028 namespace FREE
00029 {
00030 
00043 template <class TKey, class TXMLElement, class TIdentifierClass>
00044 class XMLKeyedCollectionBase : public XMLStreamObject, public KeyedCollectionBase<TKey,TXMLElement,TIdentifierClass>
00045 {
00046 public:
00047   itkTypeMacro(XMLKeyedCollectionBase, XMLStreamObject);
00048 
00049   typedef KeyedCollectionBase<TKey,TXMLElement,TIdentifierClass> Superclass;
00050   
00051   typedef typename Superclass::ElementType ElementType;
00052   typedef typename Superclass::ElementVectorType ElementVectorType;
00053   typedef typename Superclass::ElementsCountType ElementsCountType;
00054 
00056   XMLKeyedCollectionBase(const std::string& sXMLTag = cXML_Collection):XMLStreamObject(sXMLTag)
00057   {};
00058 
00060   XMLKeyedCollectionBase( const XMLKeyedCollectionBase<TKey,TXMLElement,TIdentifierClass>& rCollection ):XMLStreamObject(rCollection.GetXMLTag())
00061   {
00062     *this = rCollection;
00063   };
00064 
00065   virtual ~XMLKeyedCollectionBase()
00066   {
00067     Reset();
00068   };
00069 
00071   virtual void Reset();
00072 
00075   XMLKeyedCollectionBase<TKey,TXMLElement,TIdentifierClass>& operator = (const XMLKeyedCollectionBase<TKey,TXMLElement,TIdentifierClass>& rCollection);
00076 
00078   XMLKeyedCollectionBase<TKey,TXMLElement,TIdentifierClass>& operator + (const XMLKeyedCollectionBase<TKey,TXMLElement,TIdentifierClass>& rCollection);
00079 
00080 protected:
00082   virtual std::string SaveData(const unsigned int& iDepth, bool& bHasSubElements) const;
00083 };
00084 
00085 }//end of namespace FREE
00086 
00087 
00088 #ifndef ITK_MANUAL_INSTANTIATION
00089 #include "freXMLKeyedCollectionBase.txx"
00090 #endif
00091 
00092 #endif

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