HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_LinkListT.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  */
7 
8 #ifndef __UT_LinkListT_h__
9 #define __UT_LinkListT_h__
10 
11 #ifdef WIN32
12  #pragma warning(disable:4251)
13  #pragma warning(disable:4275)
14 #endif
15 #include "UT_LinkList.h"
16 
17 // These template classes are used to hide some of the casting
18 // and node management associated with UT_LinkList.
19 
20 
21 template <class T>
22 class UT_LinkNodeT : public UT_LinkNode
23 {
24 public:
25  explicit UT_LinkNodeT(const T &src_data) : UT_LinkNode(), data(src_data) {}
26 
28  { return reinterpret_cast<UT_LinkNodeT<T> *&>(UT_LinkNode::prev()); }
30  { return reinterpret_cast<UT_LinkNodeT<T> *&>(UT_LinkNode::next()); }
31  const UT_LinkNodeT<T> *prev() const
32  { return static_cast<const UT_LinkNodeT<T> *>(UT_LinkNode::prev()); }
33  const UT_LinkNodeT<T> *next() const
34  { return static_cast<const UT_LinkNodeT<T> *>(UT_LinkNode::next()); }
35 
37 };
38 
39 template <class T>
40 class UT_LinkListT : public UT_LinkList
41 {
42 public:
45 
47  {
48  return (UT_LinkNodeT<T> *) UT_LinkList::next(node);
49  }
50 
52  {
53  return (UT_LinkNodeT<T> *) UT_LinkList::prev(node);
54  }
55 
57  {
59  }
60 
62  {
64  }
65 
66  void append( const T &data )
67  {
68  UT_LinkNodeT<T>* temp;
69 
70  temp = new UT_LinkNodeT<T>(data);
71 
72  UT_LinkList::append( temp );
73  }
74 
75  void append(UT_LinkNodeT<T> *node)
76  {
77  UT_LinkList::append(node);
78  }
79 };
80 
81 
82 #endif // __UT_LinkListT_h__
GLboolean * data
Definition: glcorearb.h:130