gdcmSQItem.h

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: gdcmSQItem.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/08/22 16:14:04 $
00007   Version:   $Revision: 1.54 $
00008                                                                                 
00009   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
00010   l'Image). All rights reserved. See Doc/License.txt or
00011   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
00012                                                                                 
00013      This software is distributed WITHOUT ANY WARRANTY; without even
00014      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00015      PURPOSE.  See the above copyright notices for more information.
00016                                                                                 
00017 =========================================================================*/
00018 #ifndef _GDCMSQITEM_H_
00019 #define _GDCMSQITEM_H_
00020 
00021 #include "gdcmDocEntrySet.h"
00022 #include "gdcmElementSet.h"
00023 
00024 #include <list>
00025 #include <fstream>
00026 
00027 namespace GDCM_NAME_SPACE 
00028 {
00029 class DocEntry;
00030 
00031 //-----------------------------------------------------------------------------
00032 typedef std::list<DocEntry *> ListDocEntry;
00033 
00034 //-----------------------------------------------------------------------------
00041 class GDCM_EXPORT SQItem : public DocEntrySet 
00042 {
00043    gdcmTypeMacro(SQItem);
00044 
00045 public:
00046    static SQItem *New(int depthLevel) {return new SQItem(depthLevel);}
00047 
00048    virtual void Print(std::ostream &os = std::cout, 
00049                       std::string const &indent = "" ); 
00050    void WriteContent(std::ofstream *fp, FileType filetype, bool insideMetaElements);
00051    uint32_t ComputeFullLength();
00052 
00053    bool AddEntry(DocEntry *Entry); // add to the List
00054    bool RemoveEntry(DocEntry *EntryToRemove);
00055    void ClearEntry();
00056   
00057    DocEntry *GetFirstEntry();
00058    DocEntry *GetNextEntry();
00059 
00060    DocEntry *GetDocEntry(uint16_t group, uint16_t elem);
00061 
00062    bool IsEmpty() { return DocEntries.empty(); }
00063 
00065    int GetSQItemNumber() { return SQItemNumber; }
00067    void SetSQItemNumber(int itemNumber) { SQItemNumber = itemNumber; }
00068 
00070    int GetDepthLevel() { return SQDepthLevel; }                                                                             
00071 
00073    void SetDepthLevel(int depth) { SQDepthLevel = depth; }
00074 
00075    virtual void Copy(DocEntrySet *set);
00076 
00077 protected:
00078    SQItem(int depthLevel);
00079    ~SQItem();
00080 
00081 // Variables that need to be accessed in subclasses
00083    ListDocEntry DocEntries;
00085    ListDocEntry::iterator ItDocEntries;
00086   
00087 private:
00093    int SQDepthLevel;
00094 
00096    int SQItemNumber;
00097 };
00098 } // end namespace gdcm
00099 //-----------------------------------------------------------------------------
00100 #endif

Generated on Fri Aug 24 12:59:32 2007 for gdcm by  doxygen 1.4.6