X-Git-Url: http://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fviewitemowner.hpp;fp=pv%2Fview%2Fviewitemowner.hpp;h=0000000000000000000000000000000000000000;hp=dcec370f3fcd18afabfceba48dbc49dbe9fd10a5;hb=1573bf16ba50d1c023ad3a9ce596f0ab6eaeacff;hpb=4c7a19d3d7049bcc9fb3185ce2bc91333a7ca9e1 diff --git a/pv/view/viewitemowner.hpp b/pv/view/viewitemowner.hpp deleted file mode 100644 index dcec370f..00000000 --- a/pv/view/viewitemowner.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * This file is part of the PulseView project. - * - * Copyright (C) 2014 Joel Holdsworth - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMOWNER_HPP -#define PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMOWNER_HPP - -#include -#include - -#include "viewitemiterator.hpp" - -using std::dynamic_pointer_cast; -using std::shared_ptr; -using std::vector; - -namespace pv { - -class Session; - -namespace views { -namespace TraceView { - -class ViewItem; -class View; - -class ViewItemOwner -{ -public: - typedef vector< shared_ptr > item_list; - typedef ViewItemIterator iterator; - typedef ViewItemIterator const_iterator; - -public: - /** - * Returns a list of row items owned by this object. - */ - virtual const item_list& child_items() const = 0; - - /** - * Returns a depth-first iterator at the beginning of the child ViewItem - * tree. - */ - iterator begin(); - - /** - * Returns a depth-first iterator at the end of the child ViewItem tree. - */ - iterator end(); - - /** - * Returns a constant depth-first iterator at the beginning of the - * child ViewItem tree. - */ - const_iterator begin() const; - - /** - * Returns a constant depth-first iterator at the end of the child - * ViewItem tree. - */ - const_iterator end() const; - - /** - * Creates a list of descendant signals filtered by type. - */ - template - vector< shared_ptr > list_by_type() { - vector< shared_ptr > items; - for (const auto &r : *this) { - shared_ptr p = dynamic_pointer_cast(r); - if (p) - items.push_back(p); - } - - return items; - } - -protected: - item_list items_; -}; - -} // namespace TraceView -} // namespace views -} // namespace pv - -#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMOWNER_HPP