From: jpr Date: Wed, 19 Jan 2005 10:30:51 +0000 (+0000) Subject: GetDocEntry,GetValEntry,GetBinEntry,GetSeqEntry are now 'pure virtual' methods X-Git-Tag: Version1.0.bp~252 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=d664f67324436fea9f1024c7641ae4322dab5d88;p=gdcm.git GetDocEntry,GetValEntry,GetBinEntry,GetSeqEntry are now 'pure virtual' methods of DocEntrySet --- diff --git a/src/gdcmDocEntrySet.h b/src/gdcmDocEntrySet.h index 8d74d2cf..055548d1 100644 --- a/src/gdcmDocEntrySet.h +++ b/src/gdcmDocEntrySet.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntrySet.h,v $ Language: C++ - Date: $Date: 2005/01/11 15:15:38 $ - Version: $Revision: 1.37 $ + Date: $Date: 2005/01/19 10:30:51 $ + Version: $Revision: 1.38 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -63,16 +63,38 @@ public: DocEntrySet() {}; virtual ~DocEntrySet() {}; - /// \brief adds any type of entry to the entry set (pure vitual) - virtual bool AddEntry(DocEntry *Entry) = 0; // pure virtual - virtual bool RemoveEntry(DocEntry *EntryToRemove)=0; // pure virtual - virtual bool RemoveEntryNoDestroy(DocEntry *EntryToRemove)=0; // pure virtual + // ------- '... =0;' stands for 'Pure Virtual' + + /// \brief adds any type of entry to the entry set + virtual bool AddEntry(DocEntry *Entry) = 0; + + /// \brief Removes any type of entry out of the entry set, and destroys it + virtual bool RemoveEntry(DocEntry *EntryToRemove)=0; + + /// \brief Removes any type of entry out of the entry set, DOESN'T destroy it + virtual bool RemoveEntryNoDestroy(DocEntry *EntryToRemove)=0; /// \brief write any type of entry to the entry set - virtual void WriteContent (std::ofstream *fp, FileType filetype) = 0;// pure virtual + virtual void WriteContent (std::ofstream *fp, + FileType filetype) = 0; + /// \brief Gets any type of DocEntry, identified by its (group,element) virtual DocEntry *GetDocEntry(uint16_t group, uint16_t elem) = 0; + + /// \brief Gets a ValEntry, identified by its (group,element) + virtual ValEntry *GetValEntry(uint16_t group, + uint16_t elem) = 0; + /// \brief Gets a BinEntry, identified by its (group,element) + virtual BinEntry *GetBinEntry(uint16_t group, + uint16_t elem) = 0; + + /// \brief Gets a SeqEntry, identified by its (group,element) + virtual SeqEntry *GetSeqEntry(uint16_t group, + uint16_t elem) = 0; + + /// \brief Gets the 'string value' of a ValEntry + /// identified by its (group,element) - Sorry for the name !...- virtual std::string GetEntry(uint16_t group, uint16_t elem) = 0; DictEntry *NewVirtualDictEntry(uint16_t group, diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 4adb7d94..a454f9b1 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/01/18 18:03:16 $ - Version: $Revision: 1.198 $ + Date: $Date: 2005/01/19 10:30:51 $ + Version: $Revision: 1.199 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -409,7 +409,7 @@ bool Document::CloseFile() Fp = 0; } - return true; //FIXME how do we detect a non-close ifstream ? + return true; //FIXME how do we detect a non-closed ifstream ? } /** @@ -620,7 +620,6 @@ SeqEntry *Document::ReplaceOrCreate( uint16_t group, uint16_t elem) } } } - // Create a new seqEntry if necessary if (!seqEntry) { @@ -634,7 +633,6 @@ SeqEntry *Document::ReplaceOrCreate( uint16_t group, uint16_t elem) return NULL; } } - return seqEntry; } @@ -839,8 +837,8 @@ void *Document::GetEntryBinArea(uint16_t group, uint16_t elem) } /** - * \brief Loads (from disk) the element content - * when a string is not suitable + * \brief Loads (from disk) the element content + * when a string is not suitable * @param group group number of the Entry * @param elem element number of the Entry */ @@ -859,8 +857,8 @@ void Document::LoadEntryBinArea(uint16_t group, uint16_t elem) } /** - * \brief Loads (from disk) the element content - * when a string is not suitable + * \brief Loads (from disk) the element content + * when a string is not suitable * @param elem Entry whose binArea is going to be loaded */ void Document::LoadEntryBinArea(BinEntry *elem)