00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
#ifndef DCLIST_H
00035
#define DCLIST_H
00036
00037
#include "osconfig.h"
00038
#include "dcerror.h"
00039
#include "dctypes.h"
00040
00041
#define INCLUDE_CSTDDEF
00042
#define INCLUDE_CSTDLIB
00043
#include "ofstdinc.h"
00044
00045
00046
const unsigned long DCM_EndOfListIndex = OFstatic_cast(
unsigned long, -1L);
00047
00048
00049
class DcmObject;
00050
00051
00052
class DcmListNode {
00053
friend class DcmList;
00054 DcmListNode *nextNode;
00055 DcmListNode *prevNode;
00056
DcmObject *objNodeValue;
00057
00058
00059
00060 DcmListNode(
const DcmListNode &);
00061 DcmListNode &operator=(
const DcmListNode &);
00062
00063
public:
00064 DcmListNode(
DcmObject *obj );
00065 ~DcmListNode();
00066
inline DcmObject *value() {
return objNodeValue; }
00067 };
00068
00069
00070
typedef enum
00071 {
00072 ELP_atpos,
00073 ELP_first,
00074 ELP_last,
00075 ELP_prev,
00076 ELP_next
00077 } E_ListPos;
00078
00079
00080
00081
00082
00083
00084
class DcmList {
00085 DcmListNode *firstNode;
00086 DcmListNode *lastNode;
00087 DcmListNode *currentNode;
00088
unsigned long cardinality;
00089
00090
00091
00092 DcmList &operator=(
const DcmList &);
00093 DcmList(
const DcmList &newList);
00094
00095
public:
00096 DcmList();
00097 ~DcmList();
00098
00099
DcmObject *append(
DcmObject *obj );
00100
DcmObject *prepend(
DcmObject *obj );
00101
DcmObject *insert(
DcmObject *obj,
00102 E_ListPos pos = ELP_next );
00103
DcmObject *remove();
00104
DcmObject *get( E_ListPos pos = ELP_atpos );
00105
DcmObject *seek( E_ListPos pos = ELP_next );
00106
DcmObject *seek_to(
unsigned long absolute_position);
00107
inline unsigned long card()
const {
return cardinality; }
00108
inline OFBool empty(
void)
const {
return firstNode == NULL; }
00109
inline OFBool valid(
void)
const {
return currentNode != NULL; }
00110 };
00111
00112
#endif // DCLIST_H
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145