From 2fce43d484e4148ae858f410d51dcd9951d34374 Mon Sep 17 00:00:00 2001 From: Tuowen Zhao Date: Sun, 18 Sep 2016 15:45:13 +0000 Subject: remove include & rename --- omegalib/omega_lib/include/basic/SimpleList.c | 105 -------------------------- 1 file changed, 105 deletions(-) delete mode 100644 omegalib/omega_lib/include/basic/SimpleList.c (limited to 'omegalib/omega_lib/include/basic/SimpleList.c') diff --git a/omegalib/omega_lib/include/basic/SimpleList.c b/omegalib/omega_lib/include/basic/SimpleList.c deleted file mode 100644 index da7de9b..0000000 --- a/omegalib/omega_lib/include/basic/SimpleList.c +++ /dev/null @@ -1,105 +0,0 @@ -namespace omega { - -template Simple_List_Iterator::Simple_List_Iterator(Simple_List &l) -: List_Element_Iterator(l.contents) {} - -template Simple_List_Iterator::Simple_List_Iterator(const Simple_List &l) -: List_Element_Iterator(l.contents) {} - -template Simple_List_Iterator::Simple_List_Iterator() -: List_Element_Iterator(0) {} - -template Iterator *Simple_List::new_iterator() -{ - return new Simple_List_Iterator(*this); -} - -template const T &Simple_List::operator[](int i) const -{ - Simple_List_Iterator p(*this); - - while(--i > 0 && p) - p++; - - if (p) - return *p; - else - return *((T *)0); -} - -template T &Simple_List::operator[](int i) -{ - Simple_List_Iterator p(*this); - - while(--i > 0 && p) - p++; - - if (p) - return *p; - else - return *((T *)0); -} - - -template int Simple_List::size() const - { - int i = 0; - List_Element * p = contents; - while (p) - { - p = p->tail; - i++; - } - return i; - } - -template T &Simple_List::front() const - { - return contents->head; - } - -template T Simple_List::remove_front() - { - List_Element *frunt = contents; - contents = contents->tail; - T fruntT = frunt->head; - frunt->tail = 0; - delete frunt; - return fruntT; - } - -template void Simple_List::prepend(const T &item) - { - contents = new List_Element(item, contents); - } - - -template void Simple_List::append(const T &item) - { - *(end()) = new List_Element(item, 0); - } - - -template void Simple_List::del_front() - { - List_Element *e = contents; - contents = contents->tail; - e->tail = 0; - delete e; - } - - -template void Simple_List::clear() - { - delete contents; - contents = 0; - } - -template void Simple_List::join(Simple_List &consumed) - { - List_Element *e = consumed.contents; - consumed.contents = 0; - *(end()) = e; - } - -} // namespace -- cgit v1.2.3-70-g09d2