]> Creatis software - gdcm.git/blob - src/gdcmObject.h
Allow to create ex nihilo DICOMDIR
[gdcm.git] / src / gdcmObject.h
1 // gdcmObject.h
2 //-----------------------------------------------------------------------------
3 #ifndef GDCMOBJECT_H
4 #define GDCMOBJECT_H
5
6 #include <string>
7 #include <list>
8 #include "gdcmCommon.h"
9 #include "gdcmHeaderEntry.h"
10 #include "gdcmParser.h"
11 #include "gdcmDicomDirElement.h"
12 //-----------------------------------------------------------------------------
13 class gdcmObject;
14 typedef std::list<gdcmObject *> ListContent;
15
16 //-----------------------------------------------------------------------------
17 class GDCM_EXPORT gdcmObject 
18 {
19 public:
20    gdcmObject(ListTag::iterator begin,ListTag::iterator end,
21               TagHeaderEntryHT *ptagHT, ListTag *plistEntries); 
22    ~gdcmObject(void);
23
24    void SetPrintLevel(int level) { printLevel = level; };
25    virtual void Print(std::ostream &os = std::cout);
26
27    std::string GetEntryByNumber(guint16 group, guint16 element);
28    std::string GetEntryByName(TagName name);
29    bool SetEntryByNumber(std::string val,guint16 group,guint16 element);
30    
31    TagHeaderEntryHT GetEntry(void);
32    ListTag GetListEntry(void);
33 /**
34  * \ingroup gdcmObject
35  * \brief   returns an iterator on the first Header Entry (i.e Dicom Element),
36  *          inside the DICOMDIR chained list,
37  *          related to this 'Object' 
38  * @return
39  */
40    ListTag::iterator debut(void) 
41       { return(beginObj);}
42 /**
43  * \ingroup gdcmObject
44  * \brief   returns an iterator on the last Header Entry (i.e Dicom Element),
45  *          inside the DICOMDIR chained list,
46  *          related to this 'Object' 
47  * @return
48  */
49     ListTag::iterator fin  (void) 
50        { return(endObj);  }
51    
52 protected:
53
54 void FillObject(std::list<gdcmElement> elemList);
55
56 /**
57 * \brief iterator on the first Header Entry (i.e Dicom Element), 
58 *       inside the DICOMDIR chained list,
59 *       related to this 'Object'
60 */   
61    ListTag::iterator beginObj;
62 /**
63 * \brief iterator on the last Header Entry (i.e Dicom Element), 
64 *       inside the DICOMDIR chained list,
65 *       related to this 'Object'
66 */
67    ListTag::iterator endObj;
68 /**
69 * \brief pointer to the HTable of the gdcmParser,
70 *        (because we don't know it within any gdcmObject) 
71 */
72   TagHeaderEntryHT *ptagHT;
73 /**
74 * \brief pointer to the Chained List of the gdcmParser,
75 *        (because we don't know it within any gdcmObject)  
76 */  
77    ListTag *plistEntries;
78 /**
79 * \brief
80 */   
81    int printLevel;
82    
83 /// used to pass variables to FillObject function
84 /// Work as 'global' variables
85    std::list<gdcmHeaderEntry *>::iterator debInsertion, finInsertion, i,j;
86
87 private:
88
89 };
90
91 //-----------------------------------------------------------------------------
92 #endif