00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
#ifndef _KJS_REFERENCE_LIST_H_
00024
#define _KJS_REFERENCE_LIST_H_
00025
00026
#include "types.h"
00027
#include "reference.h"
00028
00029
namespace KJS {
00030
00031
class ReferenceListNode;
00032
class ReferenceListHeadNode;
00033
00037 class KJS_EXPORT ReferenceListIterator {
00038
friend class ReferenceList;
00039
00040
public:
00041
bool operator!=(
const ReferenceListIterator &it)
const;
00042
const Reference *operator->()
const;
00043
const Reference &operator++(
int i);
00044
00045
private:
00046 ReferenceListIterator(ReferenceListNode *n);
00047 ReferenceListIterator();
00048 ReferenceListNode *node;
00049 };
00050
00054 class KJS_EXPORT ReferenceList {
00055
public:
00056 ReferenceList();
00057 ReferenceList(
const ReferenceList &list);
00058 ReferenceList &operator=(
const ReferenceList &list);
00059 ~ReferenceList();
00060
00061
void append(
const Reference& val);
00062
int length();
00063
00064 ReferenceListIterator begin()
const;
00065 ReferenceListIterator end()
const;
00066
00067
private:
00068
void swap(ReferenceList &list);
00069 ReferenceListHeadNode *head;
00070 ReferenceListNode *tail;
00071 };
00072
00073 }
00074
00075
#endif