]> sigrok.org Git - pulseview.git/commitdiff
TraceTreeItemOwner: Removed non-const item_list accessor
authorJoel Holdsworth <redacted>
Sun, 30 Aug 2015 15:31:17 +0000 (09:31 -0600)
committerJoel Holdsworth <redacted>
Sun, 18 Oct 2015 21:32:29 +0000 (15:32 -0600)
pv/view/tracetreeitemowner.cpp
pv/view/tracetreeitemowner.hpp
pv/view/viewitemiterator.hpp
pv/view/viewitemowner.hpp

index af11ad2688b8d6f61c670d5398fd60ed470a4cf0..56433752889987d01becd4b92eb5c27cd86917cb 100644 (file)
@@ -37,12 +37,7 @@ using std::vector;
 namespace pv {
 namespace view {
 
-vector< shared_ptr<ViewItem> >& TraceTreeItemOwner::child_items()
-{
-       return items_;
-}
-
-const vector< shared_ptr<ViewItem> >& TraceTreeItemOwner::child_items() const
+const ViewItemOwner::item_list& TraceTreeItemOwner::child_items() const
 {
        return items_;
 }
index 025c34edad69f6f421d9fc9264f60e46f81f7e7a..cbb74427049af1db5b87eaeeb5d6ae0a31075a73 100644 (file)
@@ -63,11 +63,6 @@ public:
         */
        virtual unsigned int depth() const = 0;
 
-       /**
-        * Returns a list of row items owned by this object.
-        */
-       virtual item_list& child_items();
-
        /**
         * Returns a list of row items owned by this object.
         */
index 179de383965218d2b31321b96b67686ab424f316..eed67a939e1c63b683dec71c6d2b42eaeeef3302 100644 (file)
@@ -37,14 +37,11 @@ namespace view {
 template<class Owner, class Item> class ViewItemIterator
 {
 public:
-       typedef typename std::conditional<std::is_const<Owner>::value,
-               typename Owner::item_list::const_iterator,
-               typename Owner::item_list::iterator>::type child_iterator;
-
+       typedef typename Owner::item_list::const_iterator child_iterator;
        typedef std::shared_ptr<Item> value_type;
        typedef ptrdiff_t difference_type;
        typedef value_type pointer;
-       typedef value_type& reference;
+       typedef const value_type& reference;
        typedef std::forward_iterator_tag iterator_category;
 
 public:
index 60c8507626eaae243b12aba2b05c409609512be1..8d34059ad9fd9e9c37c54242ef16677e08ec22fd 100644 (file)
@@ -43,11 +43,6 @@ public:
        typedef ViewItemIterator<const ViewItemOwner, ViewItem> const_iterator;
 
 public:
-       /**
-        * Returns a list of row items owned by this object.
-        */
-       virtual item_list& child_items() = 0;
-
        /**
         * Returns a list of row items owned by this object.
         */