]> Creatis software - gdcm.git/blob - src/gdcmElementSet.h
STYLE: ivars should start with a capital letter. Accessors should be const to avoid...
[gdcm.git] / src / gdcmElementSet.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmElementSet.h,v $
5   Language:  C++
6   Date:      $Date: 2004/10/25 04:47:43 $
7   Version:   $Revision: 1.21 $
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 "gdcmCommon.h"
23 #include "gdcmDocEntrySet.h"
24 #include <map>
25 #include <iostream>
26
27 class ValEntry;
28 class BinEntry;
29 class SeqEntry;
30
31 namespace gdcm 
32 {
33 typedef std::map<TagKey, DocEntry *> TagDocEntryHT;
34
35 //-----------------------------------------------------------------------------
36
37 class GDCM_EXPORT ElementSet : public DocEntrySet
38 {
39 public:
40    ElementSet(int);
41    ~ElementSet();
42
43    bool AddEntry(DocEntry *Entry);
44    bool RemoveEntry(DocEntry *EntryToRemove);
45    bool RemoveEntryNoDestroy(DocEntry *EntryToRemove);
46    
47    void Print(std::ostream &os = std::cout); 
48    void Write(std::ofstream *fp, FileType filetype); 
49    
50    /// Accessor to \ref TagHT
51    // Do not expose this to user (public API) ! 
52    // A test is using it thus put it in public (matt)
53    TagDocEntryHT const & GetTagHT() const { return TagHT; };
54
55 protected:
56     
57 private:
58 // Variables
59    /// Hash Table (map), to provide fast access
60    TagDocEntryHT TagHT; 
61  
62    friend class Document;
63    friend class DicomDir; //For accessing private TagHT
64 };
65 } // end namespace gdcm
66 //-----------------------------------------------------------------------------
67 #endif
68