00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Side Effects 00008 * 477 Richmond Street West 00009 * Toronto, Ontario 00010 * Canada M5V 3E7 00011 * 416-504-9876 00012 */ 00013 00014 #ifndef __UT_LinkListT_h__ 00015 #define __UT_LinkListT_h__ 00016 00017 #ifdef WIN32 00018 #pragma warning(disable:4251) 00019 #pragma warning(disable:4275) 00020 #endif 00021 #include "UT_LinkList.h" 00022 00023 // These template classes are used to hide some of the casting 00024 // and node management associated with UT_LinkList. 00025 00026 00027 template <class T> 00028 class UT_LinkNodeT : public UT_LinkNode 00029 { 00030 public: 00031 T data; 00032 00033 }; 00034 00035 template <class T> 00036 class UT_LinkListT : public UT_LinkList 00037 { 00038 public: 00039 UT_LinkListT() {} 00040 ~UT_LinkListT() {} 00041 00042 UT_LinkNodeT<T> *next(UT_LinkNodeT<T> *node) const 00043 { 00044 return (UT_LinkNodeT<T> *) UT_LinkList::next(node); 00045 } 00046 00047 UT_LinkNodeT<T> *prev(UT_LinkNodeT<T> *node) const 00048 { 00049 return (UT_LinkNodeT<T> *) UT_LinkList::prev(node); 00050 } 00051 00052 UT_LinkNodeT<T> *head() const 00053 { 00054 return (UT_LinkNodeT<T> *) UT_LinkList::head(); 00055 } 00056 00057 UT_LinkNodeT<T> *tail() const 00058 { 00059 return (UT_LinkNodeT<T> *) UT_LinkList::tail(); 00060 } 00061 00062 void append( const T &data ) 00063 { 00064 UT_LinkNodeT<T>* temp; 00065 00066 temp = new UT_LinkNodeT<T>; 00067 temp->data = data; 00068 00069 UT_LinkList::append( temp ); 00070 } 00071 00072 void append(UT_LinkNodeT<T> *node) 00073 { 00074 UT_LinkList::append(node); 00075 } 00076 }; 00077 00078 00079 #endif // __UT_LinkListT_h__
1.5.9