]> Creatis software - gdcm.git/blob - src/gdcmElementSet.h
* src/gdcmFile.[h|cxx] : add the Print method
[gdcm.git] / src / gdcmElementSet.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmElementSet.h,v $
5   Language:  C++
6   Date:      $Date: 2004/12/16 11:37:03 $
7   Version:   $Revision: 1.27 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef GDCMELEMENTSET_H
20 #define GDCMELEMENTSET_H
21
22 #include "gdcmDocEntrySet.h"
23
24 #include <map>
25 #include <iostream>
26 #include <fstream>
27
28 namespace gdcm 
29 {
30 class ValEntry;
31 class BinEntry;
32 class SeqEntry;
33
34 typedef std::map<TagKey, DocEntry *> TagDocEntryHT;
35
36 //-----------------------------------------------------------------------------
37
38 class GDCM_EXPORT ElementSet : public DocEntrySet
39 {
40 public:
41    ElementSet(int);
42    ~ElementSet();
43
44    virtual void Print(std::ostream &os = std::cout); 
45
46    bool AddEntry(DocEntry *Entry);
47    bool RemoveEntry(DocEntry *EntryToRemove);
48    bool RemoveEntryNoDestroy(DocEntry *EntryToRemove);
49    
50    void WriteContent(std::ofstream *fp, FileType filetype); 
51    
52    /// Accessor to \ref TagHT
53    // Do not expose this to user (public API) ! 
54    // A test is using it thus put it in public (matt)
55    TagDocEntryHT const & GetTagHT() const { return TagHT; };
56
57    void Initialize();
58    DocEntry *GetNextEntry();
59
60 protected:
61     
62 private:
63 // Variables
64    /// Hash Table (map), to provide fast access
65    TagDocEntryHT TagHT; 
66    /// Hash Table (map) iterator, used to visit the TagHT variable
67    TagDocEntryHT::iterator ItTagHT; 
68  
69    friend class Document;
70    friend class DicomDir; //For accessing private TagHT
71    friend class DocEntryArchive; //For accessing private TagHT
72 };
73 } // end namespace gdcm
74 //-----------------------------------------------------------------------------
75 #endif
76