X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src%2FgdcmDicomDirPatient.cxx;h=72081cf3a763f166569d9caa664ba97d9eb039fe;hb=c67ffef593e7635d8dfa7d3fe63d702e5afafc3e;hp=cc2ba5b58d937cb7495d0d23e81a52a60a32d4cd;hpb=ad8f0eb6ea1ad66c443b3640cded8a355efa7b42;p=gdcm.git diff --git a/src/gdcmDicomDirPatient.cxx b/src/gdcmDicomDirPatient.cxx index cc2ba5b5..72081cf3 100644 --- a/src/gdcmDicomDirPatient.cxx +++ b/src/gdcmDicomDirPatient.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirPatient.cxx,v $ Language: C++ - Date: $Date: 2005/01/20 16:16:42 $ - Version: $Revision: 1.30 $ + Date: $Date: 2005/01/25 15:44:23 $ + Version: $Revision: 1.33 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -47,12 +47,7 @@ DicomDirPatient::DicomDirPatient(bool empty): */ DicomDirPatient::~DicomDirPatient() { - for(ListDicomDirStudy::const_iterator cc = Studies.begin(); - cc != Studies.end(); - ++cc ) - { - delete *cc; - } + ClearStudy(); } //----------------------------------------------------------------------------- @@ -60,7 +55,7 @@ DicomDirPatient::~DicomDirPatient() /** * \brief Prints the Object * @param os ostream to write to - * @param indent indent + * @param indent Indentation string to be prepended during printing */ void DicomDirPatient::Print(std::ostream &os, std::string const & ) { @@ -106,6 +101,20 @@ DicomDirStudy* DicomDirPatient::NewStudy() return st; } +/** + * \brief Remove all studies in the patient + */ +void DicomDirPatient::ClearStudy() +{ + for(ListDicomDirStudy::const_iterator cc = Studies.begin(); + cc != Studies.end(); + ++cc ) + { + delete *cc; + } + Studies.clear(); +} + /** * \brief Get the first entry while visiting the DicomDirStudy * \return The first DicomDirStudy if found, otherwhise NULL @@ -126,11 +135,10 @@ DicomDirStudy *DicomDirPatient::GetFirstStudy() DicomDirStudy *DicomDirPatient::GetNextStudy() { gdcmAssertMacro (ItStudy != Studies.end()) - { - ++ItStudy; - if (ItStudy != Studies.end()) - return *ItStudy; - } + + ++ItStudy; + if (ItStudy != Studies.end()) + return *ItStudy; return NULL; }