dcmsr/include/dcmtk/dcmsr/dsrtree.h

00001 /*
00002  *
00003  *  Copyright (C) 2000-2010, OFFIS e.V.
00004  *  All rights reserved.  See COPYRIGHT file for details.
00005  *
00006  *  This software and supporting documentation were developed by
00007  *
00008  *    OFFIS e.V.
00009  *    R&D Division Health
00010  *    Escherweg 2
00011  *    D-26121 Oldenburg, Germany
00012  *
00013  *
00014  *  Module: dcmsr
00015  *
00016  *  Author: Joerg Riesmeier
00017  *
00018  *  Purpose:
00019  *    classes: DSRTreeNode, DSRTree
00020  *
00021  *  Last Update:      $Author: joergr $
00022  *  Update Date:      $Date: 2010-10-14 13:16:33 $
00023  *  CVS/RCS Revision: $Revision: 1.10 $
00024  *  Status:           $State: Exp $
00025  *
00026  *  CVS/RCS Log at end of file
00027  *
00028  */
00029 
00030 
00031 #ifndef DSRTREE_H
00032 #define DSRTREE_H
00033 
00034 #include "dcmtk/config/osconfig.h"   /* make sure OS specific configuration is included first */
00035 
00036 #include "dcmtk/dcmsr/dsrtypes.h"
00037 #include "dcmtk/dcmsr/dsrtncsr.h"
00038 
00039 
00040 /*---------------------*
00041  *  class declaration  *
00042  *---------------------*/
00043 
00046 class DSRTreeNode
00047   : protected DSRTypes
00048 {
00049     // allow direct access to member variables
00050     friend class DSRTreeNodeCursor;
00051     friend class DSRTree;
00052 
00053   public:
00054 
00057     DSRTreeNode()
00058       : Prev(NULL),
00059         Next(NULL),
00060         Down(NULL),
00061         Ident(IdentCounter++)   // MT-safe?
00062     {
00063     }
00064 
00067     virtual ~DSRTreeNode()
00068     {
00069     }
00070 
00071 
00072   protected:
00073 
00075     DSRTreeNode *Prev;
00077     DSRTreeNode *Next;
00079     DSRTreeNode *Down;
00080 
00082     const size_t Ident;
00083 
00084 
00085   private:
00086 
00088     static size_t IdentCounter;
00089 
00090 
00091  // --- declaration of copy constructor and assignment operator
00092 
00093     DSRTreeNode(const DSRTreeNode &);
00094     DSRTreeNode &operator=(const DSRTreeNode &);
00095 };
00096 
00097 
00100 class DSRTree
00101   : public DSRTreeNodeCursor,
00102     protected DSRTypes
00103 {
00104 
00105   public:
00106 
00109     DSRTree();
00110 
00113     virtual ~DSRTree();
00114 
00117     virtual void clear();
00118 
00122     OFBool isEmpty() const;
00123 
00127     size_t gotoRoot();
00128 
00135     size_t gotoNode(const size_t searchID,
00136                     const OFBool startFromRoot = OFTrue);
00137 
00146     size_t gotoNode(const OFString &reference,
00147                     const OFBool startFromRoot = OFTrue);
00148 
00158     virtual size_t addNode(DSRTreeNode *node,
00159                            const E_AddMode addMode = AM_afterCurrent);
00160 
00168     virtual size_t removeNode();
00169 
00170 
00171   protected:
00172 
00176     inline DSRTreeNode *getRoot() const
00177     {
00178         return RootNode;
00179     }
00180 
00181 
00182   private:
00183 
00185     DSRTreeNode *RootNode;
00186 
00187 
00188  // --- declaration of copy constructor and assignment operator
00189 
00190     DSRTree(const DSRTree &);
00191     DSRTree &operator=(const DSRTree &);
00192 };
00193 
00194 
00195 #endif
00196 
00197 
00198 /*
00199  *  CVS/RCS Log:
00200  *  $Log: dsrtree.h,v $
00201  *  Revision 1.10  2010-10-14 13:16:33  joergr
00202  *  Updated copyright header. Added reference to COPYRIGHT file.
00203  *
00204  *  Revision 1.9  2005-12-08 16:05:29  meichel
00205  *  Changed include path schema for all DCMTK header files
00206  *
00207  *  Revision 1.8  2003/12/17 17:40:17  meichel
00208  *  Changed order of inheritance to avoid internal compiler error on Borland Builder.
00209  *
00210  *  Revision 1.7  2003/08/07 12:56:22  joergr
00211  *  Updated documentation to get rid of doxygen warnings.
00212  *
00213  *  Revision 1.6  2002/04/11 13:02:34  joergr
00214  *  Corrected typo and/or enhanced documentation.
00215  *
00216  *  Revision 1.5  2001/06/01 15:51:06  meichel
00217  *  Updated copyright header
00218  *
00219  *  Revision 1.4  2000/11/01 16:22:11  joergr
00220  *  Now derive "protected" from base class DSRTypes instead of "public".
00221  *
00222  *  Revision 1.3  2000/10/18 17:09:29  joergr
00223  *  Made some functions inline.
00224  *
00225  *  Revision 1.2  2000/10/16 11:56:10  joergr
00226  *  Added doc++ comments.
00227  *
00228  *  Revision 1.1  2000/10/13 07:49:35  joergr
00229  *  Added new module 'dcmsr' providing access to DICOM structured reporting
00230  *  documents (supplement 23).  Doc++ documentation not yet completed.
00231  *
00232  *
00233  */


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1