Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean-up: tests: bt2 plug-ins: modernize the plug-ins
By virtue of their use of the C Babeltrace 2 APIs, the test plug-ins perform a fair amount of manual resource management. To make it possible to adopt a more modern C++ style in those plug-ins, a number of helpers are introduced. Introduce reference wrappers for the Babeltrace 2 interface: - value_ref: wraps a bt_value reference using std::unique_ptr - message_const_ref: wraps a constant message reference using a unique_ptr - message_iterator_ref: wraps a message iterator reference using a unique_ptr - event_class_const_ref: wraps a constant event class reference using a unique_ptr A specialized random_access_container_wrapper is specialized to wrap bt_value arrays of strings. In doing so, it is possible to eliminate the use of gotos and manual reference management on error paths. Some struct/classes are renamed to eliminate ambiguities that arose over the refactoring. The changes allow some simplifications of the code flow in places which are applied directly. Change-Id: I25c148d7970cb89add55a86f2c162973d3d27e4a Signed-off-by: Jérémie Galarneau <[email protected]>
- Loading branch information