History log of /haiku-fatelf/headers/private/kernel/util/DoublyLinkedList.h
Revision Date Author Comments
# 7008d2f6 31-Oct-2011 Michael Lotz <mmlr@mlotz.ch>

bonefish+mmlr:
Add a DoublyLinkedList::Contains() method to check if a list contains a certain
element.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43043 a95241bf-73f2-0310-859d-f6bbb57e9c96


# be7782af 03-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed DoublyLinkedListLinkImpl constructor. DoublyLinkedListLink doesn't
have one anymore anyway.
* Removed unnecessary setting the list links to NULL after removing a node.
* Replaced "element == NULL" check in Insert() by an assert. This just hid
potential errors.
* Added Insert{Before,After}() methods and declared the Insert() version
with the InsertBefore() semantics obsolete.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34873 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4fb60da3 06-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed the DoublyLinkedListLink constructor and destructor. They are not
necessary and prevent the structures from being used in a union.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34525 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8263f82d 06-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Missed that when cleaning up the style.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29980 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fd0803f3 06-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Added RemoveTail() method.
* Renamed DoublyLinkedList::Size() to Count(), since it actually counts the
items (ie. O(n)).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29979 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5c99d639 22-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged branch haiku/branches/developer/bonefish/vm into trunk. This
introduces the following relevant changes:
* VMCache:
- Renamed vm_cache to VMCache, merged it with vm_store and made it a
C++ class with virtual methods (replacing the store operations).
Turned the different store implementations into subclasses.
- Introduced MergeStore() callback, changed semantics of Commit().
- Changed locking and referencing semantics. A reference can only be
acquired/released with the cache locked. An unreferenced cache is
deleted and a mergeable cache merged when it is unlocked. This
removes the "busy" state of a cache and simplifies the page fault
code.
* Added VMAnonymousCache, which will implement swap support (work by
Zhao Shuai). It is not integrated and used yet, though.
* Enabled the mutex/recursive lock holder asserts.
* Fixed DoublyLinkedList::Swap().
* Generalized the low memory handler to a low resource handler. And made
semaphores and reserved memory handled resources. Made
vm_try_resource_memory() optionally wait (with timeout), and used that
feature to reserve memory for areas.
...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26572 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c76695a2 23-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* The C "struct list" and the C++ DoublyLinkedList implementations had mixed
next/prev link order - that messed up the DoublyLinkedListCLink adapter.
* Since it's more likely that someone messes with the C version, the C++ version
now uses the same order than that one.
* This fixes a bug when TCP's BufferQueue tried to iterate over a list, messing
up its integrity.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22676 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0cf4ed1d 05-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

MoveFrom() was broken. Fixes bug #1534.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22450 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 45f9d60c 03-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Some KDEBUG enabled sanity checks.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22430 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5102d494 01-Aug-2007 Axel Dörfler <axeld@pinc-software.de>

* Added the default constructor to the Iterator class.
* Added a Current() method to the same class that returns the current element again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21779 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9781d591 11-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Include <util/kernel_cpp.h> in DoublyLinkedList.h only when compiling
for the kernel. Added missing includes in userland code that uses the
header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20366 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0dd2e9c3 29-Jul-2006 Axel Dörfler <axeld@pinc-software.de>

* Changed Insert() to not only compile but also work differently in that it
inserts the item before, and not after the given element (that's probably
what you expected anyway).
* Added ReverseIterators.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18307 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c47f6617 18-Jul-2006 Axel Dörfler <axeld@pinc-software.de>

* Added a template class to bridge over to the struct list C stuff.
* Added an Insert() variant that can insert an element behind another one.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18199 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e7d4bde0 27-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

Accidently broke ConstIterator::Rewind().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16902 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c918a987 27-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Removed my old doubly linked list implementation, and stay with Ingo's.
* Adapt other sources where needed (the boot loader's RootFileSystem still
used the old implementation).
* Implemented RootFileSystem::Rewind().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16889 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f42f300b 01-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Work around a gcc bug: A private typedef in a base class can class with an equal identifier in a derived class.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11192 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 50d68edc 01-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

