Commits on Source (5)
-
vlc_list.h provides struct vlc_list which is mostly designed to be used in C code to provide doubly-linked chained list, which is already exposed in C++ in an unintrusive way through std::list<> and work is still done in the standard[^1] to try to submit intrusive list support. However, some part of the public libvlccore API is exposing objects with vlc_list members, which enforce their usage in the C++ code without more standard alternative option. This MR adds a C++ wrapper around the vlc_list structure to be able to loop through vlc_list without the C macros. It has some limitations to avoid exploding the implementation and type complexity, in particular when it comes to the list<T>::reverse_list type which doesn't support operations (push_front, push_back, erase). However, the base list<T> type will support those using the same iterators. [^1]: https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0406r1.html Refs #28507 Co-authored-by:
Pierre Lamot <pierre@videolabs.io>
1398b183 -
Add some methods to replace their C counterpart when using a vlc_list, so that elements can be added and removed. Those methods are only supported on a vlc::list<T> wrapper, but they are not supported neither on the vlc::const_list<T> wrapper (which is expected) nor on the vlc::list::reverse_list wrapper from ::as_reverse() function, because it would complexify the design. The current workaround that was chosen is that vlc::list<T> is able to use iterators from the reversed list, and can be swapped with the reverse list object where needed. The limitation will be lifted with C++20 and concepts. Co-authored-by:
Alexandre Janniaux <ajanni@videolabs.io>
dd459dba -
The tests will check the correct behaviour of the iterators as well as the type validity for the templates once they are instantiated. They also check whether removal of the current element during iteration is working correctly both on the normal list wrapper and the reversed version. This is important given how tricky std::reverse_iterator can be. Co-authored-by:
Pierre Lamot <pierre@videolabs.io>
833fcc11 -
INLINE_INHERITED_MEMB = yes will make it so inherited members will be visible in the documentation of derived classes.
1697a21d -
The C++ wrapper for vlc_list is type-safe and doesn't depend on GCC compiler extension or vlc_fixups. Refs #28507
ef35d253
Showing
- doc/Doxyfile.in 1 addition, 1 deletiondoc/Doxyfile.in
- include/vlc_list.hpp 461 additions, 0 deletionsinclude/vlc_list.hpp
- modules/gui/qt/dialogs/mediainfo/info_panels.cpp 6 additions, 11 deletionsmodules/gui/qt/dialogs/mediainfo/info_panels.cpp
- src/Makefile.am 5 additions, 1 deletionsrc/Makefile.am
- src/test/list_cpp.cpp 305 additions, 0 deletionssrc/test/list_cpp.cpp
include/vlc_list.hpp
0 → 100644
src/test/list_cpp.cpp
0 → 100644