|
Blender
V2.59
|
00001 /* 00002 * $Id: CTR_List.h 35146 2011-02-25 10:45:31Z jesterking $ 00003 * ***** BEGIN GPL LICENSE BLOCK ***** 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software Foundation, 00017 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 * 00019 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00020 * All rights reserved. 00021 * 00022 * The Original Code is: all of this file. 00023 * 00024 * Contributor(s): none yet. 00025 * 00026 * ***** END GPL LICENSE BLOCK ***** 00027 */ 00028 00035 #ifndef CTR_LIST_H 00036 #define CTR_LIST_H 00037 00038 class CTR_Link { 00039 public: 00040 CTR_Link( 00041 ) ; 00042 00043 CTR_Link( 00044 CTR_Link *next, 00045 CTR_Link *prev 00046 ) ; 00047 00048 CTR_Link * 00049 getNext( 00050 ) const ; 00051 00052 CTR_Link * 00053 getPrev( 00054 ) const ; 00055 00056 bool 00057 isHead( 00058 ) const ; 00059 00060 bool 00061 isTail( 00062 ) const ; 00063 00064 void 00065 insertBefore( 00066 CTR_Link *link 00067 ) ; 00068 00069 void 00070 insertAfter( 00071 CTR_Link *link 00072 ) ; 00073 00074 void 00075 remove( 00076 ) ; 00077 00078 private: 00079 CTR_Link *m_next; 00080 CTR_Link *m_prev; 00081 }; 00082 00083 class CTR_List { 00084 public: 00085 00086 CTR_List( 00087 ) ; 00088 00089 CTR_Link * 00090 getHead( 00091 ) const ; 00092 00093 CTR_Link * 00094 getTail( 00095 ) const ; 00096 00097 void 00098 addHead( 00099 CTR_Link *link 00100 ) ; 00101 00102 void 00103 addTail( 00104 CTR_Link *link 00105 ) ; 00106 00107 private: 00108 CTR_Link m_head; 00109 CTR_Link m_tail; 00110 }; 00111 00112 #endif 00113