* 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, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef PULSEVIEW_PV_VIEW_VIEWITEMITERATOR_HPP
-#define PULSEVIEW_PV_VIEW_VIEWITEMITERATOR_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMITERATOR_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMITERATOR_HPP
#include <algorithm>
#include <cassert>
#include <pv/session.hpp>
+using std::dynamic_pointer_cast;
+using std::forward_iterator_tag;
+using std::shared_ptr;
+using std::stack;
+
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
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 std::shared_ptr<Item> value_type;
+ typedef typename Owner::item_list::const_iterator child_iterator;
+ typedef shared_ptr<Item> value_type;
typedef ptrdiff_t difference_type;
typedef value_type pointer;
- typedef value_type& reference;
- typedef std::forward_iterator_tag iterator_category;
+ typedef const value_type& reference;
+ typedef forward_iterator_tag iterator_category;
public:
ViewItemIterator(Owner *owner) :
}
ViewItemIterator<Owner, Item>& operator++() {
- using std::dynamic_pointer_cast;
- using std::shared_ptr;
-
assert(!owner_stack_.empty());
assert(!iter_stack_.empty());
}
private:
- std::stack<Owner*> owner_stack_;
- std::stack<child_iterator> iter_stack_;
+ stack<Owner*> owner_stack_;
+ stack<child_iterator> iter_stack_;
};
template<class Owner, class Item>
a.swap(b);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_VIEWITEMITERATOR_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMITERATOR_HPP