Renamed jitcraft/ to src/, fixed some /Wp64 warnings.
2 * Copyright (C) 2004-2012 David Anderson
4 * This file is part of SourcePawn.
6 * SourcePawn is free software: you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 3 of the License, or (at your option)
11 * SourcePawn is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * SourcePawn. If not, see http://www.gnu.org/licenses/.
18 #ifndef _include_ke_inline_list_h_
19 #define _include_ke_inline_list_h_
25 template <typename T> class InlineList;
30 friend class InlineList<T>;
39 InlineListNode(InlineListNode *next, InlineListNode *prev)
46 InlineListNode *next_;
47 InlineListNode *prev_;
53 typedef InlineListNode<T> Node;
59 : head_(&head_, &head_)
66 friend class InlineList;
75 iterator & operator++() {
79 iterator operator ++(int) {
85 return static_cast<T *>(iter_);
88 return static_cast<T *>(iter_);
90 bool operator !=(const iterator &where) const {
91 return iter_ != where.iter_;
93 bool operator ==(const iterator &where) const {
94 return iter_ == where.iter_;
96 iterator prev() const {
97 return iterator(iter_->prev_);
99 iterator next() const {
100 return iterator(iter_->next_);
105 return iterator(head_.next_);
108 return iterator(&head_);
110 void append(Node *t) {
111 t->prev_ = head_.prev_;
113 head_.prev_->next_ = t;
116 iterator erase(iterator i) {
121 void remove(Node *t) {
122 t->prev_->next_ = t->next_;
123 t->next_->prev_ = t->prev_;
129 #endif // _include_ke_inline_list_h_