00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 }
00086
00087
00088 #ifndef ITK_MANUAL_INSTANTIATION
00089 #include "freXMLKeyedCollectionBase.txx"
00090 #endif
00091
00092 #endif