00001 /* 00002 * 00003 * Copyright (C) 2000-2005, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: dcmsr 00019 * 00020 * Author: Joerg Riesmeier 00021 * 00022 * Purpose: 00023 * classes: DSRTreeNode, DSRTree 00024 * 00025 * Last Update: $Author: meichel $ 00026 * Update Date: $Date: 2005/12/08 16:05:29 $ 00027 * CVS/RCS Revision: $Revision: 1.9 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 00035 #ifndef DSRTREE_H 00036 #define DSRTREE_H 00037 00038 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00039 00040 #include "dcmtk/dcmsr/dsrtypes.h" 00041 #include "dcmtk/dcmsr/dsrtncsr.h" 00042 00043 00044 /*---------------------* 00045 * class declaration * 00046 *---------------------*/ 00047 00050 class DSRTreeNode 00051 : protected DSRTypes 00052 { 00053 // allow direct access to member variables 00054 friend class DSRTreeNodeCursor; 00055 friend class DSRTree; 00056 00057 public: 00058 00061 DSRTreeNode() 00062 : Prev(NULL), 00063 Next(NULL), 00064 Down(NULL), 00065 Ident(IdentCounter++) // MT-safe? 00066 { 00067 } 00068 00071 virtual ~DSRTreeNode() 00072 { 00073 } 00074 00075 00076 protected: 00077 00079 DSRTreeNode *Prev; 00081 DSRTreeNode *Next; 00083 DSRTreeNode *Down; 00084 00086 const size_t Ident; 00087 00088 00089 private: 00090 00092 static size_t IdentCounter; 00093 00094 00095 // --- declaration of copy constructor and assignment operator 00096 00097 DSRTreeNode(const DSRTreeNode &); 00098 DSRTreeNode &operator=(const DSRTreeNode &); 00099 }; 00100 00101 00104 class DSRTree 00105 : public DSRTreeNodeCursor, 00106 protected DSRTypes 00107 { 00108 00109 public: 00110 00113 DSRTree(); 00114 00117 virtual ~DSRTree(); 00118 00121 virtual void clear(); 00122 00126 OFBool isEmpty() const; 00127 00131 size_t gotoRoot(); 00132 00139 size_t gotoNode(const size_t searchID, 00140 const OFBool startFromRoot = OFTrue); 00141 00150 size_t gotoNode(const OFString &reference, 00151 const OFBool startFromRoot = OFTrue); 00152 00162 virtual size_t addNode(DSRTreeNode *node, 00163 const E_AddMode addMode = AM_afterCurrent); 00164 00172 virtual size_t removeNode(); 00173 00174 00175 protected: 00176 00180 inline DSRTreeNode *getRoot() const 00181 { 00182 return RootNode; 00183 } 00184 00185 00186 private: 00187 00189 DSRTreeNode *RootNode; 00190 00191 00192 // --- declaration of copy constructor and assignment operator 00193 00194 DSRTree(const DSRTree &); 00195 DSRTree &operator=(const DSRTree &); 00196 }; 00197 00198 00199 #endif 00200 00201 00202 /* 00203 * CVS/RCS Log: 00204 * $Log: dsrtree.h,v $ 00205 * Revision 1.9 2005/12/08 16:05:29 meichel 00206 * Changed include path schema for all DCMTK header files 00207 * 00208 * Revision 1.8 2003/12/17 17:40:17 meichel 00209 * Changed order of inheritance to avoid internal compiler error on Borland Builder. 00210 * 00211 * Revision 1.7 2003/08/07 12:56:22 joergr 00212 * Updated documentation to get rid of doxygen warnings. 00213 * 00214 * Revision 1.6 2002/04/11 13:02:34 joergr 00215 * Corrected typo and/or enhanced documentation. 00216 * 00217 * Revision 1.5 2001/06/01 15:51:06 meichel 00218 * Updated copyright header 00219 * 00220 * Revision 1.4 2000/11/01 16:22:11 joergr 00221 * Now derive "protected" from base class DSRTypes instead of "public". 00222 * 00223 * Revision 1.3 2000/10/18 17:09:29 joergr 00224 * Made some functions inline. 00225 * 00226 * Revision 1.2 2000/10/16 11:56:10 joergr 00227 * Added doc++ comments. 00228 * 00229 * Revision 1.1 2000/10/13 07:49:35 joergr 00230 * Added new module 'dcmsr' providing access to DICOM structured reporting 00231 * documents (supplement 23). Doc++ documentation not yet completed. 00232 * 00233 * 00234 */