]> sigrok.org Git - pulseview.git/blobdiff - pv/view/tracetreeitemowner.hpp
TraceTreeItemOwner: Make list_by_type return a vector instead of a set
[pulseview.git] / pv / view / tracetreeitemowner.hpp
index 905746d6c5f956ab2787886efcb4b14ccfeea5a1..c17769953e7dcd7eeb2005dc9ca2bc0e29e65255 100644 (file)
@@ -128,7 +128,16 @@ public:
         * Creates a list of decendant signals filtered by type.
         */
        template<class T>
         * Creates a list of decendant signals filtered by type.
         */
        template<class T>
-       std::set< std::shared_ptr<T> > list_by_type();
+       std::vector< std::shared_ptr<T> > list_by_type() {
+               std::vector< std::shared_ptr<T> > items;
+               for (const auto &r : *this) {
+                       std::shared_ptr<T> p = std::dynamic_pointer_cast<T>(r);
+                       if (p)
+                               items.push_back(p);
+               }
+
+               return items;
+       }
 
        /**
         * Computes the vertical extents of the contents of this row item owner.
 
        /**
         * Computes the vertical extents of the contents of this row item owner.