From 7dd018ab42a055a5c3d3c3c3d64690a48a1feb80 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 6 Nov 2015 22:15:07 +0200 Subject: card: use vectors with get_xxxs() methods --- libkms++/card.cpp | 35 +---------------------------------- libkms++/card.h | 11 +++++++---- 2 files changed, 8 insertions(+), 38 deletions(-) diff --git a/libkms++/card.cpp b/libkms++/card.cpp index 3aaa8a6..038d494 100644 --- a/libkms++/card.cpp +++ b/libkms++/card.cpp @@ -182,40 +182,7 @@ DrmObject* Card::get_object(uint32_t id) const return m_obmap.at(id); } -vector Card::get_connectors() const -{ - vector v; - for(auto pair : m_obmap) { - auto p = dynamic_cast(pair.second); - if (p) - v.push_back(p); - } - return v; -} - -vector Card::get_crtcs() const -{ - vector v; - for(auto pair : m_obmap) { - auto p = dynamic_cast(pair.second); - if (p) - v.push_back(p); - } - return v; -} - -vector Card::get_planes() const -{ - vector v; - for(auto pair : m_obmap) { - auto p = dynamic_cast(pair.second); - if (p) - v.push_back(p); - } - return v; -} - -vector Card::get_objects() const +const vector Card::get_objects() const { vector v; for(auto pair : m_obmap) diff --git a/libkms++/card.h b/libkms++/card.h index 25261be..cfc1cf2 100644 --- a/libkms++/card.h +++ b/libkms++/card.h @@ -37,10 +37,13 @@ public: void print_short() const; - std::vector get_connectors() const; - std::vector get_crtcs() const; - std::vector get_objects() const; - std::vector get_planes() const; + const std::vector get_connectors() const { return m_connectors; } + const std::vector get_encoders() const { return m_encoders; } + const std::vector get_crtcs() const { return m_crtcs; } + const std::vector get_planes() const { return m_planes; } + const std::vector get_properties() const { return m_properties; } + + const std::vector get_objects() const; std::vector get_connected_pipelines(); -- cgit v1.2.3