It's fun to rename functions in templatized code. You only realize, that you missed some, when that specific part is instantiated.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11190 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2cfdb0ed 01-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added DoublyLinkedListMemberGetLink class which directly accesses the
link member in the element class. Usually more comfortable for structs.
* Added Add() method as synonym for Insert().
* Made fGetLink member static to save memory in objects using it.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11188 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 297ffaeb 01-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Appended the new DoublyLinkedList implementation to DoublyLinkedList.h. The old implementation will go, when all the places where it is used have been adjusted.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11185 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3f7d503f 09-Mar-2004 Axel Dörfler <axeld@pinc-software.de>

Fixed DoublyLinkedList::Iterator().
Switched back to a pointer to the list in the Iterator internally, so
that it can still be just copied without having to overload "=", etc.
This fixes the boot loader build, too (shame on me).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6941 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8e623d69 02-Mar-2004 Axel Dörfler <axeld@pinc-software.de>

Made it a bit nicer to use.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6866 a95241bf-73f2-0310-859d-f6bbb57e9c96


# da69f272 12-Oct-2003 Axel Dörfler <axeld@pinc-software.de>

The iterator was broken.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5006 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8174112d 12-Oct-2003 Axel Dörfler <axeld@pinc-software.de>

Almost straight copy of the list.h doubly linked list implementation to
a C++ one ready for kernel use, but very basic, too.
Has not been tested yet, expect some bug fixes soon.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5001 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7008d2f61167277c317608d00693a5e6c26aaa93 31-Oct-2011 Michael Lotz <mmlr@mlotz.ch>

bonefish+mmlr:
Add a DoublyLinkedList::Contains() method to check if a list contains a certain
element.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43043 a95241bf-73f2-0310-859d-f6bbb57e9c96


# be7782af0f30248f7fc57dd315674c92ae37b08e 03-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed DoublyLinkedListLinkImpl constructor. DoublyLinkedListLink doesn't
have one anymore anyway.
* Removed unnecessary setting the list links to NULL after removing a node.
* Replaced "element == NULL" check in Insert() by an assert. This just hid
potential errors.
* Added Insert{Before,After}() methods and declared the Insert() version
with the InsertBefore() semantics obsolete.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34873 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4fb60da35720b0af99da49190912261bb9226fdf 06-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed the DoublyLinkedListLink constructor and destructor. They are not
necessary and prevent the structures from being used in a union.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34525 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8263f82d907aec4a394ab042d8972b5bc1deb498 06-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Missed that when cleaning up the style.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29980 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fd0803f3003a667986c914254b4735254cb4db4e 06-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Added RemoveTail() method.
* Renamed DoublyLinkedList::Size() to Count(), since it actually counts the
items (ie. O(n)).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29979 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5c99d639708df9b4e2cc847b38d510149d19ec78 22-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged branch haiku/branches/developer/bonefish/vm into trunk. This
introduces the following relevant changes:
* VMCache:
- Renamed vm_cache to VMCache, merged it with vm_store and made it a
C++ class with virtual methods (replacing the store operations).
Turned the different store implementations into subclasses.
- Introduced MergeStore() callback, changed semantics of Commit().
- Changed locking and referencing semantics. A reference can only be
acquired/released with the cache locked. An unreferenced cache is
deleted and a mergeable cache merged when it is unlocked. This
removes the "busy" state of a cache and simplifies the page fault
code.
* Added VMAnonymousCache, which will implement swap support (work by
Zhao Shuai). It is not integrated and used yet, though.
* Enabled the mutex/recursive lock holder asserts.
* Fixed DoublyLinkedList::Swap().
* Generalized the low memory handler to a low resource handler. And made
semaphores and reserved memory handled resources. Made
vm_try_resource_memory() optionally wait (with timeout), and used that
feature to reserve memory for areas.
...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26572 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c76695a275bafdb456058bd99b1c68e8fe6441b9 23-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* The C "struct list" and the C++ DoublyLinkedList implementations had mixed
next/prev link order - that messed up the DoublyLinkedListCLink adapter.
* Since it's more likely that someone messes with the C version, the C++ version
now uses the same order than that one.
* This fixes a bug when TCP's BufferQueue tried to iterate over a list, messing
up its integrity.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22676 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0cf4ed1de6b1c58f86f788f86e95bfa0dafb2332 05-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

