]> Creatis software - gdcm.git/blob - src/gdcmElementSet.h
Fix mistypings
[gdcm.git] / src / gdcmElementSet.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmElementSet.h,v $
5   Language:  C++
6   Date:      $Date: 2007/09/17 12:16:02 $
7   Version:   $Revision: 1.59 $
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_NAME_SPACE 
29 {
30 typedef std::map<TagKey, DocEntry *> TagDocEntryHT;
31
32 //-----------------------------------------------------------------------------
33 /**
34  * \brief
35  *  ElementSet is based on the STL map<> container
36  * (see  ElementSet::TagHT), as opposed to  SQItem
37  * which is based on an STL list container (see  ListDocEntry).
38  * It contains the 'zero-level- DocEntry (out of any Dicom Sequence)
39  */
40 class GDCM_EXPORT ElementSet : public DocEntrySet
41 {
42    gdcmTypeMacro(ElementSet);
43
44 public:
45    virtual void Print(std::ostream &os = std::cout, 
46                       std::string const &indent = "" ); 
47
48    void WriteContent(std::ofstream *fp, FileType filetype,
49                                     bool insideMetaElements, bool insideSequence); 
50
51    bool AddEntry(DocEntry *Entry);
52    bool RemoveEntry(DocEntry *EntryToRemove);
53    void ClearEntry();
54    
55    DocEntry *GetFirstEntry();
56    DocEntry *GetNextEntry();
57    DocEntry *GetDocEntry(uint16_t group, uint16_t elem);
58    /// Tells us if the ElementSet contains no entry
59    bool IsEmpty() { return TagHT.empty(); }
60    
61    int IsVRCoherent(uint16_t group);
62
63    virtual void Copy(DocEntrySet *set);
64
65 protected:
66    ElementSet();
67    ~ElementSet();
68    /// \brief Some group are illegal withing some Dicom Documents
69    ///        Only the Document knows it.
70    bool MayIWrite(uint16_t )
71                  { return true; }
72 private:
73 // Variables
74    /// Hash Table (map), to provide fast access
75    TagDocEntryHT TagHT;
76    /// iterator, used to visit the TagHT variable
77    TagDocEntryHT::iterator ItTagHT;
78 };
79 } // end namespace gdcm
80 //-----------------------------------------------------------------------------
81 #endif
82