kjs Library API Documentation

reference_list.h

00001 // -*- c-basic-offset: 2 -*-
00002 /*
00003  *  This file is part of the KDE libraries
00004  *  Copyright (C) 2003 Apple Computer, Inc
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Library General Public
00008  *  License as published by the Free Software Foundation; either
00009  *  version 2 of the License, or (at your option) any later version.
00010  *
00011  *  This library is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *  Library General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU Library General Public License
00017  *  along with this library; see the file COPYING.LIB.  If not, write to
00018  *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019  *  Boston, MA 02111-1307, USA.
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 
00034   class ReferenceListIterator {
00035     friend class ReferenceList;
00036   
00037   public:
00038     bool operator!=(const ReferenceListIterator &it) const;
00039     const Reference *operator->() const;
00040     const Reference &operator++(int i);
00041     
00042   private:
00043     ReferenceListIterator(ReferenceListNode *n);
00044     ReferenceListIterator();
00045     ReferenceListNode *node;
00046   };
00047   
00048   class ReferenceList {
00049   public:
00050     ReferenceList();
00051     ReferenceList(const ReferenceList &list);
00052     ReferenceList &operator=(const ReferenceList &list);
00053     ~ReferenceList();
00054 
00055     void append(const Reference& val);
00056     int length();
00057 
00058     ReferenceListIterator begin() const;
00059     ReferenceListIterator end() const;
00060     
00061   private:
00062     void swap(ReferenceList &list);
00063     ReferenceListHeadNode *head;
00064     ReferenceListNode *tail;
00065   }; 
00066   
00067 }
00068 
00069 #endif
KDE Logo
This file is part of the documentation for kjs Library Version 3.2.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Mar 4 22:44:08 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003