MoveFrom() was broken. Fixes bug #1534.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22450 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 45f9d60c9fcf0b2e639915697fe4eca13f74c496 03-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Some KDEBUG enabled sanity checks.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22430 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5102d494616576ab7bacfdae9bf9f4fa4316d6d1 01-Aug-2007 Axel Dörfler <axeld@pinc-software.de>

* Added the default constructor to the Iterator class.
* Added a Current() method to the same class that returns the current element again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21779 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9781d591cb022992380e8a98db7639f91f9bb93c 11-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Include <util/kernel_cpp.h> in DoublyLinkedList.h only when compiling
for the kernel. Added missing includes in userland code that uses the
header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20366 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0dd2e9c328d046b9503b37a6f65b615a0f58ce2c 29-Jul-2006 Axel Dörfler <axeld@pinc-software.de>

* Changed Insert() to not only compile but also work differently in that it
inserts the item before, and not after the given element (that's probably
what you expected anyway).
* Added ReverseIterators.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18307 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c47f66179960ce0c52066ae454e0b7a1238f6414 18-Jul-2006 Axel Dörfler <axeld@pinc-software.de>

* Added a template class to bridge over to the struct list C stuff.
* Added an Insert() variant that can insert an element behind another one.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18199 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e7d4bde0b8ab4fc1bb1720e2c4cb00e11569cc53 27-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

Accidently broke ConstIterator::Rewind().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16902 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c918a987a0dadf05ccfae81bb0bcd2255c810680 27-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Removed my old doubly linked list implementation, and stay with Ingo's.
* Adapt other sources where needed (the boot loader's RootFileSystem still
used the old implementation).
* Implemented RootFileSystem::Rewind().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16889 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e05fe1042cce6e00d194a147802d4f9be 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f42f300bd5dfeb334c2ec3b62c12891a885f578d 01-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Work around a gcc bug: A private typedef in a base class can class with an equal identifier in a derived class.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11192 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 50d68edcf49b637575b997ef224fdb777e9b1cb3 01-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

It's fun to rename functions in templatized code. You only realize, that you missed some, when that specific part is instantiated.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11190 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2cfdb0ed38c862e156db0e6af9f9169caefc1780 01-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added DoublyLinkedListMemberGetLink class which directly accesses the
link member in the element class. Usually more comfortable for structs.
* Added Add() method as synonym for Insert().
* Made fGetLink member static to save memory in objects using it.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11188 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 297ffaeb842a64ffb6ae74a0b284183fb5fcb1fe 01-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Appended the new DoublyLinkedList implementation to DoublyLinkedList.h. The old implementation will go, when all the places where it is used have been adjusted.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11185 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3f7d503ff1b3566744723d5e4f6dda98e441e29b 09-Mar-2004 Axel Dörfler <axeld@pinc-software.de>

Fixed DoublyLinkedList::Iterator().
Switched back to a pointer to the list in the Iterator internally, so
that it can still be just copied without having to overload "=", etc.
This fixes the boot loader build, too (shame on me).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6941 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8e623d69b579250f485fa91308d1cc330427a2ea 02-Mar-2004 Axel Dörfler <axeld@pinc-software.de>

Made it a bit nicer to use.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6866 a95241bf-73f2-0310-859d-f6bbb57e9c96


# da69f272333cc7820edf784b004c2656105d8661 12-Oct-2003 Axel Dörfler <axeld@pinc-software.de>

The iterator was broken.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5006 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8174112d403e07fddc72d574aa02b2412700f5af 12-Oct-2003 Axel Dörfler <axeld@pinc-software.de>

Almost straight copy of the list.h doubly linked list implementation to
a C++ one ready for kernel use, but very basic, too.
Has not been tested yet, expect some bug fixes soon.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5001 a95241bf-73f2-0310-859d-f6bbb57e9c96