dcmnet/include/dcmtk/dcmnet/lst.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:  dcmnet
00015  *
00016  *  Author:  Marco Eichelberg
00017  *
00018  *  Purpose: List class with procedural API compatible to MIR CTN
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-10-14 13:17:22 $
00022  *  CVS/RCS Revision: $Revision: 1.6 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 #ifndef LST_H
00030 #define LST_H
00031 
00032 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
00033 #include "dcmtk/ofstd/ofcond.h"
00034 #include "dcmtk/ofstd/oflist.h"
00035 
00036 
00039 class LST_HEAD
00040 {
00041 public:
00043   LST_HEAD();
00044 
00046   ~LST_HEAD();
00047   
00051   void push_back(void *node);
00052 
00056   void *dequeue();
00057 
00061   size_t size() const;
00062 
00066   void *front();
00067 
00072   void *position(void *node);
00073 
00079   void *next();
00080 
00085   void *current() const;
00086 
00087 
00088 private:
00090   OFList<void *> theList;
00091   
00093   OFListIterator(void *) theIterator;
00094 };
00095 
00096 
00097 // --------------------------------------------------------------------
00098 // THE FOLLOWING PROCEDURAL API IS COMPATIBLE TO THE MIR CTN LST MODULE
00099 // --------------------------------------------------------------------
00100 
00102 typedef void LST_NODE;
00103 
00106 LST_HEAD *LST_Create();
00107 
00111 OFCondition LST_Destroy(LST_HEAD **lst);
00112 
00115 OFCondition LST_Enqueue(LST_HEAD **lst, void *node);
00116 
00120 void *LST_Dequeue(LST_HEAD **lst);
00121 
00124 void *LST_Pop(LST_HEAD **lst);
00125 
00128 unsigned long LST_Count(LST_HEAD **lst);
00129 
00133 void *LST_Head(LST_HEAD **lst);
00134 
00137 void *LST_Current(LST_HEAD **lst);
00138 
00142 void *LST_Next(LST_HEAD **lst);
00143 
00149 void *LST_Position(LST_HEAD **lst, void *node);
00150 
00151 #endif
00152 
00153 /*
00154  * CVS Log
00155  * $Log: lst.h,v $
00156  * Revision 1.6  2010-10-14 13:17:22  joergr
00157  * Updated copyright header. Added reference to COPYRIGHT file.
00158  *
00159  * Revision 1.5  2005/12/08 16:02:25  meichel
00160  * Changed include path schema for all DCMTK header files
00161  *
00162  * Revision 1.4  2003/06/02 16:44:11  meichel
00163  * Renamed local variables to avoid name clashes with STL
00164  *
00165  * Revision 1.3  2001/10/12 10:17:32  meichel
00166  * Re-implemented the LST module (double linked list functions)
00167  *   used in the dcmnet module from scratch based on OFList.
00168  *
00169  * Revision 1.2  1999/03/29 11:20:00  meichel
00170  * Cleaned up dcmnet code for char* to const char* assignments.
00171  *
00172  * Revision 1.1.1.1  1996/03/26 18:38:45  hewett
00173  * Initial Release.
00174  *
00175  */


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