dcmdata/include/dcmtk/dcmdata/dcstack.h

00001 /*
00002  *
00003  *  Copyright (C) 1994-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:  dcmdata
00015  *
00016  *  Author:  Gerd Ehlers
00017  *
00018  *  Purpose: stack class
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-10-14 13:15:42 $
00022  *  CVS/RCS Revision: $Revision: 1.14 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 #ifndef DCSTACK_H
00030 #define DCSTACK_H
00031 
00032 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
00033 #include "dcmtk/ofstd/oftypes.h"
00034 
00035 class DcmObject;    // forward declaration
00036 
00037 
00040 class DcmStackNode
00041 {
00042 public:
00046     DcmStackNode(DcmObject *obj);
00047 
00049     ~DcmStackNode();
00050 
00054     DcmObject *value() const;
00055 
00056 private:
00058     DcmStackNode(const DcmStackNode &);
00059 
00061     DcmStackNode &operator=(const DcmStackNode &);
00062 
00064     DcmStackNode *link;
00065 
00067     DcmObject *objNodeValue;
00068 
00070     friend class DcmStack;
00071 };
00072 
00073 
00077 class DcmStack
00078 {
00079 public:
00081     DcmStack();
00082 
00087     DcmStack(const DcmStack& arg);
00088 
00090     ~DcmStack();
00091 
00097     DcmStack& operator=(const DcmStack &arg);
00098 
00103     OFBool operator==(const DcmStack& arg) const;
00104 
00112     OFBool operator<(const DcmStack& arg) const;
00113     
00118     DcmObject* push( DcmObject *obj );
00119 
00123     DcmObject* pop();
00124 
00128     DcmObject* top() const;
00129 
00133     DcmObject* elem(const unsigned long number) const;
00134 
00138     OFBool empty() const;
00139 
00143     unsigned long card() const;
00144 
00147     void clear();
00148 
00149 private:
00151     DcmStackNode *topNode_;
00152 
00154     unsigned long cardinality_;
00155 };
00156 
00157 
00158 #endif  // DCSTACK_H
00159 
00160 
00161 /*
00162  * CVS/RCS Log:
00163  * $Log: dcstack.h,v $
00164  * Revision 1.14  2010-10-14 13:15:42  joergr
00165  * Updated copyright header. Added reference to COPYRIGHT file.
00166  *
00167  * Revision 1.13  2010-03-01 09:08:44  uli
00168  * Removed some unnecessary include directives in the headers.
00169  *
00170  * Revision 1.12  2005-12-08 16:28:42  meichel
00171  * Changed include path schema for all DCMTK header files
00172  *
00173  * Revision 1.11  2004/04/14 11:50:21  joergr
00174  * Added const qualifier to parameter to keep Sun CC 2.0.1 quiet.
00175  *
00176  * Revision 1.10  2003/06/02 16:52:20  meichel
00177  * Cleaned up implementation of DcmStack, added doc++ comments
00178  *
00179  * Revision 1.9  2001/06/01 15:48:44  meichel
00180  * Updated copyright header
00181  *
00182  * Revision 1.8  2000/03/08 16:26:18  meichel
00183  * Updated copyright header.
00184  *
00185  * Revision 1.7  1999/03/31 09:24:47  meichel
00186  * Updated copyright header in module dcmdata
00187  *
00188  *
00189  */


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