Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 07:53:41 $
- Version: $Revision: 1.104 $
+ Date: $Date: 2005/01/18 11:39:59 $
+ Version: $Revision: 1.105 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DicomDirPatient *DicomDir::GetFirstEntry()
{
ItDicomDirPatient = Patients.begin();
- return *ItDicomDirPatient;
+ if ( ItDicomDirPatient != Patients.end() )
+ return *ItDicomDirPatient;
+ return NULL;
}
/**
*/
DicomDirPatient *DicomDir::GetNextEntry()
{
- if (ItDicomDirPatient != Patients.end())
+ gdcmAssertMacro (ItDicomDirPatient != Patients.end());
{
- DicomDirPatient *tmp = *ItDicomDirPatient;
++ItDicomDirPatient;
- return tmp;
- }
- else
- {
- return NULL;
+ if ( ItDicomDirPatient != Patients.end() )
+ return *ItDicomDirPatient;
}
+ return NULL;
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 07:53:42 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2005/01/18 11:39:59 $
+ Version: $Revision: 1.27 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmGlobal.h"
#include "gdcmDicomDirStudy.h"
#include "gdcmSQItem.h"
+#include "gdcmDebug.h"
namespace gdcm
{
DicomDirStudy *DicomDirPatient::GetFirstEntry()
{
ItDicomDirStudy = Studies.begin();
- return *ItDicomDirStudy;
+ if (ItDicomDirStudy != Studies.end())
+ return *ItDicomDirStudy;
+ return NULL;
}
/**
*/
DicomDirStudy *DicomDirPatient::GetNextEntry()
{
- if (ItDicomDirStudy != Studies.end())
+ gdcmAssertMacro (ItDicomDirStudy != Studies.end())
{
- DicomDirStudy *tmp = *ItDicomDirStudy;
++ItDicomDirStudy;
- return tmp;
- }
- else
- {
- return NULL;
+ if (ItDicomDirStudy != Studies.end())
+ return *ItDicomDirStudy;
}
+ return NULL;
}
//-----------------------------------------------------------------------------
// Protected
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 07:53:42 $
- Version: $Revision: 1.28 $
+ Date: $Date: 2005/01/18 11:39:59 $
+ Version: $Revision: 1.29 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDicomDirElement.h"
#include "gdcmDicomDirImage.h"
#include "gdcmGlobal.h"
+#include "gdcmDebug.h"
namespace gdcm
{
DicomDirImage *DicomDirSerie::GetFirstEntry()
{
ItDicomDirImage = Images.begin();
- return *ItDicomDirImage;
+ if (ItDicomDirImage != Images.end())
+ return *ItDicomDirImage;
+ return NULL;
}
/**
*/
DicomDirImage *DicomDirSerie::GetNextEntry()
{
- if (ItDicomDirImage != Images.end())
+ gdcmAssertMacro (ItDicomDirImage != Images.end());
{
- DicomDirImage *tmp = *ItDicomDirImage;
++ItDicomDirImage;
- return tmp;
- }
- else
- {
- return NULL;
+ if (ItDicomDirImage != Images.end())
+ return *ItDicomDirImage;
}
+ return NULL;
}
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 07:53:42 $
- Version: $Revision: 1.25 $
+ Date: $Date: 2005/01/18 11:39:59 $
+ Version: $Revision: 1.26 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDicomDirElement.h"
#include "gdcmGlobal.h"
#include "gdcmDicomDirSerie.h"
+#include "gdcmDebug.h"
namespace gdcm
{
DicomDirSerie *DicomDirStudy::GetFirstEntry()
{
ItDicomDirSerie = Series.begin();
- return *ItDicomDirSerie;
+ if (ItDicomDirSerie != Series.end())
+ return *ItDicomDirSerie;
+ return NULL;
}
/**
*/
DicomDirSerie *DicomDirStudy::GetNextEntry()
{
- if (ItDicomDirSerie != Series.end())
+ gdcmAssertMacro (ItDicomDirSerie != Series.end());
{
- DicomDirSerie *tmp = *ItDicomDirSerie;
++ItDicomDirSerie;
- return tmp;
- }
- else
- {
- return NULL;
+ if (ItDicomDirSerie != Series.end())
+ return *ItDicomDirSerie;
}
+ return NULL;
}
//-----------------------------------------------------------------------------
// Protected
Program: gdcm
Module: $RCSfile: gdcmDict.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 07:49:41 $
- Version: $Revision: 1.66 $
+ Date: $Date: 2005/01/18 11:39:59 $
+ Version: $Revision: 1.67 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DictEntry *Dict::GetFirstEntry()
{
ItKeyHt = KeyHt.begin();
- return &(ItKeyHt->second);
+ if( ItKeyHt != KeyHt.end() )
+ return &(ItKeyHt->second);
+ return NULL;
}
/**
*/
DictEntry *Dict::GetNextEntry()
{
- if (ItKeyHt != KeyHt.end())
- {
- DictEntry *tmp = &(ItKeyHt->second);
- ++ItKeyHt;
+ gdcmAssertMacro (ItKeyHt != KeyHt.end());
- return tmp;
- }
- else
{
- return NULL;
+ ++ItKeyHt;
+ if (ItKeyHt != KeyHt.end())
+ return &(ItKeyHt->second);
}
+ return NULL;
}
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDictSet.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 08:01:40 $
- Version: $Revision: 1.53 $
+ Date: $Date: 2005/01/18 11:40:00 $
+ Version: $Revision: 1.54 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Dict *DictSet::GetFirstEntry()
{
ItDictHt = Dicts.begin();
- return ItDictHt->second;
+ if( ItDictHt != Dicts.end() )
+ return ItDictHt->second;
+ return NULL;
}
/**
*/
Dict *DictSet::GetNextEntry()
{
- if (ItDictHt != Dicts.end())
- {
- Dict *tmp = ItDictHt->second;
- ++ItDictHt;
-
- return tmp;
- }
- else
- {
- return NULL;
- }
+ gdcmAssertMacro (ItDictHt != Dicts.end());
+
+ ++ItDictHt;
+ if ( ItDictHt != Dicts.end() )
+ return ItDictHt->second;
+ return NULL;
}
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 08:01:41 $
- Version: $Revision: 1.43 $
+ Date: $Date: 2005/01/18 11:40:00 $
+ Version: $Revision: 1.44 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DocEntry *ElementSet::GetFirstEntry()
{
ItTagHT = TagHT.begin();
- return ItTagHT->second;
+ if (ItTagHT != TagHT.end())
+ return ItTagHT->second;
+ return NULL;
}
/**
*/
DocEntry *ElementSet::GetNextEntry()
{
- if (ItTagHT != TagHT.end())
- {
- DocEntry *tmp = ItTagHT->second;
- ++ItTagHT;
+ gdcmAssertMacro (ItTagHT != TagHT.end());
- return tmp;
- }
- else
- {
- return NULL;
- }
+ ++ItTagHT;
+ if (ItTagHT != TagHT.end())
+ return ItTagHT->second;
+ return NULL;
}
//-----------------------------------------------------------------------------