From 6505686c5a2ce99033cb577598206d5b6d4abb54 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 30 Jul 2007 10:18:25 +0000 Subject: Renamed some typedefs to avoid clashes with sky engine svn-id: r28321 --- common/list.h | 58 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'common') diff --git a/common/list.h b/common/list.h index 1fda266da9..4ece453711 100644 --- a/common/list.h +++ b/common/list.h @@ -33,7 +33,7 @@ namespace Common { * Simple double linked list, modeled after the list template of the standard * C++ library. */ -template +template class List { protected: #if defined (_WIN32_WCE) || defined (_MSC_VER) @@ -45,16 +45,16 @@ public: NodeBase *_next; }; - template + template struct Node : public NodeBase { - T2 _data; + t_T2 _data; - Node(const T2 &x) : _data(x) {} + Node(const t_T2 &x) : _data(x) {} }; - template + template class Iterator { - friend class List; + friend class List; NodeBase *_node; #if !defined (__WINSCW__) @@ -67,46 +67,46 @@ public: Iterator() : _node(0) {} // Prefix inc - Iterator &operator++() { + Iterator &operator++() { if (_node) _node = _node->_next; return *this; } // Postfix inc - Iterator operator++(int) { + Iterator operator++(int) { Iterator tmp(_node); ++(*this); return tmp; } // Prefix dec - Iterator &operator--() { + Iterator &operator--() { if (_node) _node = _node->_prev; return *this; } // Postfix dec - Iterator operator--(int) { + Iterator operator--(int) { Iterator tmp(_node); --(*this); return tmp; } - T2& operator*() const { + t_T2& operator*() const { assert(_node); #if (__GNUC__ == 2) && (__GNUC_MINOR__ >= 95) - return static_cast::Node *>(_node)->_data; + return static_cast::Node *>(_node)->_data; #else - return static_cast*>(_node)->_data; + return static_cast*>(_node)->_data; #endif } - T2* operator->() const { + t_T2* operator->() const { return &(operator*()); } - bool operator==(const Iterator& x) const { + bool operator==(const Iterator& x) const { return _node == x._node; } - bool operator!=(const Iterator& x) const { + bool operator!=(const Iterator& x) const { return _node != x._node; } }; @@ -114,10 +114,10 @@ public: NodeBase *_anchor; public: - typedef Iterator iterator; - typedef Iterator const_iterator; + typedef Iterator iterator; + typedef Iterator const_iterator; - typedef T value_type; + typedef t_T value_type; public: List() { @@ -125,7 +125,7 @@ public: _anchor->_prev = _anchor; _anchor->_next = _anchor; } - List(const List& list) { + List(const List& list) { _anchor = new NodeBase; _anchor->_prev = _anchor; _anchor->_next = _anchor; @@ -138,16 +138,16 @@ public: delete _anchor; } - void push_front(const T& element) { + void push_front(const t_T& element) { insert(begin(), element); } - void push_back(const T& element) { + void push_back(const t_T& element) { insert(end(), element); } - void insert(iterator pos, const T& element) { - NodeBase *newNode = new Node(element); + void insert(iterator pos, const t_T& element) { + NodeBase *newNode = new Node(element); newNode->_next = pos._node; newNode->_prev = pos._node->_prev; @@ -166,7 +166,7 @@ public: NodeBase *next = pos._node->_next; NodeBase *prev = pos._node->_prev; - Node *node = static_cast *>(pos._node); + Node *node = static_cast *>(pos._node); prev->_next = next; next->_prev = prev; delete node; @@ -178,7 +178,7 @@ public: NodeBase *next = pos._node->_next; NodeBase *prev = pos._node->_prev; - Node *node = static_cast *>(pos._node); + Node *node = static_cast *>(pos._node); prev->_next = next; next->_prev = prev; delete node; @@ -192,7 +192,7 @@ public: return last; } - void remove(const T &val) { + void remove(const t_T &val) { iterator i = begin(); while (i != end()) if (val == i.operator*()) @@ -202,13 +202,13 @@ public: } - List& operator =(const List& list) { + List& operator =(const List& list) { if (this != &list) { iterator i; const_iterator j; for (i = begin(), j = list.begin(); (i != end()) && (j != list.end()) ; ++i, ++j) { - static_cast *>(i._node)->_data = static_cast *>(j._node)->_data; + static_cast *>(i._node)->_data = static_cast *>(j._node)->_data; } if (i == end()) -- cgit v1.2.3