]> Creatis software - gdcm.git/blob - src/gdcmSeqEntry.h
61c7d8b6b1ac4b6f16157f5d008be357efb267ee
[gdcm.git] / src / gdcmSeqEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmSeqEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2004/08/26 15:29:53 $
7   Version:   $Revision: 1.15 $
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
19 #ifndef GDCMSQDOCENTRY_H
20 #define GDCMSQDOCENTRY_H
21
22 #include <list>
23
24 #include "gdcmSQItem.h"
25 #include "gdcmDocEntry.h"
26
27 //-----------------------------------------------------------------------------
28 typedef std::list<gdcmSQItem *> ListSQItem;
29 //-----------------------------------------------------------------------------
30
31 class GDCM_EXPORT gdcmSeqEntry : public gdcmDocEntry 
32 {
33 public:
34    gdcmSeqEntry(gdcmDictEntry* e, int depth);
35    gdcmSeqEntry(gdcmDocEntry* d,  int depth);
36    virtual ~gdcmSeqEntry();
37    
38    virtual void Print(std::ostream &os = std::cout); 
39    virtual void Write(FILE *fp, FileType);
40
41    /// returns the SQITEM chained List for this SeQuence.
42    ListSQItem &GetSQItems() { return items; }
43       
44    /// Sets the delimitor mode
45    void SetDelimitorMode(bool dm) { delimitor_mode = dm;}
46
47    /// Sets the Sequence Delimitation Item
48    void SetSequenceDelimitationItem(gdcmDocEntry * e) { seq_term = e;}
49
50    void AddEntry(gdcmSQItem *it, int itemNumber);
51    gdcmSQItem *GetSQItemByOrdinalNumber(int itemNumber);
52
53    void SetDepthLevel(int depth);
54          
55 protected:
56
57 private:
58 // Variables
59
60    /// If this Sequence is in delimitor mode (length =0xffffffff) or not
61    bool delimitor_mode;
62    
63    /// Chained list of SQ Items
64    ListSQItem items;
65    
66    /// sequence terminator item 
67    gdcmDocEntry *seq_term;
68 };
69
70 //-----------------------------------------------------------------------------
71 #endif
72