From 42b47c7c308fb6c79a611b21164badd8d52e6b20 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 28 Jun 2003 15:53:21 +0000 Subject: [PATCH] Some small interface fixes. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3715 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../private/kernel/util/SinglyLinkedList.h | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/headers/private/kernel/util/SinglyLinkedList.h b/headers/private/kernel/util/SinglyLinkedList.h index 0fc7086c40..ed702d2c54 100644 --- a/headers/private/kernel/util/SinglyLinkedList.h +++ b/headers/private/kernel/util/SinglyLinkedList.h @@ -90,11 +90,11 @@ public: SinglyLinkedListIterator(Parent *parent, NodeType *node, NodeType *previous); - bool operator==(const IteratorType &ref); - bool operator!=(const IteratorType &ref); - inline Reference operator*(); - inline Pointer operator->(); - IteratorType operator++(); + bool operator==(const IteratorType &ref) const; + bool operator!=(const IteratorType &ref) const; + inline Reference operator*() const; + inline Pointer operator->() const; + IteratorType &operator++(); IteratorType operator++(int); private: @@ -116,13 +116,14 @@ _ITERATOR::SinglyLinkedListIterator(Parent *parent, NodeType *node, NodeType *pr _ITERATOR_TEMPLATE_LIST bool -_ITERATOR::operator==(const _ITERATOR &ref) { +_ITERATOR::operator==(const _ITERATOR &ref) const +{ return fParent == ref.fParent && fNode == ref.fNode && fPrevious == ref.fPrevious; } _ITERATOR_TEMPLATE_LIST bool -_ITERATOR::operator!=(const _ITERATOR &ref) +_ITERATOR::operator!=(const _ITERATOR &ref) const { return !operator==(ref); } @@ -130,18 +131,20 @@ _ITERATOR::operator!=(const _ITERATOR &ref) _ITERATOR_TEMPLATE_LIST inline Reference -_ITERATOR::operator*() { +_ITERATOR::operator*() const +{ return fParent->GetValue(fNode); } _ITERATOR_TEMPLATE_LIST Pointer -_ITERATOR::operator->() { +_ITERATOR::operator->() const +{ return &(operator*()); } _ITERATOR_TEMPLATE_LIST -_ITERATOR +_ITERATOR& _ITERATOR::operator++() { if (fNode) { fPrevious = fNode;