Program: gdcm
Module: $RCSfile: gdcmSeqEntry.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:56 $
- Version: $Revision: 1.52 $
+ Date: $Date: 2005/02/02 16:18:49 $
+ Version: $Revision: 1.53 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
SeqEntry::~SeqEntry()
{
- for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
- {
- delete *cc;
- }
- if (SeqTerm)
- {
- delete SeqTerm;
- }
+ ClearSQItem();
}
//-----------------------------------------------------------------------------
binary_write(*fp, seq_term_lg);
}
+/**
+ * \brief adds the passed ITEM to the ITEM chained List for this SeQuence.
+ * @param sqItem SQItem to be pushed back in the SeqEntry
+ * @param itemNumber ordinal number of the SQItem
+ * \note NOT end-user intendend method !
+ */
+void SeqEntry::AddSQItem(SQItem *sqItem, int itemNumber)
+{
+// FIXME : SQItemNumber is supposed to be the ordinal number of the SQItem
+// within the Sequence.
+// Either only 'push_back' is allowed,
+// and we just have to do something like SeqEntry::lastNb++
+// Or we can add (or remove) anywhere, and SQItemNumber will be broken
+ sqItem->SetSQItemNumber(itemNumber);
+ Items.push_back(sqItem);
+}
+
+/**
+ * \brief Remove all SQItem.
+ */
+void SeqEntry::ClearSQItem()
+{
+ for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
+ {
+ delete *cc;
+ }
+ if (SeqTerm)
+ {
+ delete SeqTerm;
+ }
+}
+
/**
* \brief Get the first entry while visiting the SeqEntry
* \return The first SQItem if found, otherwhise NULL
return Items.size();
}
-/**
- * \brief adds the passed ITEM to the ITEM chained List for this SeQuence.
- * @param sqItem SQItem to be pushed back in the SeqEntry
- * @param itemNumber ordinal number of the SQItem
- * \note NOT end-user intendend method !
- */
-void SeqEntry::AddSQItem(SQItem *sqItem, int itemNumber)
-{
-// FIXME : SQItemNumber is supposed to be the ordinal number of the SQItem
-// within the Sequence.
-// Either only 'push_back' is allowed,
-// and we just have to do something like SeqEntry::lastNb++
-// Or we can add (or remove) anywhere, and SQItemNumber will be broken
- sqItem->SetSQItemNumber(itemNumber);
- Items.push_back(sqItem);
-}
-
//-----------------------------------------------------------------------------
// Protected