2 //-----------------------------------------------------------------------------
6 #include "gdcmCommon.h"
7 #include "gdcmElValue.h"
11 #include <list> // for linking together *all* the Dicom Elements
13 //-----------------------------------------------------------------------------
14 typedef std::multimap<TagKey, gdcmElValue*> TagElValueHT;
15 typedef std::pair<TagKey, gdcmElValue*> PairHT;
16 typedef std::pair<TagElValueHT::iterator,TagElValueHT::iterator> IterHT;
18 typedef std::list<gdcmElValue*> ListTag; // for linking together the Elements
20 // TODO : to be removed after re-writting gdcmElValSet::UpdateGroupLength
21 // using the chained list instead of the H table
22 typedef std::string GroupKey;
23 typedef std::map<GroupKey, int> GroupHT;
25 //-----------------------------------------------------------------------------
27 * Container for a set of successfully parsed ElValues (i.e. Dicom Elements).
29 class GDCM_EXPORT gdcmElValSet {
33 void Print(std::ostream &);
35 void Add(gdcmElValue*);
37 gdcmElValue* GetElementByNumber(guint16 group, guint16 element);
38 std::string GetElValueByNumber(guint16 group, guint16 element);
40 bool SetElValueByNumber(std::string content, guint16 group, guint16 element);
41 bool SetElValueLengthByNumber(guint32 l, guint16 group, guint16 element);
42 bool SetVoidAreaByNumber(void *a, guint16 Group, guint16 Elem );
44 guint32 GenerateFreeTagKeyInGroup(guint16 group);
45 int CheckIfExistByNumber(guint16 Group, guint16 Elem ); // int !
48 * \ingroup gdcmElValSet
49 * \brief returns a ref to the Dicom Header H table (multimap)
50 * return the Dicom Header H table
52 inline TagElValueHT & gdcmElValSet::GetTagHt(void) { return tagHt; };
55 * \ingroup gdcmElValSet
56 * \brief returns a ref to the Dicom Header chained list
57 * return the Dicom Header chained list
59 inline ListTag & gdcmElValSet::GetListElem(void) { return listElem; };
61 bool Write(FILE *fp, FileType type);
64 void UpdateGroupLength(bool SkipSequence = false, FileType type = ImplicitVR);
65 void WriteElements(FileType type, FILE *);
68 TagElValueHT tagHt; // H Table (multimap), to provide fast access
69 ListTag listElem; // chained list, to keep the 'spacial' ordering
72 //-----------------------------------------------------------------------------