]> Creatis software - gdcm.git/blob - src/gdcmSQItem.h
* In order to fix memory leaks:
[gdcm.git] / src / gdcmSQItem.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmSQItem.h,v $
5   Language:  C++
6   Date:      $Date: 2004/06/19 23:51:04 $
7   Version:   $Revision: 1.8 $
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.htm 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 #ifndef GDCMSQITEM_H
19 #define GDCMSQITEM_H
20
21 #include <list>
22 #include "gdcmDocEntry.h"
23 #include "gdcmDocEntrySet.h"
24 #include "gdcmDocument.h"
25
26 //-----------------------------------------------------------------------------
27 typedef std::list<gdcmDocEntry *> ListDocEntry;
28 //-----------------------------------------------------------------------------
29 class GDCM_EXPORT gdcmSQItem : public gdcmDocEntrySet
30 {
31 public:
32    gdcmSQItem(int);
33    ~gdcmSQItem(void);
34
35    virtual void Print(std::ostream &os = std::cout); 
36
37    /// \brief   returns the DocEntry chained List for this SQ Item.
38    inline ListDocEntry &GetDocEntries() {return docEntries;};   
39    
40    /// \brief   adds the passed DocEntry to the DocEntry chained List for
41    /// this SQ Item.      
42    inline void AddDocEntry(gdcmDocEntry *e) {docEntries.push_back(e);};         
43
44    virtual bool AddEntry(gdcmDocEntry *Entry); // add to the List
45   
46    gdcmDocEntry *GetDocEntryByNumber(guint16 group, guint16 element);
47    gdcmDocEntry *GetDocEntryByName  (std::string Name);
48    
49    bool SetEntryByNumber(std::string val,guint16 group, guint16 element);                   
50     
51    std::string GetEntryByNumber(guint16 group, guint16 element);
52    std::string GetEntryByName(TagName name);
53         
54    inline int GetSQItemNumber() { return SQItemNumber;};
55
56    inline void SetSQItemNumber(int itemNumber) { SQItemNumber=itemNumber;};                  
57 protected:
58
59 // DocEntry related utilities 
60          
61    virtual gdcmDocEntry *NewDocEntryByNumber(guint16 group,
62                                              guint16 element); // TODO
63    virtual gdcmDocEntry *NewDocEntryByName  (std::string Name); //TODO 
64
65 // Variables
66
67    /// \brief chained list of (Elementary) Doc Entries
68    ListDocEntry docEntries;
69   
70    /// \brief SQ Item ordinal number 
71    int SQItemNumber;
72
73    ///\brief pointer to the HTable of the gdcmDocument,
74    ///       (because we don't know it within any gdcmObject nor any gdcmSQItem)
75    TagDocEntryHT *ptagHT;
76        
77 private:
78
79
80 };
81
82 //-----------------------------------------------------------------------------
83 #endif