summaryrefslogtreecommitdiff
path: root/plugins/Ping/src/collection.h
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-03-03 14:04:30 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-03-03 14:04:30 +0000
commit22f052f313379a8e864e61fdd3593126e088ded4 (patch)
tree4b089d5d0e5a75a3af00d5cfb256065c82c23d9c /plugins/Ping/src/collection.h
parenta7c5d18647c0dd188eaa723df3f73e4250a61920 (diff)
removed not used headers
added version info fixed crash #169 (patch from $ergi0) git-svn-id: http://svn.miranda-ng.org/main/trunk@3873 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Ping/src/collection.h')
-rw-r--r--plugins/Ping/src/collection.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/plugins/Ping/src/collection.h b/plugins/Ping/src/collection.h
index f8709e3ef8..78fde37dfd 100644
--- a/plugins/Ping/src/collection.h
+++ b/plugins/Ping/src/collection.h
@@ -1,5 +1,3 @@
-#include <malloc.h>
-
template<class T> class Collection {
protected:
unsigned long count;
@@ -28,7 +26,7 @@ public:
ListNode(const T &v): Node<T>(v), next(0), prev(0) {}
virtual ~ListNode() {
if(next) next->prev = prev;
- if(prev) prev->next = next;
+ if(prev) prev->next = next;
}
};
@@ -53,19 +51,21 @@ public:
LinkedList(): Collection<T>(), head(0), tail(0) {};
LinkedList(const LinkedList<T> &other): Collection<T>(), head(0), tail(0) {
- for(Iterator i = other.start(); i.has_val(); i.next())
+ for(Iterator i = other.begin(); i.has_val(); i.next())
add(i.val());
}
- virtual ~LinkedList() {clear();}
+ virtual ~LinkedList() { clear(); }
- LinkedList<T> &operator=(const LinkedList<T> &other) {
+ LinkedList<T> &operator=(const LinkedList<T> &other)
+ {
clear();
- for(Iterator i = other.start(); i.has_val(); i.next())
+ for(Iterator i = other.begin(); i.has_val(); i.next())
add(i.val());
return *this;
}
- virtual void clear() {
+ virtual void clear()
+ {
ListNode<T> *n;
while(head) {
n = head;
@@ -76,7 +76,7 @@ public:
Collection<T>::count = 0;
}
- virtual Iterator start() const {return Iterator(head);}
+ virtual Iterator begin() const {return Iterator(head);}
virtual void add_front(T &val) {
ListNode<T> *n = new ListNode<T>(val);
@@ -190,7 +190,7 @@ public:
}
}
- virtual Iterator start() const {return Iterator(ar, Collection<T>::count, 0);}
+ virtual Iterator begin() const {return Iterator(ar, Collection<T>::count, 0);}
virtual void add(const T &val) {
if(Collection<T>::count == limit) {
@@ -202,7 +202,7 @@ public:
}
virtual void add_all(DynamicArray<T> &other) {
- for(Iterator i = other.start(); i.has_val(); i.next()) {
+ for(Iterator i = other.begin(); i != pl.end(); ++i) {
add(i.val());
}
}
@@ -431,14 +431,14 @@ public:
BinaryTree(): Collection<T>(), root(0) {};
BinaryTree(BinaryTree<T> &other): Collection<T>(), root(0) {
- for(Iterator i = other.start(); i.has_val(); i.next())
+ for(Iterator i = other.begin(); i != pl.end(); ++i)
add(i.val());
}
virtual ~BinaryTree() {clear();}
BinaryTree &operator=(BinaryTree<T> &other) {
clear();
- for(Iterator i = other.start(); i.has_val(); i.next())
+ for(Iterator i = other.begin(); i != pl.end(); ++i)
add(i.val());
return *this;
}
@@ -497,7 +497,7 @@ public:
return current != 0;
}
- Iterator start() const {return Iterator(root);}
+ Iterator begin() const {return Iterator(root);}
};
#define RED 1