[fbl] Make WAVLTreeConainable mulitply inheritable
Currently if you want to have your class able to live in multiple WAVLTrees at once, you have to give it multiple WAVLTreeNodeState members and define the node_state function in multiple NodeTraits classes. This change greatly simplifies this use case by allowing a class to inherit multiple times from fbl::WAVLTreeContainable and pass it a different tag type as the second template parameter each time. You then pass the same tag type to the WAVLTree template and you're good to go. I also defined a helper template fbl::ContainableBaseClasses which allows one to inherit from multiple Containable classes (even ones that aren't necessarily WAVLTreeContainable) without also explicitly inheriting from the fbl::HasTagTypes class, which is mostly an implementation detail. This helper template also contains static_asserts to give understandable error messages for common errors. TEST: CQ, new stuff in intrusive_wavl_tree_test.cpp Change-Id: Ib5d4d93b45152f8117ef2ad3fcdba6c70638bef9
Showing
- zircon/system/ulib/fbl/include/fbl/intrusive_container_utils.h 80 additions, 0 deletions...n/system/ulib/fbl/include/fbl/intrusive_container_utils.h
- zircon/system/ulib/fbl/include/fbl/intrusive_wavl_tree.h 112 additions, 30 deletionszircon/system/ulib/fbl/include/fbl/intrusive_wavl_tree.h
- zircon/system/ulib/fbl/include/fbl/intrusive_wavl_tree_internal.h 6 additions, 2 deletions...ystem/ulib/fbl/include/fbl/intrusive_wavl_tree_internal.h
- zircon/system/utest/fbl/include/fbl/tests/intrusive_containers/base_test_environments.h 170 additions, 0 deletions...e/fbl/tests/intrusive_containers/base_test_environments.h
- zircon/system/utest/fbl/include/fbl/tests/intrusive_containers/objects.h 14 additions, 5 deletions...test/fbl/include/fbl/tests/intrusive_containers/objects.h
- zircon/system/utest/fbl/include/fbl/tests/intrusive_containers/test_thunks.h 2 additions, 1 deletion.../fbl/include/fbl/tests/intrusive_containers/test_thunks.h
- zircon/system/utest/fbl/intrusive_doubly_linked_list_tests.cpp 6 additions, 0 deletions...n/system/utest/fbl/intrusive_doubly_linked_list_tests.cpp
- zircon/system/utest/fbl/intrusive_hash_table_dll_tests.cpp 6 additions, 0 deletionszircon/system/utest/fbl/intrusive_hash_table_dll_tests.cpp
- zircon/system/utest/fbl/intrusive_hash_table_sll_tests.cpp 6 additions, 0 deletionszircon/system/utest/fbl/intrusive_hash_table_sll_tests.cpp
- zircon/system/utest/fbl/intrusive_singly_linked_list_tests.cpp 6 additions, 0 deletions...n/system/utest/fbl/intrusive_singly_linked_list_tests.cpp
- zircon/system/utest/fbl/intrusive_wavl_tree_tests.cpp 30 additions, 0 deletionszircon/system/utest/fbl/intrusive_wavl_tree_tests.cpp
Loading
Please register or sign in to comment