dcstack.h

00001 /*
00002  *
00003  *  Copyright (C) 1994-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:  dcmdata
00019  *
00020  *  Author:  Gerd Ehlers
00021  *
00022  *  Purpose: stack class
00023  *
00024  *  Last Update:      $Author: meichel $
00025  *  Update Date:      $Date: 2005/12/08 16:28:42 $
00026  *  CVS/RCS Revision: $Revision: 1.12 $
00027  *  Status:           $State: Exp $
00028  *
00029  *  CVS/RCS Log at end of file
00030  *
00031  */
00032 
00033 #ifndef DCSTACK_H
00034 #define DCSTACK_H
00035 
00036 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
00037 #include "dcmtk/dcmdata/dctypes.h"
00038 
00039 class DcmObject;    // forward declaration
00040 
00041 
00044 class DcmStackNode
00045 {
00046 public:
00050     DcmStackNode(DcmObject *obj);
00051 
00053     ~DcmStackNode();
00054 
00058     DcmObject *value() const;
00059 
00060 private:
00062     DcmStackNode(const DcmStackNode &);
00063 
00065     DcmStackNode &operator=(const DcmStackNode &);
00066 
00068     DcmStackNode *link;
00069 
00071     DcmObject *objNodeValue;
00072 
00074     friend class DcmStack;
00075 };
00076 
00077 
00081 class DcmStack
00082 {
00083 public:
00085     DcmStack();
00086 
00091     DcmStack(const DcmStack& arg);
00092 
00094     ~DcmStack();
00095 
00101     DcmStack& operator=(const DcmStack &arg);
00102 
00107     OFBool operator==(const DcmStack& arg) const;
00108 
00116     OFBool operator<(const DcmStack& arg) const;
00117     
00122     DcmObject* push( DcmObject *obj );
00123 
00127     DcmObject* pop();
00128 
00132     DcmObject* top() const;
00133 
00137     DcmObject* elem(const unsigned long number) const;
00138 
00142     OFBool empty() const;
00143 
00147     unsigned long card() const;
00148 
00151     void clear();
00152 
00153 private:
00155     DcmStackNode *topNode_;
00156 
00158     unsigned long cardinality_;
00159 };
00160 
00161 
00162 #endif  // DCSTACK_H
00163 
00164 
00165 /*
00166  * CVS/RCS Log:
00167  * $Log: dcstack.h,v $
00168  * Revision 1.12  2005/12/08 16:28:42  meichel
00169  * Changed include path schema for all DCMTK header files
00170  *
00171  * Revision 1.11  2004/04/14 11:50:21  joergr
00172  * Added const qualifier to parameter to keep Sun CC 2.0.1 quiet.
00173  *
00174  * Revision 1.10  2003/06/02 16:52:20  meichel
00175  * Cleaned up implementation of DcmStack, added doc++ comments
00176  *
00177  * Revision 1.9  2001/06/01 15:48:44  meichel
00178  * Updated copyright header
00179  *
00180  * Revision 1.8  2000/03/08 16:26:18  meichel
00181  * Updated copyright header.
00182  *
00183  * Revision 1.7  1999/03/31 09:24:47  meichel
00184  * Updated copyright header in module dcmdata
00185  *
00186  *
00187  */


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5