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 #include "UT_LinkList.h"
12 
13 // These template classes are used to hide some of the casting
14 // and node management associated with UT_LinkList.
15 
16 
17 template <class T>
18 class UT_LinkNodeT : public UT_LinkNode
19 {
20 public:
21  explicit UT_LinkNodeT(const T &src_data) : UT_LinkNode(), data(src_data) {}
22 
24  { return reinterpret_cast<UT_LinkNodeT<T> *&>(UT_LinkNode::prev()); }
26  { return reinterpret_cast<UT_LinkNodeT<T> *&>(UT_LinkNode::next()); }
27  const UT_LinkNodeT<T> *prev() const
28  { return static_cast<const UT_LinkNodeT<T> *>(UT_LinkNode::prev()); }
29  const UT_LinkNodeT<T> *next() const
30  { return static_cast<const UT_LinkNodeT<T> *>(UT_LinkNode::next()); }
31 
33 };
34 
35 template <class T>
36 class UT_LinkListT : public UT_LinkList
37 {
38 public:
40  ~UT_LinkListT() override {}
41 
43  {
44  return (UT_LinkNodeT<T> *) UT_LinkList::next(node);
45  }
46 
48  {
49  return (UT_LinkNodeT<T> *) UT_LinkList::prev(node);
50  }
51 
53  {
55  }
56 
58  {
60  }
61 
62  void append( const T &data )
63  {
64  UT_LinkNodeT<T>* temp;
65 
66  temp = new UT_LinkNodeT<T>(data);
67 
68  UT_LinkList::append( temp );
69  }
70 
71  void append(UT_LinkNodeT<T> *node)
72  {
73  UT_LinkList::append(node);
74  }
75 };
76 
77 
78 #endif // __UT_LinkListT_h__
GLboolean * data
Definition: glcorearb.h:131
Definition: format.h:895