]> Creatis software - gdcm.git/blob - src/gdcmElementSet.h
ENH: Adding 'gdcm' namespace. Be nice with me this was a ~13000 lines patch. Also...
[gdcm.git] / src / gdcmElementSet.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmElementSet.h,v $
5   Language:  C++
6   Date:      $Date: 2004/10/12 04:35:46 $
7   Version:   $Revision: 1.19 $
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 namespace gdcm 
31 {
32
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    virtual bool AddEntry(DocEntry *Entry);
44    bool RemoveEntry(DocEntry *EntryToRemove);
45    bool RemoveEntryNoDestroy(DocEntry *EntryToRemove);
46    
47    virtual void Print(std::ostream &os = std::cout); 
48    virtual void Write(FILE *fp, FileType filetype); 
49
50    /// Accessor to \ref TagHT
51    // Do not expose this to user (public API) !
52    // I re-add it temporaryly JPRx
53    TagDocEntryHT &GetEntry() { return TagHT; };
54
55
56 protected:
57 // Variables
58    /// Hash Table (map), to provide fast access
59    TagDocEntryHT TagHT; 
60      
61 private:
62    /// Just for following ::GetTagHT()
63    friend class Document;
64
65    /// Accessor to \ref TagHT
66    TagDocEntryHT* GetTagHT() { return &TagHT; };
67 };
68 } // end namespace gdcm
69 //-----------------------------------------------------------------------------
70 #endif
71